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/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 bytecode_iterator().GetConstantForIndexOperand(0)); | 943 bytecode_iterator().GetConstantForIndexOperand(0)); |
944 int literal_index = bytecode_iterator().GetIndexOperand(1); | 944 int literal_index = bytecode_iterator().GetIndexOperand(1); |
945 int literal_flags = bytecode_iterator().GetFlagOperand(2); | 945 int literal_flags = bytecode_iterator().GetFlagOperand(2); |
946 int number_of_elements = constant_elements->length(); | 946 int number_of_elements = constant_elements->length(); |
947 const Operator* op = javascript()->CreateLiteralArray( | 947 const Operator* op = javascript()->CreateLiteralArray( |
948 constant_elements, literal_flags, literal_index, number_of_elements); | 948 constant_elements, literal_flags, literal_index, number_of_elements); |
949 BuildCreateLiteral(op); | 949 BuildCreateLiteral(op); |
950 } | 950 } |
951 | 951 |
952 void BytecodeGraphBuilder::VisitCreateObjectLiteral() { | 952 void BytecodeGraphBuilder::VisitCreateObjectLiteral() { |
| 953 FrameStateBeforeAndAfter states(this); |
953 Handle<FixedArray> constant_properties = Handle<FixedArray>::cast( | 954 Handle<FixedArray> constant_properties = Handle<FixedArray>::cast( |
954 bytecode_iterator().GetConstantForIndexOperand(0)); | 955 bytecode_iterator().GetConstantForIndexOperand(0)); |
955 int literal_index = bytecode_iterator().GetIndexOperand(1); | 956 int literal_index = bytecode_iterator().GetIndexOperand(1); |
956 int bytecode_flags = bytecode_iterator().GetFlagOperand(2); | 957 int bytecode_flags = bytecode_iterator().GetFlagOperand(2); |
957 int literal_flags = | 958 int literal_flags = |
958 interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags); | 959 interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags); |
959 // TODO(mstarzinger): Thread through number of properties. | 960 // TODO(mstarzinger): Thread through number of properties. |
960 int number_of_properties = constant_properties->length() / 2; | 961 int number_of_properties = constant_properties->length() / 2; |
961 const Operator* op = javascript()->CreateLiteralObject( | 962 Node* literal = NewNode( |
962 constant_properties, literal_flags, literal_index, number_of_properties); | 963 javascript()->CreateLiteralObject(constant_properties, literal_flags, |
963 BuildCreateLiteral(op); | 964 literal_index, number_of_properties), |
| 965 GetFunctionClosure()); |
| 966 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), |
| 967 literal, &states); |
964 } | 968 } |
965 | 969 |
966 Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, | 970 Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, |
967 Node* callee, | 971 Node* callee, |
968 interpreter::Register receiver, | 972 interpreter::Register receiver, |
969 size_t arity) { | 973 size_t arity) { |
970 Node** all = local_zone()->NewArray<Node*>(static_cast<int>(arity)); | 974 Node** all = local_zone()->NewArray<Node*>(static_cast<int>(arity)); |
971 all[0] = callee; | 975 all[0] = callee; |
972 all[1] = environment()->LookupRegister(receiver); | 976 all[1] = environment()->LookupRegister(receiver); |
973 int receiver_index = receiver.index(); | 977 int receiver_index = receiver.index(); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 // Phi does not exist yet, introduce one. | 1827 // Phi does not exist yet, introduce one. |
1824 value = NewPhi(inputs, value, control); | 1828 value = NewPhi(inputs, value, control); |
1825 value->ReplaceInput(inputs - 1, other); | 1829 value->ReplaceInput(inputs - 1, other); |
1826 } | 1830 } |
1827 return value; | 1831 return value; |
1828 } | 1832 } |
1829 | 1833 |
1830 } // namespace compiler | 1834 } // namespace compiler |
1831 } // namespace internal | 1835 } // namespace internal |
1832 } // namespace v8 | 1836 } // namespace v8 |
OLD | NEW |