| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 2923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2934 flags = static_cast<InstanceofStub::Flags>( | 2934 flags = static_cast<InstanceofStub::Flags>( |
| 2935 flags | InstanceofStub::kCallSiteInlineCheck); | 2935 flags | InstanceofStub::kCallSiteInlineCheck); |
| 2936 flags = static_cast<InstanceofStub::Flags>( | 2936 flags = static_cast<InstanceofStub::Flags>( |
| 2937 flags | InstanceofStub::kReturnTrueFalseObject); | 2937 flags | InstanceofStub::kReturnTrueFalseObject); |
| 2938 InstanceofStub stub(isolate(), flags); | 2938 InstanceofStub stub(isolate(), flags); |
| 2939 | 2939 |
| 2940 PushSafepointRegistersScope scope(this); | 2940 PushSafepointRegistersScope scope(this); |
| 2941 LoadContextFromDeferred(instr->context()); | 2941 LoadContextFromDeferred(instr->context()); |
| 2942 | 2942 |
| 2943 __ Move(InstanceofStub::right(), instr->function()); | 2943 __ Move(InstanceofStub::right(), instr->function()); |
| 2944 // Include instructions below in delta: mov + call = mov + (mov + 2) | |
| 2945 static const int kAdditionalDelta = 2 * Assembler::kMovInstructions + 2; | |
| 2946 int delta = masm_->InstructionsGeneratedSince(map_check) + kAdditionalDelta; | |
| 2947 { | 2944 { |
| 2948 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2945 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 2949 if (Assembler::kMovInstructions != 1 && | 2946 Handle<Code> code = stub.GetCode(); |
| 2950 is_int16(delta * Instruction::kInstrSize)) { | 2947 // Include instructions below in delta: bitwise_mov32 + call |
| 2951 // The following mov will be an li rather than a multi-instruction form | 2948 int delta = (masm_->InstructionsGeneratedSince(map_check) + 2) * |
| 2952 delta -= Assembler::kMovInstructions - 1; | 2949 Instruction::kInstrSize + |
| 2950 masm_->CallSize(code); |
| 2951 // r8 is used to communicate the offset to the location of the map check. |
| 2952 if (is_int16(delta)) { |
| 2953 delta -= Instruction::kInstrSize; |
| 2954 __ li(r8, Operand(delta)); |
| 2955 } else { |
| 2956 __ bitwise_mov32(r8, delta); |
| 2953 } | 2957 } |
| 2954 // r8 is used to communicate the offset to the location of the map check. | 2958 CallCodeGeneric(code, RelocInfo::CODE_TARGET, instr, |
| 2955 __ mov(r8, Operand(delta * Instruction::kInstrSize)); | 2959 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
| 2960 DCHECK(delta / Instruction::kInstrSize == |
| 2961 masm_->InstructionsGeneratedSince(map_check)); |
| 2956 } | 2962 } |
| 2957 CallCodeGeneric(stub.GetCode(), RelocInfo::CODE_TARGET, instr, | |
| 2958 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | |
| 2959 DCHECK(delta == masm_->InstructionsGeneratedSince(map_check)); | |
| 2960 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); | 2963 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); |
| 2961 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 2964 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 2962 // Put the result value (r3) into the result register slot and | 2965 // Put the result value (r3) into the result register slot and |
| 2963 // restore all registers. | 2966 // restore all registers. |
| 2964 __ StoreToSafepointRegisterSlot(r3, ToRegister(instr->result())); | 2967 __ StoreToSafepointRegisterSlot(r3, ToRegister(instr->result())); |
| 2965 } | 2968 } |
| 2966 | 2969 |
| 2967 | 2970 |
| 2968 void LCodeGen::DoCmpT(LCmpT* instr) { | 2971 void LCodeGen::DoCmpT(LCmpT* instr) { |
| 2969 DCHECK(ToRegister(instr->context()).is(cp)); | 2972 DCHECK(ToRegister(instr->context()).is(cp)); |
| (...skipping 3262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6232 __ Push(scope_info); | 6235 __ Push(scope_info); |
| 6233 __ push(ToRegister(instr->function())); | 6236 __ push(ToRegister(instr->function())); |
| 6234 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6237 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6235 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6238 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6236 } | 6239 } |
| 6237 | 6240 |
| 6238 | 6241 |
| 6239 #undef __ | 6242 #undef __ |
| 6240 } | 6243 } |
| 6241 } // namespace v8::internal | 6244 } // namespace v8::internal |
| OLD | NEW |