OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/js-typed-lowering.h" | 8 #include "src/compiler/js-typed-lowering.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 | 947 |
948 | 948 |
949 Reduction JSTypedLowering::ReduceJSCreateLiteralArray(Node* node) { | 949 Reduction JSTypedLowering::ReduceJSCreateLiteralArray(Node* node) { |
950 DCHECK_EQ(IrOpcode::kJSCreateLiteralArray, node->opcode()); | 950 DCHECK_EQ(IrOpcode::kJSCreateLiteralArray, node->opcode()); |
951 HeapObjectMatcher<FixedArray> mconst(NodeProperties::GetValueInput(node, 2)); | 951 HeapObjectMatcher<FixedArray> mconst(NodeProperties::GetValueInput(node, 2)); |
952 int length = mconst.Value().handle()->length(); | 952 int length = mconst.Value().handle()->length(); |
953 int flags = OpParameter<int>(node->op()); | 953 int flags = OpParameter<int>(node->op()); |
954 | 954 |
955 // Use the FastCloneShallowArrayStub only for shallow boilerplates up to the | 955 // Use the FastCloneShallowArrayStub only for shallow boilerplates up to the |
956 // initial length limit for arrays with "fast" elements kind. | 956 // initial length limit for arrays with "fast" elements kind. |
| 957 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. |
957 if ((flags & ArrayLiteral::kShallowElements) != 0 && | 958 if ((flags & ArrayLiteral::kShallowElements) != 0 && |
| 959 (flags & ArrayLiteral::kIsStrong) == 0 && |
958 length < JSObject::kInitialMaxFastElementArray) { | 960 length < JSObject::kInitialMaxFastElementArray) { |
959 Isolate* isolate = jsgraph()->isolate(); | 961 Isolate* isolate = jsgraph()->isolate(); |
960 Callable callable = CodeFactory::FastCloneShallowArray(isolate); | 962 Callable callable = CodeFactory::FastCloneShallowArray(isolate); |
961 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 963 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
962 isolate, graph()->zone(), callable.descriptor(), 0, | 964 isolate, graph()->zone(), callable.descriptor(), 0, |
963 (OperatorProperties::GetFrameStateInputCount(node->op()) != 0) | 965 (OperatorProperties::GetFrameStateInputCount(node->op()) != 0) |
964 ? CallDescriptor::kNeedsFrameState | 966 ? CallDescriptor::kNeedsFrameState |
965 : CallDescriptor::kNoFlags); | 967 : CallDescriptor::kNoFlags); |
966 const Operator* new_op = common()->Call(desc); | 968 const Operator* new_op = common()->Call(desc); |
967 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 969 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 } | 1205 } |
1204 | 1206 |
1205 | 1207 |
1206 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1208 MachineOperatorBuilder* JSTypedLowering::machine() const { |
1207 return jsgraph()->machine(); | 1209 return jsgraph()->machine(); |
1208 } | 1210 } |
1209 | 1211 |
1210 } // namespace compiler | 1212 } // namespace compiler |
1211 } // namespace internal | 1213 } // namespace internal |
1212 } // namespace v8 | 1214 } // namespace v8 |
OLD | NEW |