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

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

Issue 2534393002: Split parsing of functions and top-level code into two separate methods (Closed)
Patch Set: updates Created 4 years 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
« no previous file with comments | « src/parsing/preparser.h ('k') | src/v8.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "src/bootstrapper.h" 11 #include "src/bootstrapper.h"
12 #include "src/conversions.h" 12 #include "src/conversions.h"
13 #include "src/debug/debug.h" 13 #include "src/debug/debug.h"
14 #include "src/frames-inl.h" 14 #include "src/frames-inl.h"
15 #include "src/isolate-inl.h" 15 #include "src/isolate-inl.h"
16 #include "src/messages.h" 16 #include "src/messages.h"
17 #include "src/parsing/parse-info.h" 17 #include "src/parsing/parse-info.h"
18 #include "src/parsing/parser.h" 18 #include "src/parsing/parsing.h"
19 #include "src/wasm/wasm-module.h" 19 #include "src/wasm/wasm-module.h"
20 20
21 namespace v8 { 21 namespace v8 {
22 namespace internal { 22 namespace internal {
23 23
24 RUNTIME_FUNCTION(Runtime_CheckIsBootstrapping) { 24 RUNTIME_FUNCTION(Runtime_CheckIsBootstrapping) {
25 SealHandleScope shs(isolate); 25 SealHandleScope shs(isolate);
26 DCHECK(args.length() == 0); 26 DCHECK(args.length() == 0);
27 CHECK(isolate->bootstrapper()->IsActive()); 27 CHECK(isolate->bootstrapper()->IsActive());
28 return isolate->heap()->undefined_value(); 28 return isolate->heap()->undefined_value();
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 382 }
383 } 383 }
384 return false; 384 return false;
385 } 385 }
386 386
387 387
388 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { 388 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) {
389 MessageLocation location; 389 MessageLocation location;
390 if (ComputeLocation(isolate, &location)) { 390 if (ComputeLocation(isolate, &location)) {
391 Zone zone(isolate->allocator(), ZONE_NAME); 391 Zone zone(isolate->allocator(), ZONE_NAME);
392 std::unique_ptr<ParseInfo> info( 392 std::unique_ptr<ParseInfo> info;
393 location.function()->shared()->is_function() 393 if (location.function()->shared()->is_function()) {
394 ? new ParseInfo(&zone, handle(location.function()->shared())) 394 info.reset(new ParseInfo(&zone, handle(location.function()->shared())));
395 : new ParseInfo(&zone, location.script())); 395 } else {
396 if (Parser::ParseStatic(info.get())) { 396 info.reset(new ParseInfo(&zone, location.script()));
397 }
398 if (parsing::ParseAny(info.get())) {
397 CallPrinter printer(isolate, 399 CallPrinter printer(isolate,
398 location.function()->shared()->IsUserJavaScript()); 400 location.function()->shared()->IsUserJavaScript());
399 Handle<String> str = printer.Print(info->literal(), location.start_pos()); 401 Handle<String> str = printer.Print(info->literal(), location.start_pos());
400 if (str->length() > 0) return str; 402 if (str->length() > 0) return str;
401 } else { 403 } else {
402 isolate->clear_pending_exception(); 404 isolate->clear_pending_exception();
403 } 405 }
404 } 406 }
405 return Object::TypeOf(isolate, object); 407 return Object::TypeOf(isolate, object);
406 } 408 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 535
534 RUNTIME_FUNCTION(Runtime_Typeof) { 536 RUNTIME_FUNCTION(Runtime_Typeof) {
535 HandleScope scope(isolate); 537 HandleScope scope(isolate);
536 DCHECK_EQ(1, args.length()); 538 DCHECK_EQ(1, args.length());
537 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 539 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
538 return *Object::TypeOf(isolate, object); 540 return *Object::TypeOf(isolate, object);
539 } 541 }
540 542
541 } // namespace internal 543 } // namespace internal
542 } // namespace v8 544 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698