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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2662093004: [turbofan] Mark loads of a module (from a module context) immutable. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | test/mjsunit/modules-turbo2.js » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/compiler-source-position-table.h" 10 #include "src/compiler/compiler-source-position-table.h"
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 BuildKeyedStore(LanguageMode::SLOPPY); 1061 BuildKeyedStore(LanguageMode::SLOPPY);
1062 } 1062 }
1063 1063
1064 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { 1064 void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() {
1065 BuildKeyedStore(LanguageMode::STRICT); 1065 BuildKeyedStore(LanguageMode::STRICT);
1066 } 1066 }
1067 1067
1068 void BytecodeGraphBuilder::VisitLdaModuleVariable() { 1068 void BytecodeGraphBuilder::VisitLdaModuleVariable() {
1069 int32_t cell_index = bytecode_iterator().GetImmediateOperand(0); 1069 int32_t cell_index = bytecode_iterator().GetImmediateOperand(0);
1070 uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1); 1070 uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1);
1071 Node* module = NewNode( 1071 Node* module =
1072 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false)); 1072 NewNode(javascript()->LoadContext(depth, Context::EXTENSION_INDEX, true));
1073 Node* value = NewNode(javascript()->LoadModule(cell_index), module); 1073 Node* value = NewNode(javascript()->LoadModule(cell_index), module);
1074 environment()->BindAccumulator(value); 1074 environment()->BindAccumulator(value);
1075 } 1075 }
1076 1076
1077 void BytecodeGraphBuilder::VisitStaModuleVariable() { 1077 void BytecodeGraphBuilder::VisitStaModuleVariable() {
1078 int32_t cell_index = bytecode_iterator().GetImmediateOperand(0); 1078 int32_t cell_index = bytecode_iterator().GetImmediateOperand(0);
1079 uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1); 1079 uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1);
1080 Node* module = NewNode( 1080 Node* module =
1081 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false)); 1081 NewNode(javascript()->LoadContext(depth, Context::EXTENSION_INDEX, true));
1082 Node* value = environment()->LookupAccumulator(); 1082 Node* value = environment()->LookupAccumulator();
1083 NewNode(javascript()->StoreModule(cell_index), module, value); 1083 NewNode(javascript()->StoreModule(cell_index), module, value);
1084 } 1084 }
1085 1085
1086 void BytecodeGraphBuilder::VisitPushContext() { 1086 void BytecodeGraphBuilder::VisitPushContext() {
1087 Node* new_context = environment()->LookupAccumulator(); 1087 Node* new_context = environment()->LookupAccumulator();
1088 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), 1088 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0),
1089 environment()->Context()); 1089 environment()->Context());
1090 environment()->SetContext(new_context); 1090 environment()->SetContext(new_context);
1091 } 1091 }
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 it->source_position().ScriptOffset(), start_position_.InliningId())); 2301 it->source_position().ScriptOffset(), start_position_.InliningId()));
2302 it->Advance(); 2302 it->Advance();
2303 } else { 2303 } else {
2304 DCHECK_GT(it->code_offset(), offset); 2304 DCHECK_GT(it->code_offset(), offset);
2305 } 2305 }
2306 } 2306 }
2307 2307
2308 } // namespace compiler 2308 } // namespace compiler
2309 } // namespace internal 2309 } // namespace internal
2310 } // namespace v8 2310 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/modules-turbo2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698