__ cmpq(rax, Immediate(1));
__ j(not_equal, &argc_two_or_more);
__ movq(rdx, Operand(rsp, kPointerSize)); // Get the argument from the stack.
- __ JumpIfNotPositiveSmi(rdx, call_generic_code);
+ __ JumpUnlessNonNegativeSmi(rdx, call_generic_code);
// Handle construction of an empty array of a certain size. Bail out if size
// is to large to actually allocate an elements array.
Label result_longer_than_two;
__ movq(rcx, Operand(rsp, kToOffset));
__ movq(rdx, Operand(rsp, kFromOffset));
- __ JumpIfNotBothPositiveSmi(rcx, rdx, &runtime);
+ __ JumpUnlessBothNonNegativeSmi(rcx, rdx, &runtime);
__ SmiSub(rcx, rcx, rdx); // Overflow doesn't happen.
__ cmpq(FieldOperand(rax, String::kLengthOffset), rcx);
operand->reg(),
smi_value,
overwrite_mode);
- // Check for negative or non-Smi left hand side.
- __ JumpIfNotPositiveSmi(operand->reg(), deferred->entry_label());
+ __ JumpUnlessNonNegativeSmi(operand->reg(), deferred->entry_label());
if (int_value < 0) int_value = -int_value;
if (int_value == 1) {
__ Move(operand->reg(), Smi::FromInt(0));
Result value = frame_->Pop();
value.ToRegister();
ASSERT(value.is_valid());
- Condition positive_smi = masm_->CheckPositiveSmi(value.reg());
+ Condition non_negative_smi = masm_->CheckNonNegativeSmi(value.reg());
value.Unuse();
- destination()->Split(positive_smi);
+ destination()->Split(non_negative_smi);
}
deferred->Branch(not_equal);
// Check that both indices are smis.
- Condition both_smi = __ CheckBothSmi(index1.reg(), index2.reg());
+ Condition both_smi = masm()->CheckBothSmi(index1.reg(), index2.reg());
deferred->Branch(NegateCondition(both_smi));
// Bring addresses into index1 and index2.
}
// Check that the receiver is a heap object.
- Condition is_smi = __ CheckSmi(receiver.reg());
+ Condition is_smi = masm()->CheckSmi(receiver.reg());
slow.Branch(is_smi, &value, &receiver);
// This is the map check instruction that will be patched.
kScratchRegister);
deferred->Branch(not_equal);
- // Check that the key is a non-negative smi.
- __ JumpIfNotPositiveSmi(key.reg(), deferred->entry_label());
+ __ JumpUnlessNonNegativeSmi(key.reg(), deferred->entry_label());
// Get the elements array from the receiver.
__ movq(elements.reg(),
// Get the current entry of the array into register rbx.
__ movq(rbx, Operand(rsp, 2 * kPointerSize));
- SmiIndex index = __ SmiToIndex(rax, rax, kPointerSizeLog2);
+ SmiIndex index = masm()->SmiToIndex(rax, rax, kPointerSizeLog2);
__ movq(rbx, FieldOperand(rbx,
index.reg,
index.scale,
Label done, stub_call, smi_case;
__ pop(rdx);
__ movq(rcx, rax);
- Condition smi = __ CheckBothSmi(rdx, rax);
+ Condition smi = masm()->CheckBothSmi(rdx, rax);
__ j(smi, &smi_case);
__ bind(&stub_call);
context()->PrepareTest(&materialize_true, &materialize_false,
&if_true, &if_false, &fall_through);
- Condition positive_smi = __ CheckPositiveSmi(rax);
- Split(positive_smi, if_true, if_false, fall_through);
+ Condition non_negative_smi = masm()->CheckNonNegativeSmi(rax);
+ Split(non_negative_smi, if_true, if_false, fall_through);
context()->Plug(if_true, if_false);
}
// Check that the key is an array index, that is Uint32.
STATIC_ASSERT(kSmiValueSize <= 32);
- __ JumpIfNotPositiveSmi(rax, &slow);
+ __ JumpUnlessNonNegativeSmi(rax, &slow);
// Get the map of the receiver.
__ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
}
-Condition MacroAssembler::CheckPositiveSmi(Register src) {
+Condition MacroAssembler::CheckNonNegativeSmi(Register src) {
ASSERT_EQ(0, kSmiTag);
// Make mask 0x8000000000000001 and test that both bits are zero.
movq(kScratchRegister, src);
}
-Condition MacroAssembler::CheckBothPositiveSmi(Register first,
- Register second) {
+Condition MacroAssembler::CheckBothNonNegativeSmi(Register first,
+ Register second) {
if (first.is(second)) {
- return CheckPositiveSmi(first);
+ return CheckNonNegativeSmi(first);
}
movq(kScratchRegister, first);
or_(kScratchRegister, second);
rol(kScratchRegister, Immediate(1));
- testl(kScratchRegister, Immediate(0x03));
+ testl(kScratchRegister, Immediate(3));
return zero;
}
// Is the value a tagged smi.
Condition CheckSmi(Register src);
- // Is the value a positive tagged smi.
- Condition CheckPositiveSmi(Register src);
+ // Is the value a non-negative tagged smi.
+ Condition CheckNonNegativeSmi(Register src);
// Are both values tagged smis.
Condition CheckBothSmi(Register first, Register second);
- // Are both values tagged smis.
- Condition CheckBothPositiveSmi(Register first, Register second);
+ // Are both values non-negative tagged smis.
+ Condition CheckBothNonNegativeSmi(Register first, Register second);
// Are either value a tagged smi.
Condition CheckEitherSmi(Register first,
template <typename LabelType>
void JumpIfNotSmi(Register src, LabelType* on_not_smi);
- // Jump to label if the value is not a positive tagged smi.
+ // Jump to label if the value is not a non-negative tagged smi.
template <typename LabelType>
- void JumpIfNotPositiveSmi(Register src, LabelType* on_not_smi);
+ void JumpUnlessNonNegativeSmi(Register src, LabelType* on_not_smi);
// Jump to label if the value, which must be a tagged smi, has value equal
// to the constant.
Register src2,
LabelType* on_not_both_smi);
- // Jump if either or both register are not positive smi values.
+ // Jump if either or both register are not non-negative smi values.
template <typename LabelType>
- void JumpIfNotBothPositiveSmi(Register src1, Register src2,
- LabelType* on_not_both_smi);
+ void JumpUnlessBothNonNegativeSmi(Register src1, Register src2,
+ LabelType* on_not_both_smi);
// Operations on tagged smi values.
template <typename LabelType>
-void MacroAssembler::JumpIfNotPositiveSmi(Register src,
- LabelType* on_not_positive_smi) {
- Condition positive_smi = CheckPositiveSmi(src);
- j(NegateCondition(positive_smi), on_not_positive_smi);
+void MacroAssembler::JumpUnlessNonNegativeSmi(
+ Register src, LabelType* on_not_smi_or_negative) {
+ Condition non_negative_smi = CheckNonNegativeSmi(src);
+ j(NegateCondition(non_negative_smi), on_not_smi_or_negative);
}
template <typename LabelType>
-void MacroAssembler::JumpIfNotBothPositiveSmi(Register src1,
- Register src2,
- LabelType* on_not_both_smi) {
- Condition both_smi = CheckBothPositiveSmi(src1, src2);
+void MacroAssembler::JumpUnlessBothNonNegativeSmi(Register src1,
+ Register src2,
+ LabelType* on_not_both_smi) {
+ Condition both_smi = CheckBothNonNegativeSmi(src1, src2);
j(NegateCondition(both_smi), on_not_both_smi);
}
__ incq(rax);
__ movl(rcx, Immediate(0));
__ Integer32ToSmi(rcx, rcx);
- cond = masm->CheckPositiveSmi(rcx); // Zero counts as positive.
+ cond = masm->CheckNonNegativeSmi(rcx);
__ j(NegateCondition(cond), &exit);
__ incq(rax);
__ xor_(rcx, Immediate(kSmiTagMask));
- cond = masm->CheckPositiveSmi(rcx); // "zero" non-smi.
+ cond = masm->CheckNonNegativeSmi(rcx); // "zero" non-smi.
__ j(cond, &exit);
__ incq(rax);
__ movq(rcx, Immediate(-1));
__ Integer32ToSmi(rcx, rcx);
- cond = masm->CheckPositiveSmi(rcx); // Negative smis are not positive.
+ cond = masm->CheckNonNegativeSmi(rcx); // Negative smis are not positive.
__ j(cond, &exit);
__ incq(rax);
__ movq(rcx, Immediate(Smi::kMinValue));
__ Integer32ToSmi(rcx, rcx);
- cond = masm->CheckPositiveSmi(rcx); // Most negative smi is not positive.
+ cond = masm->CheckNonNegativeSmi(rcx); // Most negative smi is not positive.
__ j(cond, &exit);
__ incq(rax);
__ xor_(rcx, Immediate(kSmiTagMask));
- cond = masm->CheckPositiveSmi(rcx); // "Negative" non-smi.
+ cond = masm->CheckNonNegativeSmi(rcx); // "Negative" non-smi.
__ j(cond, &exit);
__ incq(rax);
__ movq(rcx, Immediate(Smi::kMaxValue));
__ Integer32ToSmi(rcx, rcx);
- cond = masm->CheckPositiveSmi(rcx); // Most positive smi is positive.
+ cond = masm->CheckNonNegativeSmi(rcx); // Most positive smi is positive.
__ j(NegateCondition(cond), &exit);
__ incq(rax);
__ xor_(rcx, Immediate(kSmiTagMask));
- cond = masm->CheckPositiveSmi(rcx); // "Positive" non-smi.
+ cond = masm->CheckNonNegativeSmi(rcx); // "Positive" non-smi.
__ j(cond, &exit);
// CheckIsMinSmi