| 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/compiler/js-generic-lowering.h" | 5 #include "src/compiler/js-generic-lowering.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 void JSGenericLowering::LowerJSCreateKeyValueArray(Node* node) { | 371 void JSGenericLowering::LowerJSCreateKeyValueArray(Node* node) { |
| 372 ReplaceWithRuntimeCall(node, Runtime::kCreateKeyValueArray); | 372 ReplaceWithRuntimeCall(node, Runtime::kCreateKeyValueArray); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { | 375 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
| 376 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); | 376 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
| 377 CallDescriptor::Flags flags = FrameStateFlagForCall(node); | 377 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
| 378 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); | 378 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); |
| 379 node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); | 379 node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); |
| 380 | 380 |
| 381 // Use the FastCloneShallowArrayStub only for shallow boilerplates up to the | 381 // Use the FastCloneShallowArrayStub only for shallow boilerplates without |
| 382 // initial length limit for arrays with "fast" elements kind. | 382 // properties up to the number of elements that the stubs can handle. |
| 383 if ((p.flags() & ArrayLiteral::kShallowElements) != 0 && | 383 if ((p.flags() & ArrayLiteral::kShallowElements) != 0 && |
| 384 p.length() < JSArray::kInitialMaxFastElementArray) { | 384 p.length() < FastCloneShallowArrayStub::kMaximumClonedElements) { |
| 385 Callable callable = CodeFactory::FastCloneShallowArray(isolate()); | 385 Callable callable = CodeFactory::FastCloneShallowArray(isolate()); |
| 386 ReplaceWithStubCall(node, callable, flags); | 386 ReplaceWithStubCall(node, callable, flags); |
| 387 } else { | 387 } else { |
| 388 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); | 388 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); |
| 389 ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral); | 389 ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral); |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 | 392 |
| 393 | 393 |
| 394 void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) { | 394 void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 } | 616 } |
| 617 | 617 |
| 618 | 618 |
| 619 MachineOperatorBuilder* JSGenericLowering::machine() const { | 619 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 620 return jsgraph()->machine(); | 620 return jsgraph()->machine(); |
| 621 } | 621 } |
| 622 | 622 |
| 623 } // namespace compiler | 623 } // namespace compiler |
| 624 } // namespace internal | 624 } // namespace internal |
| 625 } // namespace v8 | 625 } // namespace v8 |
| OLD | NEW |