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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 2028633002: Provide a tagged allocation top pointer. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP: adding a few tests. Created 4 years, 6 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 | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index 45e1197f4ab2dd7491848740736a76ad06b71582..301d41f08d418b134abed715bd63bd884e589c1d 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -1504,7 +1504,7 @@ void MacroAssembler::UpdateAllocationTopHelper(Register result_end,
AllocationFlags flags) {
if (emit_debug_code()) {
test(result_end, Immediate(kObjectAlignmentMask));
- Check(zero, kUnalignedAllocationInNewSpace);
+ Check(not_zero, kUnalignedAllocationInNewSpace);
}
ExternalReference allocation_top =
@@ -1555,13 +1555,13 @@ void MacroAssembler::Allocate(int object_size,
if ((flags & DOUBLE_ALIGNMENT) != 0) {
DCHECK(kPointerAlignment * 2 == kDoubleAlignment);
Label aligned;
- test(result, Immediate(kDoubleAlignmentMask));
+ test(result, Immediate(kDoubleAlignmentMaskTagged));
j(zero, &aligned, Label::kNear);
if ((flags & PRETENURE) != 0) {
cmp(result, Operand::StaticVariable(allocation_limit));
j(above_equal, gc_required);
}
- mov(Operand(result, 0),
+ mov(Operand(result, -kHeapObjectTag),
Immediate(isolate()->factory()->one_pointer_filler_map()));
add(result, Immediate(kDoubleSize / 2));
bind(&aligned);
@@ -1583,11 +1583,7 @@ void MacroAssembler::Allocate(int object_size,
}
if (top_reg.is(result)) {
- sub(result, Immediate(object_size - kHeapObjectTag));
- } else {
- // Tag the result.
- DCHECK(kHeapObjectTag == 1);
- inc(result);
+ sub(result, Immediate(object_size));
}
}
@@ -1630,13 +1626,13 @@ void MacroAssembler::Allocate(int header_size,
if ((flags & DOUBLE_ALIGNMENT) != 0) {
DCHECK(kPointerAlignment * 2 == kDoubleAlignment);
Label aligned;
- test(result, Immediate(kDoubleAlignmentMask));
+ test(result, Immediate(kDoubleAlignmentMaskTagged));
j(zero, &aligned, Label::kNear);
if ((flags & PRETENURE) != 0) {
cmp(result, Operand::StaticVariable(allocation_limit));
j(above_equal, gc_required);
}
- mov(Operand(result, 0),
+ mov(Operand(result, -kHeapObjectTag),
Immediate(isolate()->factory()->one_pointer_filler_map()));
add(result, Immediate(kDoubleSize / 2));
bind(&aligned);
@@ -1661,10 +1657,6 @@ void MacroAssembler::Allocate(int header_size,
cmp(result_end, Operand::StaticVariable(allocation_limit));
j(above, gc_required);
- // Tag result.
- DCHECK(kHeapObjectTag == 1);
- inc(result);
-
UpdateAllocationTopHelper(result_end, scratch, flags);
}
@@ -1703,13 +1695,13 @@ void MacroAssembler::Allocate(Register object_size,
if ((flags & DOUBLE_ALIGNMENT) != 0) {
DCHECK(kPointerAlignment * 2 == kDoubleAlignment);
Label aligned;
- test(result, Immediate(kDoubleAlignmentMask));
+ test(result, Immediate(kDoubleAlignmentMaskTagged));
j(zero, &aligned, Label::kNear);
if ((flags & PRETENURE) != 0) {
cmp(result, Operand::StaticVariable(allocation_limit));
j(above_equal, gc_required);
}
- mov(Operand(result, 0),
+ mov(Operand(result, -kHeapObjectTag),
Immediate(isolate()->factory()->one_pointer_filler_map()));
add(result, Immediate(kDoubleSize / 2));
bind(&aligned);
@@ -1723,10 +1715,6 @@ void MacroAssembler::Allocate(Register object_size,
cmp(result_end, Operand::StaticVariable(allocation_limit));
j(above, gc_required);
- // Tag result.
- DCHECK(kHeapObjectTag == 1);
- inc(result);
-
if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) {
// The top pointer is not updated for allocation folding dominators.
UpdateAllocationTopHelper(result_end, scratch, flags);
@@ -1742,9 +1730,9 @@ void MacroAssembler::FastAllocate(int object_size, Register result,
if ((flags & DOUBLE_ALIGNMENT) != 0) {
DCHECK(kPointerAlignment * 2 == kDoubleAlignment);
Label aligned;
- test(result, Immediate(kDoubleAlignmentMask));
+ test(result, Immediate(kDoubleAlignmentMaskTagged));
j(zero, &aligned, Label::kNear);
- mov(Operand(result, 0),
+ mov(Operand(result, -kHeapObjectTag),
Immediate(isolate()->factory()->one_pointer_filler_map()));
add(result, Immediate(kDoubleSize / 2));
bind(&aligned);
@@ -1752,9 +1740,6 @@ void MacroAssembler::FastAllocate(int object_size, Register result,
lea(result_end, Operand(result, object_size));
UpdateAllocationTopHelper(result_end, no_reg, flags);
-
- DCHECK(kHeapObjectTag == 1);
- inc(result);
}
void MacroAssembler::FastAllocate(Register object_size, Register result,
@@ -1766,9 +1751,9 @@ void MacroAssembler::FastAllocate(Register object_size, Register result,
if ((flags & DOUBLE_ALIGNMENT) != 0) {
DCHECK(kPointerAlignment * 2 == kDoubleAlignment);
Label aligned;
- test(result, Immediate(kDoubleAlignmentMask));
+ test(result, Immediate(kDoubleAlignmentMaskTagged));
j(zero, &aligned, Label::kNear);
- mov(Operand(result, 0),
+ mov(Operand(result, -kHeapObjectTag),
Immediate(isolate()->factory()->one_pointer_filler_map()));
add(result, Immediate(kDoubleSize / 2));
bind(&aligned);
@@ -1776,9 +1761,6 @@ void MacroAssembler::FastAllocate(Register object_size, Register result,
lea(result_end, Operand(result, object_size, times_1, 0));
UpdateAllocationTopHelper(result_end, no_reg, flags);
-
- DCHECK(kHeapObjectTag == 1);
- inc(result);
}
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698