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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 | 951 |
952 | 952 |
953 Reduction JSTypedLowering::ReduceJSCreateLiteralArray(Node* node) { | 953 Reduction JSTypedLowering::ReduceJSCreateLiteralArray(Node* node) { |
954 DCHECK_EQ(IrOpcode::kJSCreateLiteralArray, node->opcode()); | 954 DCHECK_EQ(IrOpcode::kJSCreateLiteralArray, node->opcode()); |
955 HeapObjectMatcher<FixedArray> mconst(NodeProperties::GetValueInput(node, 2)); | 955 HeapObjectMatcher<FixedArray> mconst(NodeProperties::GetValueInput(node, 2)); |
956 int length = mconst.Value().handle()->length(); | 956 int length = mconst.Value().handle()->length(); |
957 int flags = OpParameter<int>(node->op()); | 957 int flags = OpParameter<int>(node->op()); |
958 | 958 |
959 // Use the FastCloneShallowArrayStub only for shallow boilerplates up to the | 959 // Use the FastCloneShallowArrayStub only for shallow boilerplates up to the |
960 // initial length limit for arrays with "fast" elements kind. | 960 // initial length limit for arrays with "fast" elements kind. |
| 961 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. |
961 if ((flags & ArrayLiteral::kShallowElements) != 0 && | 962 if ((flags & ArrayLiteral::kShallowElements) != 0 && |
| 963 (flags & ArrayLiteral::kIsStrong) == 0 && |
962 length < JSObject::kInitialMaxFastElementArray) { | 964 length < JSObject::kInitialMaxFastElementArray) { |
963 Isolate* isolate = jsgraph()->isolate(); | 965 Isolate* isolate = jsgraph()->isolate(); |
964 Callable callable = CodeFactory::FastCloneShallowArray(isolate); | 966 Callable callable = CodeFactory::FastCloneShallowArray(isolate); |
965 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 967 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
966 isolate, graph()->zone(), callable.descriptor(), 0, | 968 isolate, graph()->zone(), callable.descriptor(), 0, |
967 (OperatorProperties::GetFrameStateInputCount(node->op()) != 0) | 969 (OperatorProperties::GetFrameStateInputCount(node->op()) != 0) |
968 ? CallDescriptor::kNeedsFrameState | 970 ? CallDescriptor::kNeedsFrameState |
969 : CallDescriptor::kNoFlags); | 971 : CallDescriptor::kNoFlags); |
970 const Operator* new_op = common()->Call(desc); | 972 const Operator* new_op = common()->Call(desc); |
971 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 973 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 } | 1209 } |
1208 | 1210 |
1209 | 1211 |
1210 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1212 MachineOperatorBuilder* JSTypedLowering::machine() const { |
1211 return jsgraph()->machine(); | 1213 return jsgraph()->machine(); |
1212 } | 1214 } |
1213 | 1215 |
1214 } // namespace compiler | 1216 } // namespace compiler |
1215 } // namespace internal | 1217 } // namespace internal |
1216 } // namespace v8 | 1218 } // namespace v8 |
OLD | NEW |