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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 ConsStringIteratorOp op; | 183 ConsStringIteratorOp op; |
184 StringCharacterStream stream(String::cast(script->source()), | 184 StringCharacterStream stream(String::cast(script->source()), |
185 &op, | 185 &op, |
186 function->start_position()); | 186 function->start_position()); |
187 // fun->end_position() points to the last character in the stream. We | 187 // fun->end_position() points to the last character in the stream. We |
188 // need to compensate by adding one to calculate the length. | 188 // need to compensate by adding one to calculate the length. |
189 int source_len = | 189 int source_len = |
190 function->end_position() - function->start_position() + 1; | 190 function->end_position() - function->start_position() + 1; |
191 for (int i = 0; i < source_len; i++) { | 191 for (int i = 0; i < source_len; i++) { |
192 if (stream.HasMore()) { | 192 if (stream.HasMore()) { |
193 os.put(stream.GetNext()); | 193 os << AsUC16(stream.GetNext()); |
194 } | 194 } |
195 } | 195 } |
196 os << "\n\n"; | 196 os << "\n\n"; |
197 } | 197 } |
198 } | 198 } |
199 if (info->IsOptimizing()) { | 199 if (info->IsOptimizing()) { |
200 if (FLAG_print_unopt_code) { | 200 if (FLAG_print_unopt_code) { |
201 os << "--- Unoptimized code ---\n"; | 201 os << "--- Unoptimized code ---\n"; |
202 info->closure()->shared()->code()->Disassemble( | 202 info->closure()->shared()->code()->Disassemble( |
203 function->debug_name()->ToCString().get(), os); | 203 function->debug_name()->ToCString().get(), os); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 ASSERT(result_size_ == 1 || result_size_ == 2); | 259 ASSERT(result_size_ == 1 || result_size_ == 2); |
260 #ifdef _WIN64 | 260 #ifdef _WIN64 |
261 return result | ((result_size_ == 1) ? 0 : 2); | 261 return result | ((result_size_ == 1) ? 0 : 2); |
262 #else | 262 #else |
263 return result; | 263 return result; |
264 #endif | 264 #endif |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 } } // namespace v8::internal | 268 } } // namespace v8::internal |
OLD | NEW |