Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 2632123006: Reland: [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 return true; 343 return true;
344 } 344 }
345 } 345 }
346 return false; 346 return false;
347 } 347 }
348 348
349 349
350 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { 350 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) {
351 MessageLocation location; 351 MessageLocation location;
352 if (ComputeLocation(isolate, &location)) { 352 if (ComputeLocation(isolate, &location)) {
353 Zone zone(isolate->allocator(), ZONE_NAME); 353 std::unique_ptr<ParseInfo> info(new ParseInfo(location.shared()));
354 std::unique_ptr<ParseInfo> info(new ParseInfo(&zone, location.shared()));
355 if (parsing::ParseAny(info.get())) { 354 if (parsing::ParseAny(info.get())) {
356 CallPrinter printer(isolate, location.shared()->IsUserJavaScript()); 355 CallPrinter printer(isolate, location.shared()->IsUserJavaScript());
357 Handle<String> str = printer.Print(info->literal(), location.start_pos()); 356 Handle<String> str = printer.Print(info->literal(), location.start_pos());
358 if (str->length() > 0) return str; 357 if (str->length() > 0) return str;
359 } else { 358 } else {
360 isolate->clear_pending_exception(); 359 isolate->clear_pending_exception();
361 } 360 }
362 } 361 }
363 return Object::TypeOf(isolate, object); 362 return Object::TypeOf(isolate, object);
364 } 363 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 HandleScope scope(isolate); 490 HandleScope scope(isolate);
492 DCHECK_EQ(1, args.length()); 491 DCHECK_EQ(1, args.length());
493 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); 492 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0);
494 Handle<JSObject> global_proxy(target->global_proxy(), isolate); 493 Handle<JSObject> global_proxy(target->global_proxy(), isolate);
495 return *isolate->factory()->ToBoolean( 494 return *isolate->factory()->ToBoolean(
496 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); 495 Builtins::AllowDynamicFunction(isolate, target, global_proxy));
497 } 496 }
498 497
499 } // namespace internal 498 } // namespace internal
500 } // namespace v8 499 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698