| 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 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 } | 2040 } |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 | 2043 |
| 2044 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2044 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
| 2045 DCHECK(ToRegister(instr->context()).is(cp)); | 2045 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2046 DCHECK(ToRegister(instr->left()).is(a1)); | 2046 DCHECK(ToRegister(instr->left()).is(a1)); |
| 2047 DCHECK(ToRegister(instr->right()).is(a0)); | 2047 DCHECK(ToRegister(instr->right()).is(a0)); |
| 2048 DCHECK(ToRegister(instr->result()).is(v0)); | 2048 DCHECK(ToRegister(instr->result()).is(v0)); |
| 2049 | 2049 |
| 2050 Handle<Code> code = CodeFactory::BinaryOpIC( | 2050 Handle<Code> code = |
| 2051 isolate(), instr->op(), instr->language_mode()).code(); | 2051 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); |
| 2052 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2052 CallCode(code, RelocInfo::CODE_TARGET, instr); |
| 2053 // Other arch use a nop here, to signal that there is no inlined | 2053 // Other arch use a nop here, to signal that there is no inlined |
| 2054 // patchable code. Mips does not need the nop, since our marker | 2054 // patchable code. Mips does not need the nop, since our marker |
| 2055 // instruction (andi zero_reg) will never be used in normal code. | 2055 // instruction (andi zero_reg) will never be used in normal code. |
| 2056 } | 2056 } |
| 2057 | 2057 |
| 2058 | 2058 |
| 2059 template<class InstrType> | 2059 template<class InstrType> |
| 2060 void LCodeGen::EmitBranch(InstrType instr, | 2060 void LCodeGen::EmitBranch(InstrType instr, |
| 2061 Condition condition, | 2061 Condition condition, |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2523 UNREACHABLE(); | 2523 UNREACHABLE(); |
| 2524 return kNoCondition; | 2524 return kNoCondition; |
| 2525 } | 2525 } |
| 2526 } | 2526 } |
| 2527 | 2527 |
| 2528 | 2528 |
| 2529 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2529 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
| 2530 DCHECK(ToRegister(instr->context()).is(cp)); | 2530 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2531 Token::Value op = instr->op(); | 2531 Token::Value op = instr->op(); |
| 2532 | 2532 |
| 2533 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op, SLOPPY).code(); | 2533 Handle<Code> ic = |
| 2534 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); |
| 2534 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2535 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2535 | 2536 |
| 2536 Condition condition = ComputeCompareCondition(op); | 2537 Condition condition = ComputeCompareCondition(op); |
| 2537 | 2538 |
| 2538 EmitBranch(instr, condition, v0, Operand(zero_reg)); | 2539 EmitBranch(instr, condition, v0, Operand(zero_reg)); |
| 2539 } | 2540 } |
| 2540 | 2541 |
| 2541 | 2542 |
| 2542 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { | 2543 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
| 2543 InstanceType from = instr->from(); | 2544 InstanceType from = instr->from(); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2826 // restore all registers. | 2827 // restore all registers. |
| 2827 __ StoreToSafepointRegisterSlot(result, result); | 2828 __ StoreToSafepointRegisterSlot(result, result); |
| 2828 } | 2829 } |
| 2829 | 2830 |
| 2830 | 2831 |
| 2831 void LCodeGen::DoCmpT(LCmpT* instr) { | 2832 void LCodeGen::DoCmpT(LCmpT* instr) { |
| 2832 DCHECK(ToRegister(instr->context()).is(cp)); | 2833 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2833 Token::Value op = instr->op(); | 2834 Token::Value op = instr->op(); |
| 2834 | 2835 |
| 2835 Handle<Code> ic = | 2836 Handle<Code> ic = |
| 2836 CodeFactory::CompareIC(isolate(), op, instr->language_mode()).code(); | 2837 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); |
| 2837 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2838 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2838 // On MIPS there is no need for a "no inlined smi code" marker (nop). | 2839 // On MIPS there is no need for a "no inlined smi code" marker (nop). |
| 2839 | 2840 |
| 2840 Condition condition = ComputeCompareCondition(op); | 2841 Condition condition = ComputeCompareCondition(op); |
| 2841 // A minor optimization that relies on LoadRoot always emitting one | 2842 // A minor optimization that relies on LoadRoot always emitting one |
| 2842 // instruction. | 2843 // instruction. |
| 2843 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm()); | 2844 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm()); |
| 2844 Label done, check; | 2845 Label done, check; |
| 2845 __ Branch(USE_DELAY_SLOT, &done, condition, v0, Operand(zero_reg)); | 2846 __ Branch(USE_DELAY_SLOT, &done, condition, v0, Operand(zero_reg)); |
| 2846 __ bind(&check); | 2847 __ bind(&check); |
| (...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6056 __ Push(at, ToRegister(instr->function())); | 6057 __ Push(at, ToRegister(instr->function())); |
| 6057 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6058 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6058 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6059 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6059 } | 6060 } |
| 6060 | 6061 |
| 6061 | 6062 |
| 6062 #undef __ | 6063 #undef __ |
| 6063 | 6064 |
| 6064 } // namespace internal | 6065 } // namespace internal |
| 6065 } // namespace v8 | 6066 } // namespace v8 |
| OLD | NEW |