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

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 7544012: Implement type recording for ToBoolean on x64. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 5 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
Index: src/ia32/code-stubs-ia32.cc
===================================================================
--- src/ia32/code-stubs-ia32.cc (revision 8763)
+++ src/ia32/code-stubs-ia32.cc (working copy)
@@ -249,14 +249,14 @@
}
// undefined -> false
- CheckOddball(masm, UNDEFINED, factory->undefined_value(), false, &patch);
+ CheckOddball(masm, UNDEFINED, Heap::kUndefinedValueRootIndex, false, &patch);
// Boolean -> its value
- CheckOddball(masm, BOOLEAN, factory->false_value(), false, &patch);
- CheckOddball(masm, BOOLEAN, factory->true_value(), true, &patch);
+ CheckOddball(masm, BOOLEAN, Heap::kFalseValueRootIndex, false, &patch);
+ CheckOddball(masm, BOOLEAN, Heap::kTrueValueRootIndex, true, &patch);
- // 'null' -> false.
- CheckOddball(masm, NULL_TYPE, factory->null_value(), false, &patch);
+ // 'null' -> false.!!!
Kevin Millikin (Chromium) 2011/08/01 13:02:05 Don't be so surprised, it's JavaScript :)
Sven Panne 2011/08/01 13:13:25 Ooops, a leftover from a previous debugging sessio
+ CheckOddball(masm, NULL_TYPE, Heap::kNullValueRootIndex, false, &patch);
if (types_.Contains(SMI)) {
// Smis: 0 -> false, all other -> true
@@ -351,14 +351,14 @@
void ToBooleanStub::CheckOddball(MacroAssembler* masm,
Type type,
- Handle<Object> value,
+ Heap::RootListIndex value,
bool result,
Label* patch) {
const Register argument = eax;
if (types_.Contains(type)) {
// If we see an expected oddball, return its ToBoolean value tos_.
Label different_value;
- __ cmp(argument, value);
+ __ CompareRoot(argument, value);
__ j(not_equal, &different_value, Label::kNear);
__ Set(tos_, Immediate(result ? 1 : 0));
__ ret(1 * kPointerSize);
@@ -366,7 +366,7 @@
} else if (types_.Contains(INTERNAL_OBJECT)) {
// If we see an unexpected oddball and handle internal objects, we must
// patch because the code for internal objects doesn't handle it explictly.
- __ cmp(argument, value);
+ __ CompareRoot(argument, value);
__ j(equal, patch);
}
}

Powered by Google App Engine
This is Rietveld 408576698