| OLD | NEW |
| 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ConsStringIteratorOp op; | 182 ConsStringIteratorOp op; |
| 183 StringCharacterStream stream(String::cast(script->source()), | 183 StringCharacterStream stream(String::cast(script->source()), |
| 184 &op, | 184 &op, |
| 185 function->start_position()); | 185 function->start_position()); |
| 186 // fun->end_position() points to the last character in the stream. We | 186 // fun->end_position() points to the last character in the stream. We |
| 187 // need to compensate by adding one to calculate the length. | 187 // need to compensate by adding one to calculate the length. |
| 188 int source_len = | 188 int source_len = |
| 189 function->end_position() - function->start_position() + 1; | 189 function->end_position() - function->start_position() + 1; |
| 190 for (int i = 0; i < source_len; i++) { | 190 for (int i = 0; i < source_len; i++) { |
| 191 if (stream.HasMore()) { | 191 if (stream.HasMore()) { |
| 192 os << AsUC16(stream.GetNext()); | 192 os << AsReversiblyEscapedUC16(stream.GetNext()); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 os << "\n\n"; | 195 os << "\n\n"; |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 if (info->IsOptimizing()) { | 198 if (info->IsOptimizing()) { |
| 199 if (FLAG_print_unopt_code) { | 199 if (FLAG_print_unopt_code) { |
| 200 os << "--- Unoptimized code ---\n"; | 200 os << "--- Unoptimized code ---\n"; |
| 201 info->closure()->shared()->code()->Disassemble( | 201 info->closure()->shared()->code()->Disassemble( |
| 202 function->debug_name()->ToCString().get(), os); | 202 function->debug_name()->ToCString().get(), os); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 228 masm->positions_recorder()->RecordStatementPosition(pos); | 228 masm->positions_recorder()->RecordStatementPosition(pos); |
| 229 masm->positions_recorder()->RecordPosition(pos); | 229 masm->positions_recorder()->RecordPosition(pos); |
| 230 if (right_here) { | 230 if (right_here) { |
| 231 return masm->positions_recorder()->WriteRecordedPositions(); | 231 return masm->positions_recorder()->WriteRecordedPositions(); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 return false; | 234 return false; |
| 235 } | 235 } |
| 236 | 236 |
| 237 } } // namespace v8::internal | 237 } } // namespace v8::internal |
| OLD | NEW |