OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 368 matching lines...) Loading... |
379 return true; | 379 return true; |
380 } | 380 } |
381 } | 381 } |
382 return false; | 382 return false; |
383 } | 383 } |
384 | 384 |
385 | 385 |
386 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { | 386 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { |
387 MessageLocation location; | 387 MessageLocation location; |
388 if (ComputeLocation(isolate, &location)) { | 388 if (ComputeLocation(isolate, &location)) { |
389 Zone zone; | 389 Zone zone(isolate->allocator()); |
390 base::SmartPointer<ParseInfo> info( | 390 base::SmartPointer<ParseInfo> info( |
391 location.function()->shared()->is_function() | 391 location.function()->shared()->is_function() |
392 ? new ParseInfo(&zone, location.function()) | 392 ? new ParseInfo(&zone, location.function()) |
393 : new ParseInfo(&zone, location.script())); | 393 : new ParseInfo(&zone, location.script())); |
394 if (Parser::ParseStatic(info.get())) { | 394 if (Parser::ParseStatic(info.get())) { |
395 CallPrinter printer(isolate, location.function()->shared()->IsBuiltin()); | 395 CallPrinter printer(isolate, location.function()->shared()->IsBuiltin()); |
396 const char* string = printer.Print(info->literal(), location.start_pos()); | 396 const char* string = printer.Print(info->literal(), location.start_pos()); |
397 if (strlen(string) > 0) { | 397 if (strlen(string) > 0) { |
398 return isolate->factory()->NewStringFromAsciiChecked(string); | 398 return isolate->factory()->NewStringFromAsciiChecked(string); |
399 } | 399 } |
(...skipping 69 matching lines...) Loading... |
469 std::stringstream stats_stream; | 469 std::stringstream stats_stream; |
470 isolate->counters()->runtime_call_stats()->Print(stats_stream); | 470 isolate->counters()->runtime_call_stats()->Print(stats_stream); |
471 Handle<String> result = | 471 Handle<String> result = |
472 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); | 472 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); |
473 isolate->counters()->runtime_call_stats()->Reset(); | 473 isolate->counters()->runtime_call_stats()->Reset(); |
474 return *result; | 474 return *result; |
475 } | 475 } |
476 | 476 |
477 } // namespace internal | 477 } // namespace internal |
478 } // namespace v8 | 478 } // namespace v8 |
OLD | NEW |