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/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 void JSGenericLowering::LowerJSCreateClosure(Node* node) { | 497 void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
498 CreateClosureParameters p = CreateClosureParametersOf(node->op()); | 498 CreateClosureParameters p = CreateClosureParametersOf(node->op()); |
499 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.shared_info())); | 499 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.shared_info())); |
500 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) | 500 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) |
501 ? Runtime::kNewClosure_Tenured | 501 ? Runtime::kNewClosure_Tenured |
502 : Runtime::kNewClosure); | 502 : Runtime::kNewClosure); |
503 } | 503 } |
504 | 504 |
505 | 505 |
506 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { | 506 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
507 int literal_flags = OpParameter<int>(node->op()); | 507 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
508 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(literal_flags)); | 508 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); |
| 509 node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constants())); |
| 510 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); |
509 ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral); | 511 ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral); |
510 } | 512 } |
511 | 513 |
512 | 514 |
513 void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) { | 515 void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) { |
514 int literal_flags = OpParameter<int>(node->op()); | 516 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
515 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(literal_flags)); | 517 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); |
| 518 node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constants())); |
| 519 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); |
516 ReplaceWithRuntimeCall(node, Runtime::kCreateObjectLiteral); | 520 ReplaceWithRuntimeCall(node, Runtime::kCreateObjectLiteral); |
517 } | 521 } |
518 | 522 |
519 | 523 |
520 void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { | 524 void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { |
521 Handle<String> name = OpParameter<Handle<String>>(node); | 525 Handle<String> name = OpParameter<Handle<String>>(node); |
522 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(name)); | 526 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(name)); |
523 ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); | 527 ReplaceWithRuntimeCall(node, Runtime::kPushCatchContext); |
524 } | 528 } |
525 | 529 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 } | 875 } |
872 | 876 |
873 | 877 |
874 MachineOperatorBuilder* JSGenericLowering::machine() const { | 878 MachineOperatorBuilder* JSGenericLowering::machine() const { |
875 return jsgraph()->machine(); | 879 return jsgraph()->machine(); |
876 } | 880 } |
877 | 881 |
878 } // namespace compiler | 882 } // namespace compiler |
879 } // namespace internal | 883 } // namespace internal |
880 } // namespace v8 | 884 } // namespace v8 |
OLD | NEW |