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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2586463002: Add CreateDataPropertyInLiteralFlags. (Closed)
Patch Set: Address review comments. Created 4 years 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/interpreter/bytecodes.h ('k') | src/runtime/runtime.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 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/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 810
811 // StaKeyedPropertyStrict <object> <key> <slot> 811 // StaKeyedPropertyStrict <object> <key> <slot>
812 // 812 //
813 // Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object> 813 // Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object>
814 // and the key <key> with the value in the accumulator. 814 // and the key <key> with the value in the accumulator.
815 void Interpreter::DoStaKeyedPropertyStrict(InterpreterAssembler* assembler) { 815 void Interpreter::DoStaKeyedPropertyStrict(InterpreterAssembler* assembler) {
816 Callable ic = CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT); 816 Callable ic = CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT);
817 DoKeyedStoreIC(ic, assembler); 817 DoKeyedStoreIC(ic, assembler);
818 } 818 }
819 819
820 // StaDataPropertyInLiteral <object> <name> <value> <attrs> 820 // StaDataPropertyInLiteral <object> <name> <value> <flags>
821 // 821 //
822 // Define a property <name> with value <value> in <object>. Use property 822 // Define a property <name> with value <value> in <object>. Property attributes
823 // attributes <attrs> in the definition and set the name property of <value> 823 // and whether set_function_name are stored in DataPropertyInLiteralFlags
824 // according to the flag in the accumulator. 824 // <flags>.
825 // 825 //
826 // This definition is not observable and is used only for definitions 826 // This definition is not observable and is used only for definitions
827 // in object or class literals. 827 // in object or class literals.
828 void Interpreter::DoStaDataPropertyInLiteral(InterpreterAssembler* assembler) { 828 void Interpreter::DoStaDataPropertyInLiteral(InterpreterAssembler* assembler) {
829 Node* object_reg_index = __ BytecodeOperandReg(0); 829 Node* object_reg_index = __ BytecodeOperandReg(0);
830 Node* object = __ LoadRegister(object_reg_index); 830 Node* object = __ LoadRegister(object_reg_index);
831 Node* name_reg_index = __ BytecodeOperandReg(1); 831 Node* name_reg_index = __ BytecodeOperandReg(1);
832 Node* name = __ LoadRegister(name_reg_index); 832 Node* name = __ LoadRegister(name_reg_index);
833 Node* value_reg_index = __ BytecodeOperandReg(2); 833 Node* value_reg_index = __ BytecodeOperandReg(2);
834 Node* value = __ LoadRegister(value_reg_index); 834 Node* value = __ LoadRegister(value_reg_index);
835 Node* attrs_reg_index = __ BytecodeOperandReg(3); 835 Node* flags = __ SmiFromWord32(__ BytecodeOperandFlag(3));
836 Node* attrs = __ LoadRegister(attrs_reg_index);
837
838 Node* set_function_name = __ GetAccumulator();
839 836
840 Node* context = __ GetContext(); 837 Node* context = __ GetContext();
841 838
842 __ CallRuntime(Runtime::kDefineDataPropertyInLiteral, context, object, name, 839 __ CallRuntime(Runtime::kDefineDataPropertyInLiteral, context, object, name,
843 value, attrs, set_function_name); 840 value, flags);
844 __ Dispatch(); 841 __ Dispatch();
845 } 842 }
846 843
847 // LdaModuleVariable <cell_index> <depth> 844 // LdaModuleVariable <cell_index> <depth>
848 // 845 //
849 // Load the contents of a module variable into the accumulator. The variable is 846 // Load the contents of a module variable into the accumulator. The variable is
850 // identified by <cell_index>. <depth> is the depth of the current context 847 // identified by <cell_index>. <depth> is the depth of the current context
851 // relative to the module context. 848 // relative to the module context.
852 void Interpreter::DoLdaModuleVariable(InterpreterAssembler* assembler) { 849 void Interpreter::DoLdaModuleVariable(InterpreterAssembler* assembler) {
853 Node* cell_index = __ BytecodeOperandImmIntPtr(0); 850 Node* cell_index = __ BytecodeOperandImmIntPtr(0);
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after
2895 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2892 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2896 __ SmiTag(new_state)); 2893 __ SmiTag(new_state));
2897 __ SetAccumulator(old_state); 2894 __ SetAccumulator(old_state);
2898 2895
2899 __ Dispatch(); 2896 __ Dispatch();
2900 } 2897 }
2901 2898
2902 } // namespace interpreter 2899 } // namespace interpreter
2903 } // namespace internal 2900 } // namespace internal
2904 } // namespace v8 2901 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698