OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 Handle<HeapObject> scope_info(shared->outer_scope_info()); | 56 Handle<HeapObject> scope_info(shared->outer_scope_info()); |
57 if (!scope_info->IsTheHole(isolate()) && | 57 if (!scope_info->IsTheHole(isolate()) && |
58 Handle<ScopeInfo>::cast(scope_info)->length() > 0) { | 58 Handle<ScopeInfo>::cast(scope_info)->length() > 0) { |
59 set_outer_scope_info(Handle<ScopeInfo>::cast(scope_info)); | 59 set_outer_scope_info(Handle<ScopeInfo>::cast(scope_info)); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) { | 63 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) { |
64 isolate_ = script->GetIsolate(); | 64 isolate_ = script->GetIsolate(); |
65 | 65 |
66 set_allow_lazy_parsing(String::cast(script->source())->length() > | 66 set_allow_lazy_parsing(); |
67 FLAG_min_preparse_length); | |
68 set_toplevel(); | 67 set_toplevel(); |
69 set_hash_seed(isolate_->heap()->HashSeed()); | 68 set_hash_seed(isolate_->heap()->HashSeed()); |
70 set_stack_limit(isolate_->stack_guard()->real_climit()); | 69 set_stack_limit(isolate_->stack_guard()->real_climit()); |
71 set_unicode_cache(isolate_->unicode_cache()); | 70 set_unicode_cache(isolate_->unicode_cache()); |
72 set_script(script); | 71 set_script(script); |
73 | 72 |
74 set_native(script->type() == Script::TYPE_NATIVE); | 73 set_native(script->type() == Script::TYPE_NATIVE); |
75 set_eval(script->compilation_type() == Script::COMPILATION_TYPE_EVAL); | 74 set_eval(script->compilation_type() == Script::COMPILATION_TYPE_EVAL); |
76 } | 75 } |
77 | 76 |
(...skipping 25 matching lines...) Expand all Loading... |
103 } | 102 } |
104 | 103 |
105 #ifdef DEBUG | 104 #ifdef DEBUG |
106 bool ParseInfo::script_is_native() const { | 105 bool ParseInfo::script_is_native() const { |
107 return script_->type() == Script::TYPE_NATIVE; | 106 return script_->type() == Script::TYPE_NATIVE; |
108 } | 107 } |
109 #endif // DEBUG | 108 #endif // DEBUG |
110 | 109 |
111 } // namespace internal | 110 } // namespace internal |
112 } // namespace v8 | 111 } // namespace v8 |
OLD | NEW |