UniqueSet<Map> map_set = instr->hydrogen()->map_set();
Label success;
- for (int i = 0; i < map_set.size(); i++) {
+ for (int i = 0; i < map_set.size() - 1; i++) {
Handle<Map> map = map_set.at(i).handle();
__ CompareMap(map_reg, map);
__ B(eq, &success);
}
+ Handle<Map> map = map_set.at(map_set.size() - 1).handle();
+ __ CompareMap(map_reg, map);
// We didn't match a map.
if (instr->hydrogen()->has_migration_target()) {
- __ B(deferred->entry());
+ __ B(ne, deferred->entry());
} else {
- Deoptimize(instr->environment());
+ DeoptimizeIf(ne, instr->environment());
}
__ Bind(&success);
Register temp1 = x10;
Register temp2 = x11;
Smi* index = instr->index();
- Label runtime, done, deopt, obj_ok;
+ Label runtime, done;
ASSERT(object.is(result) && object.Is(x0));
ASSERT(instr->IsMarkedAsCall());
- __ JumpIfSmi(object, &deopt);
+ DeoptimizeIfSmi(object, instr->environment());
__ CompareObjectType(object, temp1, temp1, JS_DATE_TYPE);
- __ B(eq, &obj_ok);
-
- __ Bind(&deopt);
- Deoptimize(instr->environment());
+ DeoptimizeIf(ne, instr->environment());
- __ Bind(&obj_ok);
if (index->value() == 0) {
__ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
} else {
return;
}
- Label deopt;
// Check for x / 0.
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
- __ Cbz(divisor, &deopt);
+ DeoptimizeIfZero(divisor, instr->environment());
}
// Check for (0 / -x) as that will produce negative zero.
// If the divisor >= 0 (pl, the opposite of mi) set the flags to
// condition ne, so we don't deopt, ie. positive divisor doesn't deopt.
__ Ccmp(dividend, 0, NoFlag, mi);
- __ B(eq, &deopt);
+ DeoptimizeIf(eq, instr->environment());
}
// Check for (kMinInt / -1).
// -1. If overflow is clear, set the flags for condition ne, as the
// dividend isn't -1, and thus we shouldn't deopt.
__ Ccmp(divisor, -1, NoFlag, vs);
- __ B(eq, &deopt);
+ DeoptimizeIf(eq, instr->environment());
}
// Compute remainder and deopt if it's not zero.
Register remainder = ToRegister32(instr->temp());
__ Msub(remainder, result, divisor, dividend);
- __ Cbnz(remainder, &deopt);
-
- Label div_ok;
- __ B(&div_ok);
- __ Bind(&deopt);
- Deoptimize(instr->environment());
- __ Bind(&div_ok);
+ DeoptimizeIfNotZero(remainder, instr->environment());
}
ASSERT(instr->IsMarkedAsCall());
ASSERT(object.Is(x0));
- Label deopt;
-
- __ JumpIfRoot(object, Heap::kUndefinedValueRootIndex, &deopt);
+ DeoptimizeIfRoot(object, Heap::kUndefinedValueRootIndex,
+ instr->environment());
__ LoadRoot(null_value, Heap::kNullValueRootIndex);
__ Cmp(object, null_value);
- __ B(eq, &deopt);
+ DeoptimizeIf(eq, instr->environment());
- __ JumpIfSmi(object, &deopt);
+ DeoptimizeIfSmi(object, instr->environment());
STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
__ CompareObjectType(object, x1, x1, LAST_JS_PROXY_TYPE);
- __ B(le, &deopt);
+ DeoptimizeIf(le, instr->environment());
Label use_cache, call_runtime;
__ CheckEnumCache(object, null_value, x1, x2, x3, x4, &call_runtime);
__ Ldr(object, FieldMemOperand(object, HeapObject::kMapOffset));
__ B(&use_cache);
- __ Bind(&deopt);
- Deoptimize(instr->environment());
-
// Get the set of properties to enumerate.
__ Bind(&call_runtime);
__ Push(object);
CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr);
__ Ldr(x1, FieldMemOperand(object, HeapObject::kMapOffset));
- __ JumpIfNotRoot(x1, Heap::kMetaMapRootIndex, &deopt);
+ DeoptimizeIfNotRoot(x1, Heap::kMetaMapRootIndex, instr->environment());
__ Bind(&use_cache);
}
Register function = ToRegister(instr->function());
Register result = ToRegister(instr->result());
Register temp = ToRegister(instr->temp());
- Label deopt;
// Check that the function really is a function. Leaves map in the result
// register.
- __ JumpIfNotObjectType(function, result, temp, JS_FUNCTION_TYPE, &deopt);
+ __ CompareObjectType(function, result, temp, JS_FUNCTION_TYPE);
+ DeoptimizeIf(ne, instr->environment());
// Make sure that the function has an instance prototype.
Label non_instance;
JSFunction::kPrototypeOrInitialMapOffset));
// Check that the function has a prototype or an initial map.
- __ JumpIfRoot(result, Heap::kTheHoleValueRootIndex, &deopt);
+ DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex,
+ instr->environment());
// If the function does not have an initial map, we're done.
Label done;
// map.
__ Bind(&non_instance);
__ Ldr(result, FieldMemOperand(result, Map::kConstructorOffset));
- __ B(&done);
-
- // Deoptimize case.
- __ Bind(&deopt);
- Deoptimize(instr->environment());
// All done.
__ Bind(&done);
: ToRegister32(instr->value());
Register result = r.IsSmi() ? ToRegister(instr->result())
: ToRegister32(instr->result());
- Label done;
- __ Abs(result, input, NULL, &done);
- Deoptimize(instr->environment());
- __ Bind(&done);
+ __ Abs(result, input);
+ DeoptimizeIf(vs, instr->environment());
}
}
Register divisor = ToRegister32(instr->right());
Register result = ToRegister32(instr->result());
- Label deopt, done;
+ Label done;
// modulo = dividend - quotient * divisor
__ Sdiv(result, dividend, divisor);
if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
- // Combine the deoptimization sites.
- Label ok;
- __ Cbnz(divisor, &ok);
- __ Bind(&deopt);
- Deoptimize(instr->environment());
- __ Bind(&ok);
+ DeoptimizeIfZero(divisor, instr->environment());
}
__ Msub(result, result, divisor, dividend);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
__ Cbnz(result, &done);
- if (deopt.is_bound()) { // TODO(all) This is a hack, remove this...
- __ Tbnz(dividend, kWSignBit, &deopt);
- } else {
- DeoptimizeIfNegative(dividend, instr->environment());
- }
+ DeoptimizeIfNegative(dividend, instr->environment());
}
__ Bind(&done);
}
Register temp2 = ToRegister(instr->temp2());
Label no_memento_found;
- __ JumpIfJSArrayHasAllocationMemento(object, temp1, temp2, &no_memento_found);
- Deoptimize(instr->environment());
+ __ TestJSArrayForAllocationMemento(object, temp1, temp2, &no_memento_found);
+ DeoptimizeIf(eq, instr->environment());
__ Bind(&no_memento_found);
}
// If the receiver is null or undefined, we have to pass the global object as
// a receiver to normal functions. Values have to be passed unchanged to
// builtins and strict-mode functions.
- Label global_object, done, deopt;
+ Label global_object, done;
if (!instr->hydrogen()->known_function()) {
__ Ldr(result, FieldMemOperand(function,
__ JumpIfRoot(receiver, Heap::kUndefinedValueRootIndex, &global_object);
// Deoptimize if the receiver is not a JS object.
- __ JumpIfSmi(receiver, &deopt);
+ DeoptimizeIfSmi(receiver, instr->environment());
__ CompareObjectType(receiver, result, result, FIRST_SPEC_OBJECT_TYPE);
__ Mov(result, receiver);
__ B(ge, &done);
- // Otherwise, fall through to deopt.
-
- __ Bind(&deopt);
Deoptimize(instr->environment());
__ Bind(&global_object);