OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 } | 1861 } |
1862 } | 1862 } |
1863 | 1863 |
1864 | 1864 |
1865 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 1865 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
1866 DCHECK(ToRegister(instr->context()).is(cp)); | 1866 DCHECK(ToRegister(instr->context()).is(cp)); |
1867 DCHECK(ToRegister(instr->left()).is(a1)); | 1867 DCHECK(ToRegister(instr->left()).is(a1)); |
1868 DCHECK(ToRegister(instr->right()).is(a0)); | 1868 DCHECK(ToRegister(instr->right()).is(a0)); |
1869 DCHECK(ToRegister(instr->result()).is(v0)); | 1869 DCHECK(ToRegister(instr->result()).is(v0)); |
1870 | 1870 |
1871 Handle<Code> code = | 1871 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), instr->op()).code(); |
1872 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); | |
1873 CallCode(code, RelocInfo::CODE_TARGET, instr); | 1872 CallCode(code, RelocInfo::CODE_TARGET, instr); |
1874 // Other arch use a nop here, to signal that there is no inlined | 1873 // Other arch use a nop here, to signal that there is no inlined |
1875 // patchable code. Mips does not need the nop, since our marker | 1874 // patchable code. Mips does not need the nop, since our marker |
1876 // instruction (andi zero_reg) will never be used in normal code. | 1875 // instruction (andi zero_reg) will never be used in normal code. |
1877 } | 1876 } |
1878 | 1877 |
1879 | 1878 |
1880 template<class InstrType> | 1879 template<class InstrType> |
1881 void LCodeGen::EmitBranch(InstrType instr, | 1880 void LCodeGen::EmitBranch(InstrType instr, |
1882 Condition condition, | 1881 Condition condition, |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2489 EmitFalseBranch(instr, eq, object_prototype, Operand(at)); | 2488 EmitFalseBranch(instr, eq, object_prototype, Operand(at)); |
2490 __ Branch(USE_DELAY_SLOT, &loop); | 2489 __ Branch(USE_DELAY_SLOT, &loop); |
2491 __ lw(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset)); | 2490 __ lw(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset)); |
2492 } | 2491 } |
2493 | 2492 |
2494 | 2493 |
2495 void LCodeGen::DoCmpT(LCmpT* instr) { | 2494 void LCodeGen::DoCmpT(LCmpT* instr) { |
2496 DCHECK(ToRegister(instr->context()).is(cp)); | 2495 DCHECK(ToRegister(instr->context()).is(cp)); |
2497 Token::Value op = instr->op(); | 2496 Token::Value op = instr->op(); |
2498 | 2497 |
2499 Handle<Code> ic = | 2498 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); |
2500 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); | |
2501 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2499 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2502 // On MIPS there is no need for a "no inlined smi code" marker (nop). | 2500 // On MIPS there is no need for a "no inlined smi code" marker (nop). |
2503 | 2501 |
2504 Condition condition = ComputeCompareCondition(op); | 2502 Condition condition = ComputeCompareCondition(op); |
2505 // A minor optimization that relies on LoadRoot always emitting one | 2503 // A minor optimization that relies on LoadRoot always emitting one |
2506 // instruction. | 2504 // instruction. |
2507 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm()); | 2505 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm()); |
2508 Label done, check; | 2506 Label done, check; |
2509 __ Branch(USE_DELAY_SLOT, &done, condition, v0, Operand(zero_reg)); | 2507 __ Branch(USE_DELAY_SLOT, &done, condition, v0, Operand(zero_reg)); |
2510 __ bind(&check); | 2508 __ bind(&check); |
(...skipping 3064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5575 __ Push(at, ToRegister(instr->function())); | 5573 __ Push(at, ToRegister(instr->function())); |
5576 CallRuntime(Runtime::kPushBlockContext, instr); | 5574 CallRuntime(Runtime::kPushBlockContext, instr); |
5577 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5575 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5578 } | 5576 } |
5579 | 5577 |
5580 | 5578 |
5581 #undef __ | 5579 #undef __ |
5582 | 5580 |
5583 } // namespace internal | 5581 } // namespace internal |
5584 } // namespace v8 | 5582 } // namespace v8 |
OLD | NEW |