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

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

Issue 2342443004: Only pass the outer scope info with ParseInfo (Closed)
Patch Set: rebase Created 4 years, 3 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 15 matching lines...) Expand all
26 start_position_(0), 26 start_position_(0),
27 end_position_(0), 27 end_position_(0),
28 isolate_(nullptr), 28 isolate_(nullptr),
29 cached_data_(nullptr), 29 cached_data_(nullptr),
30 ast_value_factory_(nullptr), 30 ast_value_factory_(nullptr),
31 function_name_(nullptr), 31 function_name_(nullptr),
32 literal_(nullptr) {} 32 literal_(nullptr) {}
33 33
34 ParseInfo::ParseInfo(Zone* zone, Handle<JSFunction> function) 34 ParseInfo::ParseInfo(Zone* zone, Handle<JSFunction> function)
35 : ParseInfo(zone, Handle<SharedFunctionInfo>(function->shared())) { 35 : ParseInfo(zone, Handle<SharedFunctionInfo>(function->shared())) {
36 set_context(Handle<Context>(function->context())); 36 if (!function->context()->IsNativeContext()) {
37 set_outer_scope_info(handle(function->context()->scope_info()));
38 }
37 } 39 }
38 40
39 ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared) 41 ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
40 : ParseInfo(zone) { 42 : ParseInfo(zone) {
41 isolate_ = shared->GetIsolate(); 43 isolate_ = shared->GetIsolate();
42 44
43 set_lazy(); 45 set_lazy();
44 set_hash_seed(isolate_->heap()->HashSeed()); 46 set_hash_seed(isolate_->heap()->HashSeed());
45 set_is_named_expression(shared->is_named_expression()); 47 set_is_named_expression(shared->is_named_expression());
46 set_calls_eval(shared->scope_info()->CallsEval()); 48 set_calls_eval(shared->scope_info()->CallsEval());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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