Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: src/prettyprinter.cc

Issue 306473004: Reland 21502 - "Move OS::MemCopy and OS::MemMove out of platform to utils" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/preparse-data.cc ('k') | src/regexp-macro-assembler-irregexp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdarg.h> 5 #include <stdarg.h>
6 6
7 #include "v8.h" 7 #include "v8.h"
8 8
9 #include "prettyprinter.h" 9 #include "prettyprinter.h"
10 #include "scopes.h" 10 #include "scopes.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 499
500 if (n >= 0) { 500 if (n >= 0) {
501 // there was enough space - we are done 501 // there was enough space - we are done
502 pos_ += n; 502 pos_ += n;
503 return; 503 return;
504 } else { 504 } else {
505 // there was not enough space - allocate more and try again 505 // there was not enough space - allocate more and try again
506 const int slack = 32; 506 const int slack = 32;
507 int new_size = size_ + (size_ >> 1) + slack; 507 int new_size = size_ + (size_ >> 1) + slack;
508 char* new_output = NewArray<char>(new_size); 508 char* new_output = NewArray<char>(new_size);
509 OS::MemCopy(new_output, output_, pos_); 509 MemCopy(new_output, output_, pos_);
510 DeleteArray(output_); 510 DeleteArray(output_);
511 output_ = new_output; 511 output_ = new_output;
512 size_ = new_size; 512 size_ = new_size;
513 } 513 }
514 } 514 }
515 } 515 }
516 516
517 517
518 void PrettyPrinter::PrintStatements(ZoneList<Statement*>* statements) { 518 void PrettyPrinter::PrintStatements(ZoneList<Statement*>* statements) {
519 if (statements == NULL) return; 519 if (statements == NULL) return;
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 } 1135 }
1136 1136
1137 1137
1138 void AstPrinter::VisitThisFunction(ThisFunction* node) { 1138 void AstPrinter::VisitThisFunction(ThisFunction* node) {
1139 IndentedScope indent(this, "THIS-FUNCTION"); 1139 IndentedScope indent(this, "THIS-FUNCTION");
1140 } 1140 }
1141 1141
1142 #endif // DEBUG 1142 #endif // DEBUG
1143 1143
1144 } } // namespace v8::internal 1144 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/preparse-data.cc ('k') | src/regexp-macro-assembler-irregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698