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

Unified Diff: vm/intermediate_language_ia32.cc

Issue 11745022: - Make Boolean 'true' and 'false' singleton VM isolate objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 12 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 | « vm/intermediate_language.cc ('k') | vm/intermediate_language_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language_ia32.cc
===================================================================
--- vm/intermediate_language_ia32.cc (revision 16591)
+++ vm/intermediate_language_ia32.cc (working copy)
@@ -206,9 +206,9 @@
// Call the runtime if the object is not bool::true or bool::false.
ASSERT(locs->always_calls());
Label done;
- __ CompareObject(reg, compiler->bool_true());
+ __ CompareObject(reg, Bool::True());
__ j(EQUAL, &done, Assembler::kNearJump);
- __ CompareObject(reg, compiler->bool_false());
+ __ CompareObject(reg, Bool::False());
__ j(EQUAL, &done, Assembler::kNearJump);
__ pushl(reg); // Push the source object.
@@ -399,12 +399,10 @@
__ popl(EDX);
__ cmpl(EAX, EDX);
__ j(EQUAL, &is_true);
- __ LoadObject(EAX, (kind == Token::kEQ) ? compiler->bool_false()
- : compiler->bool_true());
+ __ LoadObject(EAX, (kind == Token::kEQ) ? Bool::False() : Bool::True());
__ jmp(&equality_done);
__ Bind(&is_true);
- __ LoadObject(EAX, (kind == Token::kEQ) ? compiler->bool_true()
- : compiler->bool_false());
+ __ LoadObject(EAX, (kind == Token::kEQ) ? Bool::True() : Bool::False());
if (kind == Token::kNE) {
// Skip not-equal result conversion.
__ jmp(&equality_done);
@@ -425,13 +423,13 @@
if (kind == Token::kNE) {
Label false_label, true_label, done;
// Negate the condition: true label returns false and vice versa.
- __ CompareObject(EAX, compiler->bool_true());
+ __ CompareObject(EAX, Bool::True());
__ j(EQUAL, &true_label, Assembler::kNearJump);
__ Bind(&false_label);
- __ LoadObject(EAX, compiler->bool_true());
+ __ LoadObject(EAX, Bool::True());
__ jmp(&done, Assembler::kNearJump);
__ Bind(&true_label);
- __ LoadObject(EAX, compiler->bool_false());
+ __ LoadObject(EAX, Bool::False());
__ Bind(&done);
}
__ Bind(&equality_done);
@@ -488,10 +486,10 @@
Register result = locs->out().reg();
Label load_true;
__ j(cond, &load_true, Assembler::kNearJump);
- __ LoadObject(result, compiler->bool_false());
+ __ LoadObject(result, Bool::False());
__ jmp(&done);
__ Bind(&load_true);
- __ LoadObject(result, compiler->bool_true());
+ __ LoadObject(result, Bool::True());
}
} else {
const int kNumberOfArguments = 2;
@@ -505,19 +503,19 @@
if (branch == NULL) {
if (kind == Token::kNE) {
Label false_label;
- __ CompareObject(EAX, compiler->bool_true());
+ __ CompareObject(EAX, Bool::True());
__ j(EQUAL, &false_label, Assembler::kNearJump);
- __ LoadObject(EAX, compiler->bool_true());
+ __ LoadObject(EAX, Bool::True());
__ jmp(&done);
__ Bind(&false_label);
- __ LoadObject(EAX, compiler->bool_false());
+ __ LoadObject(EAX, Bool::False());
__ jmp(&done);
}
} else {
if (branch->is_checked()) {
EmitAssertBoolean(EAX, token_pos, locs, compiler);
}
- __ CompareObject(EAX, compiler->bool_true());
+ __ CompareObject(EAX, Bool::True());
branch->EmitBranchOnCondition(compiler, cond);
}
}
@@ -570,12 +568,10 @@
Register result = locs.out().reg();
__ j(EQUAL, &is_equal, Assembler::kNearJump);
// Not equal.
- __ LoadObject(result, (kind == Token::kEQ) ? compiler->bool_false()
- : compiler->bool_true());
+ __ LoadObject(result, (kind == Token::kEQ) ? Bool::False() : Bool::True());
__ jmp(&done, Assembler::kNearJump);
__ Bind(&is_equal);
- __ LoadObject(result, (kind == Token::kEQ) ? compiler->bool_true()
- : compiler->bool_false());
+ __ LoadObject(result, (kind == Token::kEQ) ? Bool::True() : Bool::False());
__ Bind(&done);
} else {
Condition cond = TokenKindToSmiCondition(kind);
@@ -615,10 +611,10 @@
Register result = locs->out().reg();
Label load_true;
__ j(cond, &load_true, Assembler::kNearJump);
- __ LoadObject(result, compiler->bool_false());
+ __ LoadObject(result, Bool::False());
__ jmp(&done);
__ Bind(&load_true);
- __ LoadObject(result, compiler->bool_true());
+ __ LoadObject(result, Bool::True());
}
__ jmp(&done);
__ Bind(&non_null_compare); // Receiver is not null.
@@ -655,10 +651,10 @@
Register result = locs.out().reg();
Label done, is_true;
__ j(true_condition, &is_true);
- __ LoadObject(result, compiler->bool_false());
+ __ LoadObject(result, Bool::False());
__ jmp(&done);
__ Bind(&is_true);
- __ LoadObject(result, compiler->bool_true());
+ __ LoadObject(result, Bool::True());
__ Bind(&done);
}
}
@@ -700,10 +696,10 @@
Register result = locs.out().reg();
Label done, is_true;
__ j(true_condition, &is_true);
- __ LoadObject(result, compiler->bool_false());
+ __ LoadObject(result, Bool::False());
__ jmp(&done);
__ Bind(&is_true);
- __ LoadObject(result, compiler->bool_true());
+ __ LoadObject(result, Bool::True());
__ Bind(&done);
}
}
@@ -765,10 +761,10 @@
Label done;
__ j(lo_cond, &is_true);
__ Bind(&is_false);
- __ LoadObject(result, compiler->bool_false());
+ __ LoadObject(result, Bool::False());
__ jmp(&done);
__ Bind(&is_true);
- __ LoadObject(result, compiler->bool_true());
+ __ LoadObject(result, Bool::True());
__ Bind(&done);
}
}
@@ -891,7 +887,7 @@
EmitAssertBoolean(EAX, token_pos(), locs(), compiler);
}
Condition branch_condition = (kind() == Token::kNE) ? NOT_EQUAL : EQUAL;
- __ CompareObject(EAX, compiler->bool_true());
+ __ CompareObject(EAX, Bool::True());
branch->EmitBranchOnCondition(compiler, branch_condition);
}
@@ -1031,7 +1027,7 @@
return;
}
EmitNativeCode(compiler);
- __ CompareObject(EAX, compiler->bool_true());
+ __ CompareObject(EAX, Bool::True());
branch->EmitBranchOnCondition(compiler, EQUAL);
}
« no previous file with comments | « vm/intermediate_language.cc ('k') | vm/intermediate_language_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698