Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/code-stub-assembler.cc

Issue 1945263002: [stubs] Fix Allocate macro in the CodeStubAssembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698