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

Side by Side Diff: src/prettyprinter.cc

Issue 13932006: Replace OS::MemCopy with OS::MemMove (just as fast but more flexible). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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/preparser-api.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 if (n >= 0) { 499 if (n >= 0) {
500 // there was enough space - we are done 500 // there was enough space - we are done
501 pos_ += n; 501 pos_ += n;
502 return; 502 return;
503 } else { 503 } else {
504 // there was not enough space - allocate more and try again 504 // there was not enough space - allocate more and try again
505 const int slack = 32; 505 const int slack = 32;
506 int new_size = size_ + (size_ >> 1) + slack; 506 int new_size = size_ + (size_ >> 1) + slack;
507 char* new_output = NewArray<char>(new_size); 507 char* new_output = NewArray<char>(new_size);
508 memcpy(new_output, output_, pos_); 508 OS::MemCopy(new_output, output_, pos_);
509 DeleteArray(output_); 509 DeleteArray(output_);
510 output_ = new_output; 510 output_ = new_output;
511 size_ = new_size; 511 size_ = new_size;
512 } 512 }
513 } 513 }
514 } 514 }
515 515
516 516
517 void PrettyPrinter::PrintStatements(ZoneList<Statement*>* statements) { 517 void PrettyPrinter::PrintStatements(ZoneList<Statement*>* statements) {
518 if (statements == NULL) return; 518 if (statements == NULL) return;
(...skipping 616 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/preparser-api.cc ('k') | src/regexp-macro-assembler-irregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698