OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
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 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2465 InstanceofStub stub(flags); | 2465 InstanceofStub stub(flags); |
2466 | 2466 |
2467 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 2467 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
2468 | 2468 |
2469 // Get the temp register reserved by the instruction. This needs to be r4 as | 2469 // Get the temp register reserved by the instruction. This needs to be r4 as |
2470 // its slot of the pushing of safepoint registers is used to communicate the | 2470 // its slot of the pushing of safepoint registers is used to communicate the |
2471 // offset to the location of the map check. | 2471 // offset to the location of the map check. |
2472 Register temp = ToRegister(instr->TempAt(0)); | 2472 Register temp = ToRegister(instr->TempAt(0)); |
2473 ASSERT(temp.is(r4)); | 2473 ASSERT(temp.is(r4)); |
2474 __ LoadHeapObject(InstanceofStub::right(), instr->function()); | 2474 __ LoadHeapObject(InstanceofStub::right(), instr->function()); |
2475 static const int kAdditionalDelta = 4; | 2475 static const int kAdditionalDelta = 5; |
2476 int delta = masm_->InstructionsGeneratedSince(map_check) + kAdditionalDelta; | 2476 int delta = masm_->InstructionsGeneratedSince(map_check) + kAdditionalDelta; |
2477 Label before_push_delta; | 2477 Label before_push_delta; |
2478 __ bind(&before_push_delta); | 2478 __ bind(&before_push_delta); |
2479 __ BlockConstPoolFor(kAdditionalDelta); | 2479 __ BlockConstPoolFor(kAdditionalDelta); |
2480 __ mov(temp, Operand(delta * kPointerSize)); | 2480 __ mov(temp, Operand(delta * kPointerSize)); |
| 2481 // The mov above can generate one or two instructions. The delta was computed |
| 2482 // for two instructions, so we need to pad here in case of one instruction. |
| 2483 if (masm_->InstructionsGeneratedSince(&before_push_delta) != 2) { |
| 2484 ASSERT_EQ(1, masm_->InstructionsGeneratedSince(&before_push_delta)); |
| 2485 __ nop(); |
| 2486 } |
2481 __ StoreToSafepointRegisterSlot(temp, temp); | 2487 __ StoreToSafepointRegisterSlot(temp, temp); |
2482 CallCodeGeneric(stub.GetCode(), | 2488 CallCodeGeneric(stub.GetCode(), |
2483 RelocInfo::CODE_TARGET, | 2489 RelocInfo::CODE_TARGET, |
2484 instr, | 2490 instr, |
2485 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | 2491 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
2486 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); | 2492 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); |
2487 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 2493 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
2488 // Put the result value into the result register slot and | 2494 // Put the result value into the result register slot and |
2489 // restore all registers. | 2495 // restore all registers. |
2490 __ StoreToSafepointRegisterSlot(result, result); | 2496 __ StoreToSafepointRegisterSlot(result, result); |
(...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5618 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5624 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5619 __ ldr(result, FieldMemOperand(scratch, | 5625 __ ldr(result, FieldMemOperand(scratch, |
5620 FixedArray::kHeaderSize - kPointerSize)); | 5626 FixedArray::kHeaderSize - kPointerSize)); |
5621 __ bind(&done); | 5627 __ bind(&done); |
5622 } | 5628 } |
5623 | 5629 |
5624 | 5630 |
5625 #undef __ | 5631 #undef __ |
5626 | 5632 |
5627 } } // namespace v8::internal | 5633 } } // namespace v8::internal |
OLD | NEW |