Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index 2e1e8c1a9b2735ad554f52995d600b1542f47dfc..e5041756644d52698ce5b3702f1150397afcb544 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -330,14 +330,19 @@ Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes, |
Bind(&runtime_call); |
// AllocateInTargetSpace does not use the context. |
- Node* context = IntPtrConstant(0); |
- Node* runtime_flags = SmiTag(Int32Constant( |
- AllocateDoubleAlignFlag::encode(false) | |
- AllocateTargetSpace::encode(flags & kPretenured |
- ? AllocationSpace::OLD_SPACE |
- : AllocationSpace::NEW_SPACE))); |
- Node* runtime_result = CallRuntime(Runtime::kAllocateInTargetSpace, context, |
- SmiTag(size_in_bytes), runtime_flags); |
+ Node* context = SmiConstant(Smi::FromInt(0)); |
+ |
+ Node* runtime_result; |
+ if (flags & kPretenured) { |
+ Node* runtime_flags = SmiConstant( |
+ Smi::FromInt(AllocateDoubleAlignFlag::encode(false) | |
+ AllocateTargetSpace::encode(AllocationSpace::OLD_SPACE))); |
+ runtime_result = CallRuntime(Runtime::kAllocateInTargetSpace, context, |
+ SmiTag(size_in_bytes), runtime_flags); |
+ } else { |
+ runtime_result = CallRuntime(Runtime::kAllocateInNewSpace, context, |
+ SmiTag(size_in_bytes)); |
+ } |
result.Bind(runtime_result); |
Goto(&merge_runtime); |