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> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 return true; | 345 return true; |
346 } | 346 } |
347 } | 347 } |
348 return false; | 348 return false; |
349 } | 349 } |
350 | 350 |
351 | 351 |
352 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { | 352 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { |
353 MessageLocation location; | 353 MessageLocation location; |
354 if (ComputeLocation(isolate, &location)) { | 354 if (ComputeLocation(isolate, &location)) { |
355 Zone zone(isolate->allocator(), ZONE_NAME); | 355 std::unique_ptr<ParseInfo> info(new ParseInfo(location.shared())); |
356 std::unique_ptr<ParseInfo> info(new ParseInfo(&zone, location.shared())); | |
357 if (parsing::ParseAny(info.get())) { | 356 if (parsing::ParseAny(info.get())) { |
358 CallPrinter printer(isolate, location.shared()->IsUserJavaScript()); | 357 CallPrinter printer(isolate, location.shared()->IsUserJavaScript()); |
359 Handle<String> str = printer.Print(info->literal(), location.start_pos()); | 358 Handle<String> str = printer.Print(info->literal(), location.start_pos()); |
360 if (str->length() > 0) return str; | 359 if (str->length() > 0) return str; |
361 } else { | 360 } else { |
362 isolate->clear_pending_exception(); | 361 isolate->clear_pending_exception(); |
363 } | 362 } |
364 } | 363 } |
365 return Object::TypeOf(isolate, object); | 364 return Object::TypeOf(isolate, object); |
366 } | 365 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 HandleScope scope(isolate); | 492 HandleScope scope(isolate); |
494 DCHECK_EQ(1, args.length()); | 493 DCHECK_EQ(1, args.length()); |
495 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 494 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
496 Handle<JSObject> global_proxy(target->global_proxy(), isolate); | 495 Handle<JSObject> global_proxy(target->global_proxy(), isolate); |
497 return *isolate->factory()->ToBoolean( | 496 return *isolate->factory()->ToBoolean( |
498 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); | 497 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); |
499 } | 498 } |
500 | 499 |
501 } // namespace internal | 500 } // namespace internal |
502 } // namespace v8 | 501 } // namespace v8 |
OLD | NEW |