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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 ReplaceWithRuntimeCall(node, Runtime::kNewArray, arity + 3); | 337 ReplaceWithRuntimeCall(node, Runtime::kNewArray, arity + 3); |
338 } | 338 } |
339 | 339 |
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 FastNewClosurebuiltin only for functions allocated in new |
| 348 // space. |
348 if (p.pretenure() == NOT_TENURED) { | 349 if (p.pretenure() == NOT_TENURED) { |
349 Callable callable = CodeFactory::FastNewClosure(isolate()); | 350 Callable callable = CodeFactory::FastNewClosure(isolate()); |
350 ReplaceWithStubCall(node, callable, flags); | 351 ReplaceWithStubCall(node, callable, flags); |
351 } else { | 352 } else { |
352 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) | 353 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) |
353 ? Runtime::kNewClosure_Tenured | 354 ? Runtime::kNewClosure_Tenured |
354 : Runtime::kNewClosure); | 355 : Runtime::kNewClosure); |
355 } | 356 } |
356 } | 357 } |
357 | 358 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 } | 628 } |
628 | 629 |
629 | 630 |
630 MachineOperatorBuilder* JSGenericLowering::machine() const { | 631 MachineOperatorBuilder* JSGenericLowering::machine() const { |
631 return jsgraph()->machine(); | 632 return jsgraph()->machine(); |
632 } | 633 } |
633 | 634 |
634 } // namespace compiler | 635 } // namespace compiler |
635 } // namespace internal | 636 } // namespace internal |
636 } // namespace v8 | 637 } // namespace v8 |
OLD | NEW |