Commit 488a0be3 authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Remove unused LoadNumber* from macro assembler.

Port r17748 (595bed6)

BUG=
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/70233011

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17760 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 166799c2
......@@ -4512,116 +4512,6 @@ void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
}
void MacroAssembler::LoadNumber(Register object,
FPURegister dst,
Register heap_number_map,
Register scratch,
Label* not_number) {
Label is_smi, done;
UntagAndJumpIfSmi(scratch, object, &is_smi);
JumpIfNotHeapNumber(object, heap_number_map, scratch, not_number);
ldc1(dst, FieldMemOperand(object, HeapNumber::kValueOffset));
Branch(&done);
bind(&is_smi);
mtc1(scratch, dst);
cvt_d_w(dst, dst);
bind(&done);
}
void MacroAssembler::LoadNumberAsInt32Double(Register object,
DoubleRegister double_dst,
Register heap_number_map,
Register scratch1,
Register scratch2,
FPURegister double_scratch,
Label* not_int32) {
ASSERT(!scratch1.is(object) && !scratch2.is(object));
ASSERT(!scratch1.is(scratch2));
ASSERT(!heap_number_map.is(object) &&
!heap_number_map.is(scratch1) &&
!heap_number_map.is(scratch2));
Label done, obj_is_not_smi;
UntagAndJumpIfNotSmi(scratch1, object, &obj_is_not_smi);
mtc1(scratch1, double_scratch);
cvt_d_w(double_dst, double_scratch);
Branch(&done);
bind(&obj_is_not_smi);
JumpIfNotHeapNumber(object, heap_number_map, scratch1, not_int32);
// Load the number.
// Load the double value.
ldc1(double_dst, FieldMemOperand(object, HeapNumber::kValueOffset));
Register except_flag = scratch2;
EmitFPUTruncate(kRoundToZero,
scratch1,
double_dst,
at,
double_scratch,
except_flag,
kCheckForInexactConversion);
// Jump to not_int32 if the operation did not succeed.
Branch(not_int32, ne, except_flag, Operand(zero_reg));
bind(&done);
}
void MacroAssembler::LoadNumberAsInt32(Register object,
Register dst,
Register heap_number_map,
Register scratch1,
Register scratch2,
FPURegister double_scratch0,
FPURegister double_scratch1,
Label* not_int32) {
ASSERT(!dst.is(object));
ASSERT(!scratch1.is(object) && !scratch2.is(object));
ASSERT(!scratch1.is(scratch2));
Label done, maybe_undefined;
UntagAndJumpIfSmi(dst, object, &done);
JumpIfNotHeapNumber(object, heap_number_map, scratch1, &maybe_undefined);
// Object is a heap number.
// Convert the floating point value to a 32-bit integer.
// Load the double value.
ldc1(double_scratch0, FieldMemOperand(object, HeapNumber::kValueOffset));
Register except_flag = scratch2;
EmitFPUTruncate(kRoundToZero,
dst,
double_scratch0,
scratch1,
double_scratch1,
except_flag,
kCheckForInexactConversion);
// Jump to not_int32 if the operation did not succeed.
Branch(not_int32, ne, except_flag, Operand(zero_reg));
Branch(&done);
bind(&maybe_undefined);
LoadRoot(at, Heap::kUndefinedValueRootIndex);
Branch(not_int32, ne, object, Operand(at));
// |undefined| is truncated to 0.
li(dst, Operand(Smi::FromInt(0)));
// Fall through.
bind(&done);
}
void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
if (frame_mode == BUILD_STUB_FRAME) {
Push(ra, fp, cp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment