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

Side by Side Diff: src/parsing/parse-info.cc

Issue 2417643004: Explicitly check for lazy parser when dealing with parser cache (Closed)
Patch Set: Reset compile options to kNoCompileOptions if the cache is invalid Created 4 years, 2 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
« no previous file with comments | « src/parsing/parse-info.h ('k') | src/parsing/parser.h » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/parsing/parse-info.h" 5 #include "src/parsing/parse-info.h"
6 6
7 #include "src/ast/ast-value-factory.h" 7 #include "src/ast/ast-value-factory.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 Handle<HeapObject> scope_info(shared->outer_scope_info()); 59 Handle<HeapObject> scope_info(shared->outer_scope_info());
60 if (!scope_info->IsTheHole(isolate()) && 60 if (!scope_info->IsTheHole(isolate()) &&
61 Handle<ScopeInfo>::cast(scope_info)->length() > 0) { 61 Handle<ScopeInfo>::cast(scope_info)->length() > 0) {
62 set_outer_scope_info(Handle<ScopeInfo>::cast(scope_info)); 62 set_outer_scope_info(Handle<ScopeInfo>::cast(scope_info));
63 } 63 }
64 } 64 }
65 65
66 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) { 66 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
67 isolate_ = script->GetIsolate(); 67 isolate_ = script->GetIsolate();
68 68
69 set_allow_lazy_parsing(String::cast(script->source())->length() >
70 FLAG_min_preparse_length);
69 set_toplevel(); 71 set_toplevel();
70 set_hash_seed(isolate_->heap()->HashSeed()); 72 set_hash_seed(isolate_->heap()->HashSeed());
71 set_stack_limit(isolate_->stack_guard()->real_climit()); 73 set_stack_limit(isolate_->stack_guard()->real_climit());
72 set_unicode_cache(isolate_->unicode_cache()); 74 set_unicode_cache(isolate_->unicode_cache());
73 set_script(script); 75 set_script(script);
74 76
75 set_native(script->type() == Script::TYPE_NATIVE); 77 set_native(script->type() == Script::TYPE_NATIVE);
76 set_eval(script->compilation_type() == Script::COMPILATION_TYPE_EVAL); 78 set_eval(script->compilation_type() == Script::COMPILATION_TYPE_EVAL);
77 } 79 }
78 80
(...skipping 25 matching lines...) Expand all
104 } 106 }
105 107
106 #ifdef DEBUG 108 #ifdef DEBUG
107 bool ParseInfo::script_is_native() const { 109 bool ParseInfo::script_is_native() const {
108 return script_->type() == Script::TYPE_NATIVE; 110 return script_->type() == Script::TYPE_NATIVE;
109 } 111 }
110 #endif // DEBUG 112 #endif // DEBUG
111 113
112 } // namespace internal 114 } // namespace internal
113 } // namespace v8 115 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parse-info.h ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698