__ Addu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag));
// Return result. The argument function info has been popped already.
+ __ Ret(USE_DELAY_SLOT);
__ sw(a3, FieldMemOperand(v0, JSFunction::kCodeEntryOffset));
- __ Ret();
__ bind(&check_optimized);
__ sw(scratch_, FieldMemOperand(the_heap_number_,
HeapNumber::kExponentOffset));
__ sll(scratch_, the_int_, 32 - shift_distance);
+ __ Ret(USE_DELAY_SLOT);
__ sw(scratch_, FieldMemOperand(the_heap_number_,
HeapNumber::kMantissaOffset));
- __ Ret();
__ bind(&max_negative_int);
// The max negative int32 is stored as a positive number in the mantissa of
__ sw(scratch_,
FieldMemOperand(the_heap_number_, HeapNumber::kExponentOffset));
__ mov(scratch_, zero_reg);
+ __ Ret(USE_DELAY_SLOT);
__ sw(scratch_,
FieldMemOperand(the_heap_number_, HeapNumber::kMantissaOffset));
- __ Ret();
}
__ Branch(&return_equal, ne, t4, Operand(ODDBALL_TYPE));
__ LoadRoot(t2, Heap::kUndefinedValueRootIndex);
__ Branch(&return_equal, ne, a0, Operand(t2));
+ ASSERT(is_int16(GREATER) && is_int16(LESS));
+ __ Ret(USE_DELAY_SLOT);
if (cc == le) {
// undefined <= undefined should fail.
__ li(v0, Operand(GREATER));
// undefined >= undefined should fail.
__ li(v0, Operand(LESS));
}
- __ Ret();
}
}
}
__ bind(&return_equal);
-
+ ASSERT(is_int16(GREATER) && is_int16(LESS));
+ __ Ret(USE_DELAY_SLOT);
if (cc == less) {
__ li(v0, Operand(GREATER)); // Things aren't less than themselves.
} else if (cc == greater) {
} else {
__ mov(v0, zero_reg); // Things are <=, >=, ==, === themselves.
}
- __ Ret();
// For less and greater we don't have to check for NaN since the result of
// x < x is false regardless. For the others here is some code to check
if (cc != eq) {
// All-zero means Infinity means equal.
__ Ret(eq, v0, Operand(zero_reg));
+ ASSERT(is_int16(GREATER) && is_int16(LESS));
+ __ Ret(USE_DELAY_SLOT);
if (cc == le) {
__ li(v0, Operand(GREATER)); // NaN <= NaN should fail.
} else {
__ li(v0, Operand(LESS)); // NaN >= NaN should fail.
}
}
- __ Ret();
}
// No fall through here.
__ bind(&nan);
// NaN comparisons always fail.
// Load whatever we need in v0 to make the comparison fail.
+ ASSERT(is_int16(GREATER) && is_int16(LESS));
+ __ Ret(USE_DELAY_SLOT);
if (cc == lt || cc == le) {
__ li(v0, Operand(GREATER));
} else {
__ li(v0, Operand(LESS));
}
- __ Ret();
+
__ bind(¬_smis);
// At this point we know we are dealing with two different objects,
if (mode_ == UNARY_OVERWRITE) {
__ lw(a2, FieldMemOperand(a0, HeapNumber::kExponentOffset));
__ Xor(a2, a2, Operand(HeapNumber::kSignMask)); // Flip sign.
+ __ Ret(USE_DELAY_SLOT);
__ sw(a2, FieldMemOperand(a0, HeapNumber::kExponentOffset));
} else {
Label slow_allocate_heapnumber, heapnumber_allocated;
__ sw(a3, FieldMemOperand(a1, HeapNumber::kMantissaOffset));
__ Xor(a2, a2, Operand(HeapNumber::kSignMask)); // Flip sign.
__ sw(a2, FieldMemOperand(a1, HeapNumber::kExponentOffset));
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, a1);
}
- __ Ret();
}
__ Branch(&try_float, lt, a2, Operand(zero_reg));
// Tag the result as a smi and we're done.
+ __ Ret(USE_DELAY_SLOT); // SmiTag emits one instruction in delay slot.
__ SmiTag(v0, a1);
- __ Ret();
// Try to store the result in a heap number.
__ bind(&try_float);
// Check that the signed result fits in a Smi.
__ Addu(scratch2, scratch1, Operand(0x40000000));
__ Branch(¬_smi_result, lt, scratch2, Operand(zero_reg));
+ __ Ret(USE_DELAY_SLOT); // SmiTag emits one instruction in delay slot.
__ SmiTag(v0, scratch1);
- __ Ret();
}
break;
case Token::MOD: {
// Check that the signed result fits in a Smi.
__ Addu(scratch1, scratch2, Operand(0x40000000));
__ Branch(¬_smi_result, lt, scratch1, Operand(zero_reg));
+ __ Ret(USE_DELAY_SLOT); // SmiTag emits one instruction in delay slot.
__ SmiTag(v0, scratch2);
- __ Ret();
}
break;
case Token::BIT_OR:
__ And(scratch1, v0, Operand(0xc0000000));
__ Branch(¬_smi_result, ne, scratch1, Operand(zero_reg));
// Smi tag result.
+ __ Ret(USE_DELAY_SLOT); // SmiTag emits one instruction in delay slot.
__ SmiTag(v0);
- __ Ret();
break;
case Token::SHL:
// Remove tags from operands.
// Check that the signed result fits in a Smi.
__ Addu(scratch2, scratch1, Operand(0x40000000));
__ Branch(¬_smi_result, lt, scratch2, Operand(zero_reg));
- __ SmiTag(v0, scratch1);
- __ Ret();
+ __ Ret(USE_DELAY_SLOT);
+ __ SmiTag(v0, scratch1); // SmiTag emits one instruction in delay slot.
break;
default:
UNREACHABLE();
// Check that the *signed* result fits in a smi.
__ Addu(a3, a2, Operand(0x40000000));
__ Branch(&result_not_a_smi, lt, a3, Operand(zero_reg));
+ __ Ret(USE_DELAY_SLOT); // SmiTag emits one instruction in delay slot.
__ SmiTag(v0, a2);
- __ Ret();
// Allocate new heap number for result.
__ bind(&result_not_a_smi);
__ bind(¬_zero);
// Tag the result and return.
- __ SmiTag(v0, scratch1);
- __ Ret();
+ __ Ret(USE_DELAY_SLOT);
+ __ SmiTag(v0, scratch1); // SmiTag emits one instruction.
} else {
// DIV just falls through to allocating a heap number.
}
scratch2,
&call_runtime,
mode_);
+ __ sdc1(f10,
+ FieldMemOperand(heap_number_result, HeapNumber::kValueOffset));
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, heap_number_result);
- __ sdc1(f10, FieldMemOperand(v0, HeapNumber::kValueOffset));
- __ Ret();
// A DIV operation expecting an integer result falls through
// to type transition.
// If not try to return a heap number. (We know the result is an int32.)
__ Branch(&return_heap_number, lt, scratch1, Operand(zero_reg));
// Tag the result and return.
+ __ Ret(USE_DELAY_SLOT); // SmiTag emits one instruction in delay slot.
__ SmiTag(v0, a2);
- __ Ret();
__ bind(&return_heap_number);
heap_number_result = t1;
}
// Store the result.
+ __ sdc1(double_scratch,
+ FieldMemOperand(heap_number_result, HeapNumber::kValueOffset));
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, heap_number_result);
- __ sdc1(double_scratch, FieldMemOperand(v0, HeapNumber::kValueOffset));
- __ Ret();
break;
}
__ subu(a3, a0, a1);
__ sll(t3, a3, kPointerSizeLog2 - kSmiTagSize);
__ Addu(a3, fp, Operand(t3));
+ __ Ret(USE_DELAY_SLOT);
__ lw(v0, MemOperand(a3, kDisplacement));
- __ Ret();
// Arguments adaptor case: Check index (a1) against actual arguments
// limit found in the arguments adaptor frame. Use unsigned
__ subu(a3, a0, a1);
__ sll(t3, a3, kPointerSizeLog2 - kSmiTagSize);
__ Addu(a3, a2, Operand(t3));
+ __ Ret(USE_DELAY_SLOT);
__ lw(v0, MemOperand(a3, kDisplacement));
- __ Ret();
// Slow-case: Handle non-smi or out-of-bounds access to arguments
// by calling the runtime system.
__ lw(scratch2, FieldMemOperand(right, String::kLengthOffset));
__ Branch(&check_zero_length, eq, length, Operand(scratch2));
__ bind(&strings_not_equal);
+ ASSERT(is_int16(NOT_EQUAL));
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(Smi::FromInt(NOT_EQUAL)));
- __ Ret();
// Check if the length is zero.
Label compare_chars;
__ bind(&check_zero_length);
STATIC_ASSERT(kSmiTag == 0);
__ Branch(&compare_chars, ne, length, Operand(zero_reg));
+ ASSERT(is_int16(EQUAL));
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(Smi::FromInt(EQUAL)));
- __ Ret();
// Compare characters.
__ bind(&compare_chars);
&strings_not_equal);
// Characters are equal.
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(Smi::FromInt(EQUAL)));
- __ Ret();
}
if (GetCondition() == eq) {
// For equality we do not care about the sign of the result.
+ __ Ret(USE_DELAY_SLOT);
__ Subu(v0, a0, a1);
} else {
// Untag before subtracting to avoid handling overflow.
__ SmiUntag(a1);
__ SmiUntag(a0);
+ __ Ret(USE_DELAY_SLOT);
__ Subu(v0, a1, a0);
}
- __ Ret();
__ bind(&miss);
GenerateMiss(masm);
__ BranchF(&fpu_lt, NULL, lt, f0, f2);
// Otherwise it's greater, so just fall thru, and return.
+ ASSERT(is_int16(GREATER) && is_int16(EQUAL) && is_int16(LESS));
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(GREATER));
- __ Ret();
__ bind(&fpu_eq);
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(EQUAL));
- __ Ret();
__ bind(&fpu_lt);
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(LESS));
- __ Ret();
__ bind(&unordered);
__ bind(&generic_stub);
__ mov(v0, right);
// Internalized strings are compared by identity.
__ Ret(ne, left, Operand(right));
+ ASSERT(is_int16(EQUAL));
+ __ Ret(USE_DELAY_SLOT);
__ li(v0, Operand(Smi::FromInt(EQUAL)));
- __ Ret();
__ bind(&miss);
GenerateMiss(masm);
}
masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
__ sll(a1, a1, kPointerSizeLog2);
+ __ Ret(USE_DELAY_SLOT);
__ Addu(sp, sp, a1);
- __ Ret();
}
__ Branch(miss_label, ne, scratch, Operand(JS_ARRAY_TYPE));
// Load length directly from the JS array.
+ __ Ret(USE_DELAY_SLOT);
__ lw(v0, FieldMemOperand(receiver, JSArray::kLengthOffset));
- __ Ret();
}
support_wrappers ? &check_wrapper : miss);
// Load length directly from the string.
+ __ Ret(USE_DELAY_SLOT);
__ lw(v0, FieldMemOperand(receiver, String::kLengthOffset));
- __ Ret();
if (support_wrappers) {
// Check if the object is a JSValue wrapper.
// Unwrap the value and check if the wrapped value is a string.
__ lw(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset));
GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss);
+ __ Ret(USE_DELAY_SLOT);
__ lw(v0, FieldMemOperand(scratch1, String::kLengthOffset));
- __ Ret();
}
}
Register scratch2,
Label* miss_label) {
__ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, scratch1);
- __ Ret();
}
// Return the value (register v0).
ASSERT(value_reg.is(a0));
__ bind(&exit);
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, a0);
- __ Ret();
}
__ sdc1(f4, FieldMemOperand(scratch1, HeapNumber::kValueOffset));
// Return the value (register v0).
ASSERT(value_reg.is(a0));
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, a0);
- __ Ret();
return;
}
// Return the value (register v0).
ASSERT(value_reg.is(a0));
__ bind(&exit);
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, a0);
- __ Ret();
}
if (argc == 0) {
// Nothing to do, just return the length.
__ lw(v0, FieldMemOperand(receiver, JSArray::kLengthOffset));
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
} else {
Label call_builtin;
if (argc == 1) { // Otherwise fall through to call the builtin.
__ sw(t0, MemOperand(end_elements));
// Check for a smi.
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
__ bind(&check_double);
__ sw(a0, FieldMemOperand(receiver, JSArray::kLengthOffset));
// Check for a smi.
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
__ bind(&with_write_barrier);
kDontSaveFPRegs,
EMIT_REMEMBERED_SET,
OMIT_SMI_CHECK);
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
__ bind(&attempt_to_grow_elements);
// v0: array's length + 1.
__ sw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset));
// Elements are in new space, so write barrier is not required.
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
}
__ bind(&call_builtin);
__ TailCallExternalReference(
// Fill with the hole.
__ sw(t2, FieldMemOperand(elements, FixedArray::kHeaderSize));
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
__ bind(&return_undefined);
__ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
__ bind(&call_builtin);
__ TailCallExternalReference(
index_out_of_range_label,
STRING_INDEX_IS_NUMBER);
generator.GenerateFast(masm());
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
StubRuntimeCallHelper call_helper;
generator.GenerateSlow(masm(), call_helper);
if (index_out_of_range.is_linked()) {
__ bind(&index_out_of_range);
__ LoadRoot(v0, Heap::kNanValueRootIndex);
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
}
__ bind(&miss);
index_out_of_range_label,
STRING_INDEX_IS_NUMBER);
generator.GenerateFast(masm());
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
StubRuntimeCallHelper call_helper;
generator.GenerateSlow(masm(), call_helper);
if (index_out_of_range.is_linked()) {
__ bind(&index_out_of_range);
__ LoadRoot(v0, Heap::kempty_stringRootIndex);
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
}
__ bind(&miss);
StringCharFromCodeGenerator generator(code, v0);
generator.GenerateFast(masm());
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
StubRuntimeCallHelper call_helper;
generator.GenerateSlow(masm(), call_helper);
// If the argument is a smi, just return.
STATIC_ASSERT(kSmiTag == 0);
__ And(t0, v0, Operand(kSmiTagMask));
- __ Drop(argc + 1, eq, t0, Operand(zero_reg));
- __ Ret(eq, t0, Operand(zero_reg));
+ __ DropAndRet(argc + 1, eq, t0, Operand(zero_reg));
__ CheckMap(v0, a1, Heap::kHeapNumberMapRootIndex, &slow, DONT_DO_SMI_CHECK);
// Restore FCSR and return.
__ ctc1(a3, FCSR);
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
__ bind(&wont_fit_smi);
// Restore FCSR and fall to slow case.
__ Branch(&slow, lt, v0, Operand(zero_reg));
// Smi case done.
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
// Check if the argument is a heap number and load its exponent and
// sign.
Label negative_sign;
__ And(t0, a1, Operand(HeapNumber::kSignMask));
__ Branch(&negative_sign, ne, t0, Operand(zero_reg));
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
// If the argument is negative, clear the sign, and return a new
// number.
__ AllocateHeapNumber(v0, t0, t1, t2, &slow);
__ sw(a1, FieldMemOperand(v0, HeapNumber::kExponentOffset));
__ sw(a3, FieldMemOperand(v0, HeapNumber::kMantissaOffset));
- __ Drop(argc + 1);
- __ Ret();
+ __ DropAndRet(argc + 1);
// Tail call the full function. We do not have to patch the receiver
// because the function makes no use of it.
Counters* counters = isolate()->counters();
__ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3);
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, t0);
- __ Ret();
// Return the generated code.
return GetICCode(kind(), Code::NORMAL, name);
}
// Entry registers are intact, a0 holds the value which is the return value.
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, a0);
- __ Ret();
if (elements_kind != EXTERNAL_PIXEL_ELEMENTS) {
// a3: external array.
// Entry registers are intact, a0 holds the value
// which is the return value.
+ __ Ret(USE_DELAY_SLOT);
__ mov(v0, a0);
- __ Ret();
}
// Slow case, key and receiver still in a0 and a1.
// Increment the length of the array.
__ li(length_reg, Operand(Smi::FromInt(1)));
+ __ Ret(USE_DELAY_SLOT);
__ sw(length_reg, FieldMemOperand(receiver_reg, JSArray::kLengthOffset));
- __ Ret();
__ bind(&check_capacity);
// Check for cow elements, in general they are not handled by this stub
// Increment the length of the array.
__ li(length_reg, Operand(Smi::FromInt(1)));
__ sw(length_reg, FieldMemOperand(receiver_reg, JSArray::kLengthOffset));
+ __ Ret(USE_DELAY_SLOT);
__ lw(elements_reg,
FieldMemOperand(receiver_reg, JSObject::kElementsOffset));
- __ Ret();
__ bind(&check_capacity);
// Make sure that the backing store can hold additional elements.