| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 void JSGenericLowering::LowerJSCreateClosure(Node* node) { | 341 void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
| 342 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); | 342 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); |
| 343 CallDescriptor::Flags flags = FrameStateFlagForCall(node); | 343 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
| 344 Handle<SharedFunctionInfo> const shared_info = p.shared_info(); | 344 Handle<SharedFunctionInfo> const shared_info = p.shared_info(); |
| 345 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info)); | 345 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info)); |
| 346 | 346 |
| 347 // Use the FastNewClosureStub only for functions allocated in new space. | 347 // Use the FastNewClosureStub only for functions allocated in new space. |
| 348 if (p.pretenure() == NOT_TENURED) { | 348 if (p.pretenure() == NOT_TENURED) { |
| 349 Callable callable = CodeFactory::FastNewClosure(isolate()); | 349 Callable callable = CodeFactory::FastNewClosure(isolate()); |
| 350 node->InsertInput(zone(), 1, | |
| 351 jsgraph()->HeapConstant(p.feedback().vector())); | |
| 352 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | |
| 353 ReplaceWithStubCall(node, callable, flags); | 350 ReplaceWithStubCall(node, callable, flags); |
| 354 } else { | 351 } else { |
| 355 node->InsertInput(zone(), 1, | |
| 356 jsgraph()->HeapConstant(p.feedback().vector())); | |
| 357 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | |
| 358 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) | 352 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) |
| 359 ? Runtime::kNewClosure_Tenured | 353 ? Runtime::kNewClosure_Tenured |
| 360 : Runtime::kNewClosure); | 354 : Runtime::kNewClosure); |
| 361 } | 355 } |
| 362 } | 356 } |
| 363 | 357 |
| 364 | 358 |
| 365 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { | 359 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
| 366 const CreateFunctionContextParameters& parameters = | 360 const CreateFunctionContextParameters& parameters = |
| 367 CreateFunctionContextParametersOf(node->op()); | 361 CreateFunctionContextParametersOf(node->op()); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 } | 627 } |
| 634 | 628 |
| 635 | 629 |
| 636 MachineOperatorBuilder* JSGenericLowering::machine() const { | 630 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 637 return jsgraph()->machine(); | 631 return jsgraph()->machine(); |
| 638 } | 632 } |
| 639 | 633 |
| 640 } // namespace compiler | 634 } // namespace compiler |
| 641 } // namespace internal | 635 } // namespace internal |
| 642 } // namespace v8 | 636 } // namespace v8 |
| OLD | NEW |