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())); |
350 ReplaceWithStubCall(node, callable, flags); | 353 ReplaceWithStubCall(node, callable, flags); |
351 } else { | 354 } else { |
| 355 node->InsertInput(zone(), 1, |
| 356 jsgraph()->HeapConstant(p.feedback().vector())); |
| 357 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
352 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) | 358 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) |
353 ? Runtime::kNewClosure_Tenured | 359 ? Runtime::kNewClosure_Tenured |
354 : Runtime::kNewClosure); | 360 : Runtime::kNewClosure); |
355 } | 361 } |
356 } | 362 } |
357 | 363 |
358 | 364 |
359 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { | 365 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
360 const CreateFunctionContextParameters& parameters = | 366 const CreateFunctionContextParameters& parameters = |
361 CreateFunctionContextParametersOf(node->op()); | 367 CreateFunctionContextParametersOf(node->op()); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 } | 633 } |
628 | 634 |
629 | 635 |
630 MachineOperatorBuilder* JSGenericLowering::machine() const { | 636 MachineOperatorBuilder* JSGenericLowering::machine() const { |
631 return jsgraph()->machine(); | 637 return jsgraph()->machine(); |
632 } | 638 } |
633 | 639 |
634 } // namespace compiler | 640 } // namespace compiler |
635 } // namespace internal | 641 } // namespace internal |
636 } // namespace v8 | 642 } // namespace v8 |
OLD | NEW |