OLD | NEW |
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/bytecode-branch-analysis.h" | 10 #include "src/compiler/bytecode-branch-analysis.h" |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 } | 779 } |
780 | 780 |
781 void BytecodeGraphBuilder::VisitStaGlobalSloppy() { | 781 void BytecodeGraphBuilder::VisitStaGlobalSloppy() { |
782 BuildStoreGlobal(LanguageMode::SLOPPY); | 782 BuildStoreGlobal(LanguageMode::SLOPPY); |
783 } | 783 } |
784 | 784 |
785 void BytecodeGraphBuilder::VisitStaGlobalStrict() { | 785 void BytecodeGraphBuilder::VisitStaGlobalStrict() { |
786 BuildStoreGlobal(LanguageMode::STRICT); | 786 BuildStoreGlobal(LanguageMode::STRICT); |
787 } | 787 } |
788 | 788 |
| 789 void BytecodeGraphBuilder::VisitStaDataPropertyInLiteral() { |
| 790 Node* object = |
| 791 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 792 Node* name = |
| 793 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(1)); |
| 794 Node* value = |
| 795 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(2)); |
| 796 Node* attrs = |
| 797 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(3)); |
| 798 |
| 799 Node* set_function_name = environment()->LookupAccumulator(); |
| 800 const Operator* op = |
| 801 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); |
| 802 Node* store = NewNode(op, object, name, value, attrs, set_function_name); |
| 803 environment()->RecordAfterState(store, Environment::kAttachFrameState); |
| 804 } |
| 805 |
789 void BytecodeGraphBuilder::VisitLdaContextSlot() { | 806 void BytecodeGraphBuilder::VisitLdaContextSlot() { |
790 // TODO(mythria): immutable flag is also set to false. This information is not | 807 // TODO(mythria): immutable flag is also set to false. This information is not |
791 // available in bytecode array. update this code when the implementation | 808 // available in bytecode array. update this code when the implementation |
792 // changes. | 809 // changes. |
793 const Operator* op = javascript()->LoadContext( | 810 const Operator* op = javascript()->LoadContext( |
794 bytecode_iterator().GetUnsignedImmediateOperand(2), | 811 bytecode_iterator().GetUnsignedImmediateOperand(2), |
795 bytecode_iterator().GetIndexOperand(1), false); | 812 bytecode_iterator().GetIndexOperand(1), false); |
796 Node* context = | 813 Node* context = |
797 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 814 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
798 Node* node = NewNode(op, context); | 815 Node* node = NewNode(op, context); |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2224 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2208 it->Advance(); | 2225 it->Advance(); |
2209 } else { | 2226 } else { |
2210 DCHECK_GT(it->code_offset(), offset); | 2227 DCHECK_GT(it->code_offset(), offset); |
2211 } | 2228 } |
2212 } | 2229 } |
2213 | 2230 |
2214 } // namespace compiler | 2231 } // namespace compiler |
2215 } // namespace internal | 2232 } // namespace internal |
2216 } // namespace v8 | 2233 } // namespace v8 |
OLD | NEW |