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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2655733003: Thread maybe-assigned through the bytecodes. (Closed)
Patch Set: Comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index c28d4687d8a8cf5b742626739d8cbeb50ee9dc54..75497cf2c16738f53ac9c24a8b01c94ea90ec75f 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1942,7 +1942,13 @@ void BytecodeGenerator::BuildVariableLoad(Variable* variable,
context_reg = execution_context()->reg();
}
- builder()->LoadContextSlot(context_reg, variable->index(), depth);
+ BytecodeArrayBuilder::ContextSlotMutability immutable =
+ (variable->maybe_assigned() == kNotAssigned)
+ ? BytecodeArrayBuilder::kImmutableSlot
+ : BytecodeArrayBuilder::kMutableSlot;
+
+ builder()->LoadContextSlot(context_reg, variable->index(), depth,
+ immutable);
if (hole_check_mode == HoleCheckMode::kRequired) {
BuildThrowIfHole(variable->name());
}
@@ -2106,7 +2112,8 @@ void BytecodeGenerator::BuildVariableAssignment(Variable* variable,
Register value_temp = register_allocator()->NewRegister();
builder()
->StoreAccumulatorInRegister(value_temp)
- .LoadContextSlot(context_reg, variable->index(), depth);
+ .LoadContextSlot(context_reg, variable->index(), depth,
+ BytecodeArrayBuilder::kMutableSlot);
BuildHoleCheckForVariableAssignment(variable, op);
builder()->LoadAccumulatorWithRegister(value_temp);
@@ -2737,9 +2744,11 @@ void BytecodeGenerator::VisitDelete(UnaryOperation* expr) {
Register global_object = register_allocator()->NewRegister();
builder()
->LoadContextSlot(execution_context()->reg(),
- Context::NATIVE_CONTEXT_INDEX, 0)
+ Context::NATIVE_CONTEXT_INDEX, 0,
+ BytecodeArrayBuilder::kMutableSlot)
.StoreAccumulatorInRegister(native_context)
- .LoadContextSlot(native_context, Context::EXTENSION_INDEX, 0)
+ .LoadContextSlot(native_context, Context::EXTENSION_INDEX, 0,
+ BytecodeArrayBuilder::kMutableSlot)
.StoreAccumulatorInRegister(global_object)
.LoadLiteral(variable->name())
.Delete(global_object, language_mode());
@@ -3251,15 +3260,18 @@ void BytecodeGenerator::VisitFunctionClosureForContext() {
Register native_context = register_allocator()->NewRegister();
builder()
->LoadContextSlot(execution_context()->reg(),
- Context::NATIVE_CONTEXT_INDEX, 0)
+ Context::NATIVE_CONTEXT_INDEX, 0,
+ BytecodeArrayBuilder::kMutableSlot)
.StoreAccumulatorInRegister(native_context)
- .LoadContextSlot(native_context, Context::CLOSURE_INDEX, 0);
+ .LoadContextSlot(native_context, Context::CLOSURE_INDEX, 0,
+ BytecodeArrayBuilder::kMutableSlot);
} else if (closure_scope->is_eval_scope()) {
// Contexts created by a call to eval have the same closure as the
// context calling eval, not the anonymous closure containing the eval
// code. Fetch it from the context.
builder()->LoadContextSlot(execution_context()->reg(),
- Context::CLOSURE_INDEX, 0);
+ Context::CLOSURE_INDEX, 0,
+ BytecodeArrayBuilder::kMutableSlot);
} else {
DCHECK(closure_scope->is_function_scope() ||
closure_scope->is_module_scope());
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698