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

Side by Side Diff: src/code-stub-assembler.cc

Issue 1924223002: Provide tagged allocation top pointer (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 | src/globals.h » ('j') | 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 SmiTag(size_in_bytes)); 344 SmiTag(size_in_bytes));
345 } 345 }
346 result.Bind(runtime_result); 346 result.Bind(runtime_result);
347 Goto(&merge_runtime); 347 Goto(&merge_runtime);
348 348
349 // When there is enough space, return `top' and bump it up. 349 // When there is enough space, return `top' and bump it up.
350 Bind(&no_runtime_call); 350 Bind(&no_runtime_call);
351 Node* no_runtime_result = top; 351 Node* no_runtime_result = top;
352 StoreNoWriteBarrier(MachineType::PointerRepresentation(), top_address, 352 StoreNoWriteBarrier(MachineType::PointerRepresentation(), top_address,
353 new_top); 353 new_top);
354 no_runtime_result = BitcastWordToTagged(
355 IntPtrAdd(no_runtime_result, IntPtrConstant(kHeapObjectTag)));
356 result.Bind(no_runtime_result); 354 result.Bind(no_runtime_result);
357 Goto(&merge_runtime); 355 Goto(&merge_runtime);
358 356
359 Bind(&merge_runtime); 357 Bind(&merge_runtime);
360 return result.value(); 358 return result.value();
361 } 359 }
362 360
363 Node* CodeStubAssembler::AllocateRawAligned(Node* size_in_bytes, 361 Node* CodeStubAssembler::AllocateRawAligned(Node* size_in_bytes,
364 AllocationFlags flags, 362 AllocationFlags flags,
365 Node* top_address, 363 Node* top_address,
366 Node* limit_address) { 364 Node* limit_address) {
367 Node* top = Load(MachineType::Pointer(), top_address); 365 Node* top = Load(MachineType::Pointer(), top_address);
368 Node* limit = Load(MachineType::Pointer(), limit_address); 366 Node* limit = Load(MachineType::Pointer(), limit_address);
369 Variable adjusted_size(this, MachineType::PointerRepresentation()); 367 Variable adjusted_size(this, MachineType::PointerRepresentation());
370 adjusted_size.Bind(size_in_bytes); 368 adjusted_size.Bind(size_in_bytes);
371 if (flags & kDoubleAlignment) { 369 if (flags & kDoubleAlignment) {
372 // TODO(epertoso): Simd128 alignment. 370 // TODO(epertoso): Simd128 alignment.
373 Label aligned(this), not_aligned(this), merge(this, &adjusted_size); 371 Label aligned(this), not_aligned(this), merge(this, &adjusted_size);
374 Branch(WordAnd(top, IntPtrConstant(kDoubleAlignmentMask)), &not_aligned, 372 Branch(WordAnd(top, IntPtrConstant(kDoubleAlignmentMask - kHeapObjectTag)),
375 &aligned); 373 &not_aligned, &aligned);
376 374
377 Bind(&not_aligned); 375 Bind(&not_aligned);
378 Node* not_aligned_size = 376 Node* not_aligned_size =
379 IntPtrAdd(size_in_bytes, IntPtrConstant(kPointerSize)); 377 IntPtrAdd(size_in_bytes, IntPtrConstant(kPointerSize));
380 adjusted_size.Bind(not_aligned_size); 378 adjusted_size.Bind(not_aligned_size);
381 Goto(&merge); 379 Goto(&merge);
382 380
383 Bind(&aligned); 381 Bind(&aligned);
384 Goto(&merge); 382 Goto(&merge);
385 383
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 CallRuntime(Runtime::kOrdinaryHasInstance, context, callable, object)); 1545 CallRuntime(Runtime::kOrdinaryHasInstance, context, callable, object));
1548 } 1546 }
1549 Goto(&return_result); 1547 Goto(&return_result);
1550 1548
1551 Bind(&return_result); 1549 Bind(&return_result);
1552 return var_result.value(); 1550 return var_result.value();
1553 } 1551 }
1554 1552
1555 } // namespace internal 1553 } // namespace internal
1556 } // namespace v8 1554 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698