Commit 8d4e0bb3 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

ARM: Add support for and, or and xor to the type recording binary op stub.

Review URL: http://codereview.chromium.org/6250126

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6631 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b254d727
This diff is collapsed.
...@@ -1110,7 +1110,7 @@ void DeferredInlineSmiOperation::GenerateNonSmiInput() { ...@@ -1110,7 +1110,7 @@ void DeferredInlineSmiOperation::GenerateNonSmiInput() {
Register int32 = r2; Register int32 = r2;
// Not a 32bits signed int, fall back to the GenericBinaryOpStub. // Not a 32bits signed int, fall back to the GenericBinaryOpStub.
__ ConvertToInt32(tos_register_, int32, r4, r5, entry_label()); __ ConvertToInt32(tos_register_, int32, r4, r5, d0, entry_label());
// tos_register_ (r0 or r1): Original heap number. // tos_register_ (r0 or r1): Original heap number.
// int32: signed 32bits int. // int32: signed 32bits int.
......
...@@ -1554,7 +1554,10 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op, ...@@ -1554,7 +1554,10 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op,
op == Token::SUB || op == Token::SUB ||
op == Token::MUL || op == Token::MUL ||
op == Token::DIV || op == Token::DIV ||
op == Token::MOD) { op == Token::MOD ||
op == Token::BIT_OR ||
op == Token::BIT_AND ||
op == Token::BIT_XOR) {
TypeRecordingBinaryOpStub stub(op, mode); TypeRecordingBinaryOpStub stub(op, mode);
__ CallStub(&stub); __ CallStub(&stub);
} else { } else {
......
...@@ -158,6 +158,9 @@ const char* LArithmeticT::Mnemonic() const { ...@@ -158,6 +158,9 @@ const char* LArithmeticT::Mnemonic() const {
case Token::MUL: return "mul-t"; case Token::MUL: return "mul-t";
case Token::MOD: return "mod-t"; case Token::MOD: return "mod-t";
case Token::DIV: return "div-t"; case Token::DIV: return "div-t";
case Token::BIT_AND: return "bit-and-t";
case Token::BIT_OR: return "bit-or-t";
case Token::BIT_XOR: return "bit-xor-t";
default: default:
UNREACHABLE(); UNREACHABLE();
return NULL; return NULL;
...@@ -750,13 +753,23 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { ...@@ -750,13 +753,23 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
LInstruction* LChunkBuilder::DoBit(Token::Value op, LInstruction* LChunkBuilder::DoBit(Token::Value op,
HBitwiseBinaryOperation* instr) { HBitwiseBinaryOperation* instr) {
ASSERT(instr->representation().IsInteger32()); if (instr->representation().IsInteger32()) {
ASSERT(instr->left()->representation().IsInteger32()); ASSERT(instr->left()->representation().IsInteger32());
ASSERT(instr->right()->representation().IsInteger32()); ASSERT(instr->right()->representation().IsInteger32());
LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
return DefineSameAsFirst(new LBitI(op, left, right)); return DefineSameAsFirst(new LBitI(op, left, right));
} else {
ASSERT(instr->representation().IsTagged());
ASSERT(instr->left()->representation().IsTagged());
ASSERT(instr->right()->representation().IsTagged());
LOperand* left = UseFixed(instr->left(), r1);
LOperand* right = UseFixed(instr->right(), r0);
LArithmeticT* result = new LArithmeticT(op, left, right);
return MarkAsCall(DefineFixed(result, r0), instr);
}
} }
......
...@@ -1577,13 +1577,14 @@ void MacroAssembler::ConvertToInt32(Register source, ...@@ -1577,13 +1577,14 @@ void MacroAssembler::ConvertToInt32(Register source,
Register dest, Register dest,
Register scratch, Register scratch,
Register scratch2, Register scratch2,
DwVfpRegister double_scratch,
Label *not_int32) { Label *not_int32) {
if (CpuFeatures::IsSupported(VFP3)) { if (CpuFeatures::IsSupported(VFP3)) {
CpuFeatures::Scope scope(VFP3); CpuFeatures::Scope scope(VFP3);
sub(scratch, source, Operand(kHeapObjectTag)); sub(scratch, source, Operand(kHeapObjectTag));
vldr(d0, scratch, HeapNumber::kValueOffset); vldr(double_scratch, scratch, HeapNumber::kValueOffset);
vcvt_s32_f64(s0, d0); vcvt_s32_f64(double_scratch.low(), double_scratch);
vmov(dest, s0); vmov(dest, double_scratch.low());
// Signed vcvt instruction will saturate to the minimum (0x80000000) or // Signed vcvt instruction will saturate to the minimum (0x80000000) or
// maximun (0x7fffffff) signed 32bits integer when the double is out of // maximun (0x7fffffff) signed 32bits integer when the double is out of
// range. When substracting one, the minimum signed integer becomes the // range. When substracting one, the minimum signed integer becomes the
...@@ -1999,6 +2000,16 @@ void MacroAssembler::AbortIfNotSmi(Register object) { ...@@ -1999,6 +2000,16 @@ void MacroAssembler::AbortIfNotSmi(Register object) {
} }
void MacroAssembler::AbortIfNotRootValue(Register src,
Heap::RootListIndex root_value_index,
const char* message) {
ASSERT(!src.is(ip));
LoadRoot(ip, root_value_index);
cmp(src, ip);
Assert(eq, message);
}
void MacroAssembler::JumpIfNotHeapNumber(Register object, void MacroAssembler::JumpIfNotHeapNumber(Register object,
Register heap_number_map, Register heap_number_map,
Register scratch, Register scratch,
......
...@@ -589,11 +589,13 @@ class MacroAssembler: public Assembler { ...@@ -589,11 +589,13 @@ class MacroAssembler: public Assembler {
// Convert the HeapNumber pointed to by source to a 32bits signed integer // Convert the HeapNumber pointed to by source to a 32bits signed integer
// dest. If the HeapNumber does not fit into a 32bits signed integer branch // dest. If the HeapNumber does not fit into a 32bits signed integer branch
// to not_int32 label. // to not_int32 label. If VFP3 is available double_scratch is used but not
// scratch2.
void ConvertToInt32(Register source, void ConvertToInt32(Register source,
Register dest, Register dest,
Register scratch, Register scratch,
Register scratch2, Register scratch2,
DwVfpRegister double_scratch,
Label *not_int32); Label *not_int32);
// Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz // Count leading zeros in a 32 bit word. On ARM5 and later it uses the clz
...@@ -763,6 +765,11 @@ class MacroAssembler: public Assembler { ...@@ -763,6 +765,11 @@ class MacroAssembler: public Assembler {
void AbortIfSmi(Register object); void AbortIfSmi(Register object);
void AbortIfNotSmi(Register object); void AbortIfNotSmi(Register object);
// Abort execution if argument is not the root value with the given index.
void AbortIfNotRootValue(Register src,
Heap::RootListIndex root_value_index,
const char* message);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// HeapNumber utilities // HeapNumber utilities
......
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