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 <memory> |
| 8 |
7 #include "src/arguments.h" | 9 #include "src/arguments.h" |
8 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
9 #include "src/bootstrapper.h" | 11 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 12 #include "src/conversions.h" |
11 #include "src/debug/debug.h" | 13 #include "src/debug/debug.h" |
12 #include "src/frames-inl.h" | 14 #include "src/frames-inl.h" |
13 #include "src/isolate-inl.h" | 15 #include "src/isolate-inl.h" |
14 #include "src/messages.h" | 16 #include "src/messages.h" |
15 #include "src/parsing/parser.h" | 17 #include "src/parsing/parser.h" |
16 #include "src/wasm/wasm-module.h" | 18 #include "src/wasm/wasm-module.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 426 } |
425 } | 427 } |
426 return false; | 428 return false; |
427 } | 429 } |
428 | 430 |
429 | 431 |
430 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { | 432 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { |
431 MessageLocation location; | 433 MessageLocation location; |
432 if (ComputeLocation(isolate, &location)) { | 434 if (ComputeLocation(isolate, &location)) { |
433 Zone zone(isolate->allocator()); | 435 Zone zone(isolate->allocator()); |
434 base::SmartPointer<ParseInfo> info( | 436 std::unique_ptr<ParseInfo> info( |
435 location.function()->shared()->is_function() | 437 location.function()->shared()->is_function() |
436 ? new ParseInfo(&zone, location.function()) | 438 ? new ParseInfo(&zone, location.function()) |
437 : new ParseInfo(&zone, location.script())); | 439 : new ParseInfo(&zone, location.script())); |
438 if (Parser::ParseStatic(info.get())) { | 440 if (Parser::ParseStatic(info.get())) { |
439 CallPrinter printer(isolate, location.function()->shared()->IsBuiltin()); | 441 CallPrinter printer(isolate, location.function()->shared()->IsBuiltin()); |
440 const char* string = printer.Print(info->literal(), location.start_pos()); | 442 const char* string = printer.Print(info->literal(), location.start_pos()); |
441 if (strlen(string) > 0) { | 443 if (strlen(string) > 0) { |
442 return isolate->factory()->NewStringFromAsciiChecked(string); | 444 return isolate->factory()->NewStringFromAsciiChecked(string); |
443 } | 445 } |
444 } else { | 446 } else { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 HandleScope scope(isolate); | 580 HandleScope scope(isolate); |
579 DCHECK_EQ(1, args.length()); | 581 DCHECK_EQ(1, args.length()); |
580 CONVERT_ARG_CHECKED(Object, object, 0); | 582 CONVERT_ARG_CHECKED(Object, object, 0); |
581 bool is_wasm_object = | 583 bool is_wasm_object = |
582 object->IsJSObject() && wasm::IsWasmObject(JSObject::cast(object)); | 584 object->IsJSObject() && wasm::IsWasmObject(JSObject::cast(object)); |
583 return *isolate->factory()->ToBoolean(is_wasm_object); | 585 return *isolate->factory()->ToBoolean(is_wasm_object); |
584 } | 586 } |
585 | 587 |
586 } // namespace internal | 588 } // namespace internal |
587 } // namespace v8 | 589 } // namespace v8 |
OLD | NEW |