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

Unified Diff: src/interpreter/interpreter.cc

Issue 1406183002: [Interpreter] Add support for strict mode global stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index a6e9317e0f03e2d8a3175314f1b258d77be8bae4..518c0830093919502ccc91996f471c19fd3d5aa8 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -196,10 +196,11 @@ void Interpreter::DoLdaGlobal(compiler::InterpreterAssembler* assembler) {
}
-// StaGlobal <slot_index>
+// StaGlobalSloppy <slot_index>
//
-// Store the global at |slot_index| with the value in the the accumulator.
-void Interpreter::DoStaGlobal(compiler::InterpreterAssembler* assembler) {
+// Store the global at |slot_index| with the value in the the accumulator in
+// sloppy mode.
+void Interpreter::DoStaGlobalSloppy(compiler::InterpreterAssembler* assembler) {
Node* slot_index = __ BytecodeOperandIdx8(0);
Node* smi_slot_index = __ SmiTag(slot_index);
Node* value = __ GetAccumulator();
@@ -208,6 +209,19 @@ void Interpreter::DoStaGlobal(compiler::InterpreterAssembler* assembler) {
}
+// StaGlobalStrict <slot_index>
+//
+// Store the global at |slot_index| with the value in the the accumulator in
+// strict mode.
+void Interpreter::DoStaGlobalStrict(compiler::InterpreterAssembler* assembler) {
+ Node* slot_index = __ BytecodeOperandIdx8(0);
+ Node* smi_slot_index = __ SmiTag(slot_index);
+ Node* value = __ GetAccumulator();
+ __ CallRuntime(Runtime::kStoreGlobalViaContext_Strict, smi_slot_index, value);
+ __ Dispatch();
+}
+
+
// LdaContextSlot <context> <slot_index>
//
// Load the object in |slot_index| of |context| into the accumulator.
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698