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

Unified Diff: src/interpreter/interpreter.cc

Issue 2510743002: [interpreter] Bytecode for StaDataPropertyInLiteral. (Closed)
Patch Set: Add comment and move interpreter function. Created 4 years, 1 month 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/bytecode_expectations/ClassDeclarations.golden » ('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 9128ee984039c764d20e4c34ae3a762f0c143829..fc09372b654681f0358ecadf72a8b123e4cb3361 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -841,6 +841,33 @@ void Interpreter::DoStaKeyedPropertyStrict(InterpreterAssembler* assembler) {
DoKeyedStoreIC(ic, assembler);
}
+// StaDataPropertyInLiteral <object> <name> <value> <attrs>
+//
+// Define a property <name> with value <value> in <object>. Use property
+// attributes <attrs> in the definition and set the name property of <value>
+// according to the flag in the accumulator.
+//
+// This definition is not observable and is used only for definitions
+// in object or class literals.
+void Interpreter::DoStaDataPropertyInLiteral(InterpreterAssembler* assembler) {
+ Node* object_reg_index = __ BytecodeOperandReg(0);
+ Node* object = __ LoadRegister(object_reg_index);
+ Node* name_reg_index = __ BytecodeOperandReg(1);
+ Node* name = __ LoadRegister(name_reg_index);
+ Node* value_reg_index = __ BytecodeOperandReg(2);
+ Node* value = __ LoadRegister(value_reg_index);
+ Node* attrs_reg_index = __ BytecodeOperandReg(3);
+ Node* attrs = __ LoadRegister(attrs_reg_index);
+
+ Node* set_function_name = __ GetAccumulator();
+
+ Node* context = __ GetContext();
+
+ __ CallRuntime(Runtime::kDefineDataPropertyInLiteral, context, object, name,
+ value, attrs, set_function_name);
+ __ Dispatch();
+}
+
// LdaModuleVariable <cell_index> <depth>
//
// Load the contents of a module variable into the accumulator. The variable is
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698