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

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

Issue 201015: Second step in allocating objects in generated code on ARM (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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/arm/macro-assembler-arm.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
===================================================================
--- src/arm/macro-assembler-arm.cc (revision 2828)
+++ src/arm/macro-assembler-arm.cc (working copy)
@@ -773,7 +773,7 @@
Register scratch1,
Register scratch2,
Label* gc_required,
- bool tag_allocated_object) {
+ AllocationFlags flags) {
ASSERT(!result.is(scratch1));
ASSERT(!scratch1.is(scratch2));
@@ -782,7 +782,18 @@
ExternalReference new_space_allocation_top =
ExternalReference::new_space_allocation_top_address();
mov(scratch1, Operand(new_space_allocation_top));
- ldr(result, MemOperand(scratch1));
+ if ((flags & RESULT_CONTAINS_TOP) == 0) {
+ ldr(result, MemOperand(scratch1));
+ } else {
+#ifdef DEBUG
+ // Assert that result actually contains top on entry. scratch2 is used
+ // immediately below so this use of scratch2 does not cause difference with
+ // respect to register content between debug and release mode.
+ ldr(scratch2, MemOperand(scratch1));
+ cmp(result, scratch2);
+ Check(eq, "Unexpected allocation top");
+#endif
+ }
// Calculate new top and bail out if new space is exhausted. Use result
// to calculate the new top.
@@ -798,7 +809,7 @@
str(result, MemOperand(scratch1));
// Tag and adjust back to start of new object.
- if (tag_allocated_object) {
+ if ((flags & TAG_OBJECT) != 0) {
sub(result, result, Operand((object_size * kPointerSize) -
kHeapObjectTag));
} else {
@@ -812,7 +823,7 @@
Register scratch1,
Register scratch2,
Label* gc_required,
- bool tag_allocated_object) {
+ AllocationFlags flags) {
ASSERT(!result.is(scratch1));
ASSERT(!scratch1.is(scratch2));
@@ -821,7 +832,18 @@
ExternalReference new_space_allocation_top =
ExternalReference::new_space_allocation_top_address();
mov(scratch1, Operand(new_space_allocation_top));
- ldr(result, MemOperand(scratch1));
+ if ((flags & RESULT_CONTAINS_TOP) == 0) {
+ ldr(result, MemOperand(scratch1));
+ } else {
+#ifdef DEBUG
+ // Assert that result actually contains top on entry. scratch2 is used
+ // immediately below so this use of scratch2 does not cause difference with
+ // respect to register content between debug and release mode.
+ ldr(scratch2, MemOperand(scratch1));
+ cmp(result, scratch2);
+ Check(eq, "Unexpected allocation top");
+#endif
+ }
// Calculate new top and bail out if new space is exhausted. Use result
// to calculate the new top. Object size is in words so a shift is required to
@@ -831,19 +853,18 @@
mov(scratch2, Operand(new_space_allocation_limit));
ldr(scratch2, MemOperand(scratch2));
add(result, result, Operand(object_size, LSL, kPointerSizeLog2));
-
cmp(result, Operand(scratch2));
b(hi, gc_required);
// Update allocation top. result temporarily holds the new top,
str(result, MemOperand(scratch1));
- // Tag and adjust back to start of new object.
- if (tag_allocated_object) {
- sub(result, result, Operand(object_size, LSL, kPointerSizeLog2));
+ // Adjust back to start of new object.
+ sub(result, result, Operand(object_size, LSL, kPointerSizeLog2));
+
+ // Tag object if requested.
+ if ((flags & TAG_OBJECT) != 0) {
add(result, result, Operand(kHeapObjectTag));
- } else {
- sub(result, result, Operand(object_size, LSL, kPointerSizeLog2));
}
}
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698