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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/code-stub-assembler.h" 5 #include "src/code-stub-assembler.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 Variable result(this, MachineRepresentation::kTagged); 323 Variable result(this, MachineRepresentation::kTagged);
324 Label runtime_call(this, Label::kDeferred), no_runtime_call(this); 324 Label runtime_call(this, Label::kDeferred), no_runtime_call(this);
325 Label merge_runtime(this, &result); 325 Label merge_runtime(this, &result);
326 326
327 Node* new_top = IntPtrAdd(top, size_in_bytes); 327 Node* new_top = IntPtrAdd(top, size_in_bytes);
328 Branch(UintPtrGreaterThanOrEqual(new_top, limit), &runtime_call, 328 Branch(UintPtrGreaterThanOrEqual(new_top, limit), &runtime_call,
329 &no_runtime_call); 329 &no_runtime_call);
330 330
331 Bind(&runtime_call); 331 Bind(&runtime_call);
332 // AllocateInTargetSpace does not use the context. 332 // AllocateInTargetSpace does not use the context.
333 Node* context = IntPtrConstant(0); 333 Node* context = SmiConstant(Smi::FromInt(0));
334 Node* runtime_flags = SmiTag(Int32Constant( 334
335 AllocateDoubleAlignFlag::encode(false) | 335 Node* runtime_result;
336 AllocateTargetSpace::encode(flags & kPretenured 336 if (flags & kPretenured) {
337 ? AllocationSpace::OLD_SPACE 337 Node* runtime_flags = SmiConstant(
338 : AllocationSpace::NEW_SPACE))); 338 Smi::FromInt(AllocateDoubleAlignFlag::encode(false) |
339 Node* runtime_result = CallRuntime(Runtime::kAllocateInTargetSpace, context, 339 AllocateTargetSpace::encode(AllocationSpace::OLD_SPACE)));
340 SmiTag(size_in_bytes), runtime_flags); 340 runtime_result = CallRuntime(Runtime::kAllocateInTargetSpace, context,
341 SmiTag(size_in_bytes), runtime_flags);
342 } else {
343 runtime_result = CallRuntime(Runtime::kAllocateInNewSpace, context,
344 SmiTag(size_in_bytes));
345 }
341 result.Bind(runtime_result); 346 result.Bind(runtime_result);
342 Goto(&merge_runtime); 347 Goto(&merge_runtime);
343 348
344 // When there is enough space, return `top' and bump it up. 349 // When there is enough space, return `top' and bump it up.
345 Bind(&no_runtime_call); 350 Bind(&no_runtime_call);
346 Node* no_runtime_result = top; 351 Node* no_runtime_result = top;
347 StoreNoWriteBarrier(MachineType::PointerRepresentation(), top_address, 352 StoreNoWriteBarrier(MachineType::PointerRepresentation(), top_address,
348 new_top); 353 new_top);
349 no_runtime_result = BitcastWordToTagged( 354 no_runtime_result = BitcastWordToTagged(
350 IntPtrAdd(no_runtime_result, IntPtrConstant(kHeapObjectTag))); 355 IntPtrAdd(no_runtime_result, IntPtrConstant(kHeapObjectTag)));
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 1411
1407 Bind(&if_iskeyinrange); 1412 Bind(&if_iskeyinrange);
1408 Node* element = LoadFixedArrayElementInt32Index(elements, index); 1413 Node* element = LoadFixedArrayElementInt32Index(elements, index);
1409 Node* the_hole = LoadRoot(Heap::kTheHoleValueRootIndex); 1414 Node* the_hole = LoadRoot(Heap::kTheHoleValueRootIndex);
1410 Branch(WordEqual(element, the_hole), if_not_found, if_found); 1415 Branch(WordEqual(element, the_hole), if_not_found, if_found);
1411 } 1416 }
1412 } 1417 }
1413 1418
1414 } // namespace internal 1419 } // namespace internal
1415 } // namespace v8 1420 } // namespace v8
OLDNEW
« 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