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

Unified Diff: vm/intermediate_language_x64.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_test.cc ('k') | vm/intrinsifier_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language_x64.cc
===================================================================
--- vm/intermediate_language_x64.cc (revision 16591)
+++ vm/intermediate_language_x64.cc (working copy)
@@ -217,9 +217,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);
__ pushq(reg); // Push the source object.
@@ -400,12 +400,10 @@
__ popq(RDX);
__ cmpq(RAX, RDX);
__ j(EQUAL, &is_true);
- __ LoadObject(RAX, (kind == Token::kEQ) ? compiler->bool_false()
- : compiler->bool_true());
+ __ LoadObject(RAX, (kind == Token::kEQ) ? Bool::False() : Bool::True());
__ jmp(&equality_done);
__ Bind(&is_true);
- __ LoadObject(RAX, (kind == Token::kEQ) ? compiler->bool_true()
- : compiler->bool_false());
+ __ LoadObject(RAX, (kind == Token::kEQ) ? Bool::True() : Bool::False());
if (kind == Token::kNE) {
// Skip not-equal result conversion.
__ jmp(&equality_done);
@@ -426,13 +424,13 @@
if (kind == Token::kNE) {
Label false_label, true_label, done;
// Negate the condition: true label returns false and vice versa.
- __ CompareObject(RAX, compiler->bool_true());
+ __ CompareObject(RAX, Bool::True());
__ j(EQUAL, &true_label, Assembler::kNearJump);
__ Bind(&false_label);
- __ LoadObject(RAX, compiler->bool_true());
+ __ LoadObject(RAX, Bool::True());
__ jmp(&done, Assembler::kNearJump);
__ Bind(&true_label);
- __ LoadObject(RAX, compiler->bool_false());
+ __ LoadObject(RAX, Bool::False());
__ Bind(&done);
}
__ Bind(&equality_done);
@@ -490,10 +488,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;
@@ -507,19 +505,19 @@
if (branch == NULL) {
if (kind == Token::kNE) {
Label false_label;
- __ CompareObject(RAX, compiler->bool_true());
+ __ CompareObject(RAX, Bool::True());
__ j(EQUAL, &false_label, Assembler::kNearJump);
- __ LoadObject(RAX, compiler->bool_true());
+ __ LoadObject(RAX, Bool::True());
__ jmp(&done);
__ Bind(&false_label);
- __ LoadObject(RAX, compiler->bool_false());
+ __ LoadObject(RAX, Bool::False());
__ jmp(&done);
}
} else {
if (branch->is_checked()) {
EmitAssertBoolean(RAX, token_pos, locs, compiler);
}
- __ CompareObject(RAX, compiler->bool_true());
+ __ CompareObject(RAX, Bool::True());
branch->EmitBranchOnCondition(compiler, cond);
}
}
@@ -572,12 +570,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);
@@ -617,10 +613,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.
@@ -657,10 +653,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);
}
}
@@ -777,7 +773,7 @@
EmitAssertBoolean(RAX, token_pos(), locs(), compiler);
}
Condition branch_condition = (kind() == Token::kNE) ? NOT_EQUAL : EQUAL;
- __ CompareObject(RAX, compiler->bool_true());
+ __ CompareObject(RAX, Bool::True());
branch->EmitBranchOnCondition(compiler, branch_condition);
}
@@ -899,7 +895,7 @@
return;
}
EmitNativeCode(compiler);
- __ CompareObject(RAX, compiler->bool_true());
+ __ CompareObject(RAX, Bool::True());
branch->EmitBranchOnCondition(compiler, EQUAL);
}
« no previous file with comments | « vm/intermediate_language_test.cc ('k') | vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698