smi_value,
overwrite_mode);
}
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiAddConstant(operand->reg(),
operand->reg(),
smi_value,
DeferredCode* deferred = new DeferredInlineSmiSub(operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
// A smi currently fits in a 32-bit Immediate.
__ SmiSubConstant(operand->reg(),
operand->reg(),
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiShiftArithmeticRightConstant(operand->reg(),
operand->reg(),
shift_value);
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiShiftLogicalRightConstant(answer.reg(),
operand->reg(),
shift_value,
smi_value,
operand->reg(),
overwrite_mode);
- if (!operand->type_info().IsSmi()) {
- Condition is_smi = masm_->CheckSmi(operand->reg());
- deferred->Branch(NegateCondition(is_smi));
- } else if (FLAG_debug_code) {
- __ AbortIfNotSmi(operand->reg());
- }
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ Move(answer.reg(), smi_value);
__ SmiShiftLeft(answer.reg(), answer.reg(), operand->reg());
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
deferred->BindExit();
answer = *operand;
} else {
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiShiftLeftConstant(answer.reg(),
operand->reg(),
shift_value);
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
if (op == Token::BIT_AND) {
__ SmiAndConstant(operand->reg(), operand->reg(), smi_value);
} else if (op == Token::BIT_XOR) {
}
+void CodeGenerator::JumpIfNotSmiUsingTypeInfo(Register reg,
+ TypeInfo type,
+ DeferredCode* deferred) {
+ if (!type.IsSmi()) {
+ __ JumpIfNotSmi(reg, deferred->entry_label());
+ }
+ if (FLAG_debug_code) {
+ __ AbortIfNotSmi(reg);
+ }
+}
+
+
void CodeGenerator::JumpIfNotBothSmiUsingTypeInfo(Register left,
Register right,
TypeInfo left_info,
void GenericBinaryOperation(BinaryOperation* expr,
OverwriteMode overwrite_mode);
+ // Emits code sequence that jumps to deferred code if the input
+ // is not a smi. Cannot be in MacroAssembler because it takes
+ // advantage of TypeInfo to skip unneeded checks.
+ void JumpIfNotSmiUsingTypeInfo(Register reg,
+ TypeInfo type,
+ DeferredCode* deferred);
+
// Emits code sequence that jumps to deferred code if the inputs
// are not both smis. Cannot be in MacroAssembler because it takes
// advantage of TypeInfo to skip unneeded checks.