Chromium Code Reviews| 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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 953 Handle<FixedArray> constant_properties = Handle<FixedArray>::cast( | 953 Handle<FixedArray> constant_properties = Handle<FixedArray>::cast( |
| 954 bytecode_iterator().GetConstantForIndexOperand(0)); | 954 bytecode_iterator().GetConstantForIndexOperand(0)); |
| 955 int literal_index = bytecode_iterator().GetIndexOperand(1); | 955 int literal_index = bytecode_iterator().GetIndexOperand(1); |
| 956 int bytecode_flags = bytecode_iterator().GetFlagOperand(2); | 956 int bytecode_flags = bytecode_iterator().GetFlagOperand(2); |
| 957 int literal_flags = | 957 int literal_flags = |
| 958 interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags); | 958 interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags); |
| 959 // TODO(mstarzinger): Thread through number of properties. | 959 // TODO(mstarzinger): Thread through number of properties. |
| 960 int number_of_properties = constant_properties->length() / 2; | 960 int number_of_properties = constant_properties->length() / 2; |
| 961 const Operator* op = javascript()->CreateLiteralObject( | 961 const Operator* op = javascript()->CreateLiteralObject( |
| 962 constant_properties, literal_flags, literal_index, number_of_properties); | 962 constant_properties, literal_flags, literal_index, number_of_properties); |
| 963 BuildCreateLiteral(op); | 963 FrameStateBeforeAndAfter states(this); |
|
rmcilroy
2016/08/08 11:40:45
nit - move this to the top of the function (just e
klaasb
2016/08/09 08:49:07
Done.
| |
| 964 Node* literal = NewNode(op, GetFunctionClosure()); | |
|
rmcilroy
2016/08/08 11:40:45
just inline javascript()->CreateLiteralObject here
klaasb
2016/08/09 08:49:07
Done.
| |
| 965 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), | |
| 966 literal, &states); | |
| 964 } | 967 } |
| 965 | 968 |
| 966 Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, | 969 Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, |
| 967 Node* callee, | 970 Node* callee, |
| 968 interpreter::Register receiver, | 971 interpreter::Register receiver, |
| 969 size_t arity) { | 972 size_t arity) { |
| 970 Node** all = local_zone()->NewArray<Node*>(static_cast<int>(arity)); | 973 Node** all = local_zone()->NewArray<Node*>(static_cast<int>(arity)); |
| 971 all[0] = callee; | 974 all[0] = callee; |
| 972 all[1] = environment()->LookupRegister(receiver); | 975 all[1] = environment()->LookupRegister(receiver); |
| 973 int receiver_index = receiver.index(); | 976 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. | 1826 // Phi does not exist yet, introduce one. |
| 1824 value = NewPhi(inputs, value, control); | 1827 value = NewPhi(inputs, value, control); |
| 1825 value->ReplaceInput(inputs - 1, other); | 1828 value->ReplaceInput(inputs - 1, other); |
| 1826 } | 1829 } |
| 1827 return value; | 1830 return value; |
| 1828 } | 1831 } |
| 1829 | 1832 |
| 1830 } // namespace compiler | 1833 } // namespace compiler |
| 1831 } // namespace internal | 1834 } // namespace internal |
| 1832 } // namespace v8 | 1835 } // namespace v8 |
| OLD | NEW |