Index: src/compiler/change-lowering.cc |
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc |
index 6d273a2a162357743edfa0416b41e7bd3fb4f1d4..ecf62159703f1aee28e23a7918db5672948e1db2 100644 |
--- a/src/compiler/change-lowering.cc |
+++ b/src/compiler/change-lowering.cc |
@@ -561,32 +561,15 @@ Reduction ChangeLowering::StoreElement(Node* node) { |
Reduction ChangeLowering::Allocate(Node* node) { |
PretenureFlag pretenure = OpParameter<PretenureFlag>(node->op()); |
- if (pretenure == NOT_TENURED) { |
- Callable callable = CodeFactory::AllocateInNewSpace(isolate()); |
- Node* target = jsgraph()->HeapConstant(callable.code()); |
- CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
- isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
- CallDescriptor::kNoFlags, Operator::kNoThrow); |
- const Operator* op = common()->Call(descriptor); |
- node->InsertInput(graph()->zone(), 0, target); |
- node->InsertInput(graph()->zone(), 2, jsgraph()->NoContextConstant()); |
- NodeProperties::ChangeOp(node, op); |
- } else { |
- DCHECK_EQ(TENURED, pretenure); |
- AllocationSpace space = OLD_SPACE; |
- Runtime::FunctionId f = Runtime::kAllocateInTargetSpace; |
- Operator::Properties props = node->op()->properties(); |
- CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
- jsgraph()->zone(), f, 2, props, CallDescriptor::kNeedsFrameState); |
- ExternalReference ref(f, jsgraph()->isolate()); |
- int32_t flags = AllocateTargetSpace::encode(space); |
- node->InsertInput(graph()->zone(), 0, jsgraph()->CEntryStubConstant(1)); |
- node->InsertInput(graph()->zone(), 2, jsgraph()->SmiConstant(flags)); |
- node->InsertInput(graph()->zone(), 3, jsgraph()->ExternalConstant(ref)); |
- node->InsertInput(graph()->zone(), 4, jsgraph()->Int32Constant(2)); |
- node->InsertInput(graph()->zone(), 5, jsgraph()->NoContextConstant()); |
- NodeProperties::ChangeOp(node, common()->Call(desc)); |
- } |
+ Callable callable = CodeFactory::Allocate(isolate(), pretenure); |
+ Node* target = jsgraph()->HeapConstant(callable.code()); |
+ CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
+ isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
+ CallDescriptor::kNoFlags, Operator::kNoThrow); |
+ const Operator* op = common()->Call(descriptor); |
+ node->InsertInput(graph()->zone(), 0, target); |
+ node->InsertInput(graph()->zone(), 2, jsgraph()->NoContextConstant()); |
+ NodeProperties::ChangeOp(node, op); |
return Changed(node); |
} |