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

Unified Diff: src/arm/codegen-arm.cc

Issue 171089: Revert commit 2701 per Erik Corry's request. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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/cfg-arm.cc ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/codegen-arm.cc
===================================================================
--- src/arm/codegen-arm.cc (revision 2701)
+++ src/arm/codegen-arm.cc (working copy)
@@ -305,7 +305,7 @@
// sp: stack pointer
// fp: frame pointer
// cp: callee's context
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ __ mov(r0, Operand(Factory::undefined_value()));
function_return_.Bind();
if (FLAG_trace) {
@@ -478,11 +478,11 @@
JumpTarget loaded;
JumpTarget materialize_true;
materialize_true.Branch(cc_reg_);
- __ LoadRoot(r0, Heap::kFalseValueRootIndex);
+ __ mov(r0, Operand(Factory::false_value()));
frame_->EmitPush(r0);
loaded.Jump();
materialize_true.Bind();
- __ LoadRoot(r0, Heap::kTrueValueRootIndex);
+ __ mov(r0, Operand(Factory::true_value()));
frame_->EmitPush(r0);
loaded.Bind();
cc_reg_ = al;
@@ -499,7 +499,7 @@
// Load "true" if necessary.
if (true_target.is_linked()) {
true_target.Bind();
- __ LoadRoot(r0, Heap::kTrueValueRootIndex);
+ __ mov(r0, Operand(Factory::true_value()));
frame_->EmitPush(r0);
}
// If both "true" and "false" need to be loaded jump across the code for
@@ -510,7 +510,7 @@
// Load "false" if necessary.
if (false_target.is_linked()) {
false_target.Bind();
- __ LoadRoot(r0, Heap::kFalseValueRootIndex);
+ __ mov(r0, Operand(Factory::false_value()));
frame_->EmitPush(r0);
}
// A value is loaded on all paths reaching this point.
@@ -640,18 +640,15 @@
// Fast case checks
// Check if the value is 'false'.
- __ LoadRoot(ip, Heap::kFalseValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::false_value()));
false_target->Branch(eq);
// Check if the value is 'true'.
- __ LoadRoot(ip, Heap::kTrueValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::true_value()));
true_target->Branch(eq);
// Check if the value is 'undefined'.
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::undefined_value()));
false_target->Branch(eq);
// Check if the value is a smi.
@@ -664,8 +661,7 @@
frame_->EmitPush(r0);
frame_->CallRuntime(Runtime::kToBool, 1);
// Convert the result (r0) to a condition code.
- __ LoadRoot(ip, Heap::kFalseValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::false_value()));
cc_reg_ = ne;
}
@@ -1189,7 +1185,7 @@
// 'undefined') because we may have a (legal) redeclaration and we
// must not destroy the current value.
if (node->mode() == Variable::CONST) {
- __ LoadRoot(r0, Heap::kTheHoleValueRootIndex);
+ __ mov(r0, Operand(Factory::the_hole_value()));
frame_->EmitPush(r0);
} else if (node->fun() != NULL) {
LoadAndSpill(node->fun());
@@ -1729,11 +1725,9 @@
// Both SpiderMonkey and kjs ignore null and undefined in contrast
// to the specification. 12.6.4 mandates a call to ToObject.
frame_->EmitPop(r0);
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::undefined_value()));
exit.Branch(eq);
- __ LoadRoot(ip, Heap::kNullValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::null_value()));
exit.Branch(eq);
// Stack layout in body:
@@ -1765,8 +1759,7 @@
// Otherwise, we got a FixedArray, and we have to do a slow check.
__ mov(r2, Operand(r0));
__ ldr(r1, FieldMemOperand(r2, HeapObject::kMapOffset));
- __ LoadRoot(ip, Heap::kMetaMapRootIndex);
- __ cmp(r1, ip);
+ __ cmp(r1, Operand(Factory::meta_map()));
fixed_array.Branch(ne);
// Get enum cache
@@ -1840,8 +1833,7 @@
__ mov(r3, Operand(r0));
// If the property has been removed while iterating, we just skip it.
- __ LoadRoot(ip, Heap::kNullValueRootIndex);
- __ cmp(r3, ip);
+ __ cmp(r3, Operand(Factory::null_value()));
node->continue_target()->Branch(eq);
end_del_check.Bind();
@@ -2101,7 +2093,7 @@
// Fake a top of stack value (unneeded when FALLING) and set the
// state in r2, then jump around the unlink blocks if any.
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ __ mov(r0, Operand(Factory::undefined_value()));
frame_->EmitPush(r0);
__ mov(r2, Operand(Smi::FromInt(FALLING)));
if (nof_unlinks > 0) {
@@ -2143,7 +2135,7 @@
frame_->EmitPush(r0);
} else {
// Fake TOS for targets that shadowed breaks and continues.
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ __ mov(r0, Operand(Factory::undefined_value()));
frame_->EmitPush(r0);
}
__ mov(r2, Operand(Smi::FromInt(JUMPING + i)));
@@ -2330,9 +2322,8 @@
r2,
&slow));
if (potential_slot->var()->mode() == Variable::CONST) {
- __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
- __ cmp(r0, ip);
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
+ __ cmp(r0, Operand(Factory::the_hole_value()));
+ __ mov(r0, Operand(Factory::undefined_value()), LeaveCC, eq);
}
// There is always control flow to slow from
// ContextSlotOperandCheckExtensions so we have to jump around
@@ -2369,9 +2360,8 @@
// value.
Comment cmnt(masm_, "[ Unhole const");
frame_->EmitPop(r0);
- __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
- __ cmp(r0, ip);
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex, eq);
+ __ cmp(r0, Operand(Factory::the_hole_value()));
+ __ mov(r0, Operand(Factory::undefined_value()), LeaveCC, eq);
frame_->EmitPush(r0);
}
}
@@ -2414,8 +2404,7 @@
__ bind(&next);
// Terminate at global context.
__ ldr(tmp2, FieldMemOperand(tmp, HeapObject::kMapOffset));
- __ LoadRoot(ip, Heap::kGlobalContextMapRootIndex);
- __ cmp(tmp2, ip);
+ __ cmp(tmp2, Operand(Factory::global_context_map()));
__ b(eq, &fast);
// Check that extension is NULL.
__ ldr(tmp2, ContextOperand(tmp, Context::EXTENSION_INDEX));
@@ -2512,8 +2501,7 @@
__ ldr(r2, FieldMemOperand(r1, literal_offset));
JumpTarget done;
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r2, ip);
+ __ cmp(r2, Operand(Factory::undefined_value()));
done.Branch(ne);
// If the entry is undefined we call the runtime system to computed
@@ -2595,8 +2583,7 @@
// Check whether we need to materialize the object literal boilerplate.
// If so, jump to the deferred code.
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r2, Operand(ip));
+ __ cmp(r2, Operand(Factory::undefined_value()));
deferred->Branch(eq);
deferred->BindExit();
@@ -2718,8 +2705,7 @@
// Check whether we need to materialize the object literal boilerplate.
// If so, jump to the deferred code.
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r2, Operand(ip));
+ __ cmp(r2, Operand(Factory::undefined_value()));
deferred->Branch(eq);
deferred->BindExit();
@@ -3050,7 +3036,7 @@
// Prepare stack for call to resolved function.
LoadAndSpill(function);
- __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
+ __ mov(r2, Operand(Factory::undefined_value()));
frame_->EmitPush(r2); // Slot for receiver
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
@@ -3194,7 +3180,7 @@
// Non-JS objects have class null.
null.Bind();
- __ LoadRoot(r0, Heap::kNullValueRootIndex);
+ __ mov(r0, Operand(Factory::null_value()));
frame_->EmitPush(r0);
// All done.
@@ -3267,7 +3253,7 @@
__ CallRuntime(Runtime::kLog, 2);
}
#endif
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ __ mov(r0, Operand(Factory::undefined_value()));
frame_->EmitPush(r0);
}
@@ -3288,7 +3274,7 @@
void CodeGenerator::GenerateFastCharCodeAt(ZoneList<Expression*>* args) {
VirtualFrame::SpilledScope spilled_scope;
ASSERT(args->length() == 2);
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ __ mov(r0, Operand(Factory::undefined_value()));
frame_->EmitPush(r0);
}
@@ -3508,14 +3494,14 @@
} else {
// Default: Result of deleting non-global, not dynamically
// introduced variables is false.
- __ LoadRoot(r0, Heap::kFalseValueRootIndex);
+ __ mov(r0, Operand(Factory::false_value()));
}
} else {
// Default: Result of deleting expressions is true.
LoadAndSpill(node->expression()); // may have side-effects
frame_->Drop();
- __ LoadRoot(r0, Heap::kTrueValueRootIndex);
+ __ mov(r0, Operand(Factory::true_value()));
}
frame_->EmitPush(r0);
@@ -3568,7 +3554,7 @@
case Token::VOID:
// since the stack top is cached in r0, popping and then
// pushing a value can be done by just writing to r0.
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
+ __ mov(r0, Operand(Factory::undefined_value()));
break;
case Token::ADD: {
@@ -3894,16 +3880,14 @@
if (left_is_null || right_is_null) {
LoadAndSpill(left_is_null ? right : left);
frame_->EmitPop(r0);
- __ LoadRoot(ip, Heap::kNullValueRootIndex);
- __ cmp(r0, ip);
+ __ cmp(r0, Operand(Factory::null_value()));
// The 'null' value is only equal to 'undefined' if using non-strict
// comparisons.
if (op != Token::EQ_STRICT) {
true_target()->Branch(eq);
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r0, Operand(ip));
+ __ cmp(r0, Operand(Factory::undefined_value()));
true_target()->Branch(eq);
__ tst(r0, Operand(kSmiTagMask));
@@ -3940,8 +3924,7 @@
__ tst(r1, Operand(kSmiTagMask));
true_target()->Branch(eq);
__ ldr(r1, FieldMemOperand(r1, HeapObject::kMapOffset));
- __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
- __ cmp(r1, ip);
+ __ cmp(r1, Operand(Factory::heap_number_map()));
cc_reg_ = eq;
} else if (check->Equals(Heap::string_symbol())) {
@@ -3961,16 +3944,13 @@
cc_reg_ = lt;
} else if (check->Equals(Heap::boolean_symbol())) {
- __ LoadRoot(ip, Heap::kTrueValueRootIndex);
- __ cmp(r1, ip);
+ __ cmp(r1, Operand(Factory::true_value()));
true_target()->Branch(eq);
- __ LoadRoot(ip, Heap::kFalseValueRootIndex);
- __ cmp(r1, ip);
+ __ cmp(r1, Operand(Factory::false_value()));
cc_reg_ = eq;
} else if (check->Equals(Heap::undefined_symbol())) {
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r1, ip);
+ __ cmp(r1, Operand(Factory::undefined_value()));
true_target()->Branch(eq);
__ tst(r1, Operand(kSmiTagMask));
@@ -3995,8 +3975,7 @@
false_target()->Branch(eq);
__ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
- __ LoadRoot(ip, Heap::kNullValueRootIndex);
- __ cmp(r1, ip);
+ __ cmp(r1, Operand(Factory::null_value()));
true_target()->Branch(eq);
// It can be an undetectable object.
@@ -4227,8 +4206,7 @@
// executed, the code is identical to a normal store (see below).
Comment cmnt(masm, "[ Init const");
__ ldr(r2, cgen_->SlotOperand(slot, r2));
- __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
- __ cmp(r2, ip);
+ __ cmp(r2, Operand(Factory::the_hole_value()));
exit.Branch(ne);
}
@@ -4961,7 +4939,7 @@
// Tag and adjust back to start of new object.
__ sub(result_reg, result_reg, Operand(HeapNumber::kSize - kHeapObjectTag));
// Get heap number map into scratch2.
- __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex);
+ __ mov(scratch2, Operand(Factory::heap_number_map()));
// Store heap number map in new object.
__ str(scratch2, FieldMemOperand(result_reg, HeapObject::kMapOffset));
}
@@ -6107,8 +6085,7 @@
__ bind(&loop);
__ cmp(r2, Operand(r4));
__ b(eq, &is_instance);
- __ LoadRoot(ip, Heap::kNullValueRootIndex);
- __ cmp(r2, ip);
+ __ cmp(r2, Operand(Factory::null_value()));
__ b(eq, &is_not_instance);
__ ldr(r2, FieldMemOperand(r2, HeapObject::kMapOffset));
__ ldr(r2, FieldMemOperand(r2, Map::kPrototypeOffset));
« no previous file with comments | « src/arm/cfg-arm.cc ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698