| Index: src/ia32/code-stubs-ia32.cc
|
| diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
|
| index 598596bd760c0e596642fb7ab725375858d64eb2..ed7e56c110941cefbaeaec787f93ddcb2d368bc8 100644
|
| --- a/src/ia32/code-stubs-ia32.cc
|
| +++ b/src/ia32/code-stubs-ia32.cc
|
| @@ -249,14 +249,14 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
|
| }
|
|
|
| // 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);
|
| + CheckOddball(masm, NULL_TYPE, Heap::kNullValueRootIndex, false, &patch);
|
|
|
| if (types_.Contains(SMI)) {
|
| // Smis: 0 -> false, all other -> true
|
| @@ -351,14 +351,14 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
|
|
|
| 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 @@ void ToBooleanStub::CheckOddball(MacroAssembler* masm,
|
| } 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);
|
| }
|
| }
|
|
|