| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |