29 code->InvalidateRelocation();
31 if (FLAG_zap_code_space) {
33 byte* pointer = code->FindCodeAgeSequence();
34 if (pointer !=
NULL) {
37 pointer = code->instruction_start();
39 CodePatcher patcher(pointer, 1);
40 patcher.masm()->int3();
42 DeoptimizationInputData* data =
43 DeoptimizationInputData::cast(code->deoptimization_data());
44 int osr_offset = data->OsrPcOffset()->value();
46 CodePatcher osr_patcher(code->instruction_start() + osr_offset, 1);
47 osr_patcher.masm()->int3();
57 Address instruction_start = code->instruction_start();
61 DeoptimizationInputData* deopt_data =
62 DeoptimizationInputData::cast(code->deoptimization_data());
66 for (
int i = 0;
i < deopt_data->DeoptCount();
i++) {
67 if (deopt_data->Pc(
i)->value() == -1)
continue;
69 Address call_address = instruction_start + deopt_data->Pc(
i)->value();
76 call_address >= prev_call_address +
patch_size());
79 prev_call_address = call_address;
106 FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
108 reinterpret_cast<intptr_t
>(descriptor->deoptimization_handler());
109 int params = descriptor->GetHandlerParameterCount();
110 output_frame->SetRegister(
rax.
code(), params);
111 output_frame->SetRegister(
rbx.
code(), handler);
118 output_frame->SetDoubleRegister(
i, double_value);
131 void Deoptimizer::EntryGenerator::Generate() {
139 __ subp(
rsp, Immediate(kDoubleRegsSize));
144 __ movsd(Operand(
rsp, offset), xmm_reg);
175 __ PrepareCallCFunction(6);
185 __ LoadAddress(arg5, ExternalReference::isolate_address(isolate()));
189 __ LoadAddress(
r9, ExternalReference::isolate_address(isolate()));
192 { AllowExternalCallThatCantCauseGC scope(masm());
193 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
202 __ PopQuad(Operand(
rbx, offset));
209 __ popq(Operand(
rbx, dst_offset));
224 Label pop_loop_header;
225 __ jmp(&pop_loop_header);
228 __ Pop(Operand(
rdx, 0));
229 __ addp(
rdx, Immediate(
sizeof(intptr_t)));
230 __ bind(&pop_loop_header);
236 __ PrepareCallCFunction(2);
238 __ LoadAddress(
arg_reg_2, ExternalReference::isolate_address(isolate()));
240 AllowExternalCallThatCantCauseGC scope(masm());
242 ExternalReference::compute_output_frames_function(isolate()), 2);
247 Label outer_push_loop, inner_push_loop,
248 outer_loop_header, inner_loop_header;
254 __ jmp(&outer_loop_header);
255 __ bind(&outer_push_loop);
259 __ jmp(&inner_loop_header);
260 __ bind(&inner_push_loop);
261 __ subp(
rcx, Immediate(
sizeof(intptr_t)));
263 __ bind(&inner_loop_header);
267 __ bind(&outer_loop_header);
274 __ movsd(xmm_reg, Operand(
rbx, src_offset));
285 __ PushQuad(Operand(
rbx, offset));
301 __ InitializeRootRegister();
302 __ InitializeSmiConstantRegister();
313 int start = masm()->pc_offset();
328 SetFrameSlot(offset, value);
337 SetFrameSlot(offset, value);
static const int kCallSequenceLength
static RelocInfo::Mode RelocInfoNone()
virtual void GeneratePrologue()
static int output_offset()
static const int table_entry_size_
void CopyDoubleRegisters(FrameDescription *output_frame)
static Address GetDeoptimizationEntry(Isolate *isolate, int id, BailoutType type, GetEntryMode mode=ENSURE_ENTRY_CODE)
static int input_offset()
static void PatchCodeForDeoptimization(Isolate *isolate, Code *code)
static int output_count_offset()
void SetPlatformCompiledStubRegisters(FrameDescription *output_frame, CodeStubDescriptor *desc)
bool HasAlignmentPadding(JSFunction *function)
FrameDescription * input_
Isolate * isolate() const
void FillInputFrame(Address tos, JavaScriptFrame *frame)
static int frame_size_offset()
void SetCallerFp(unsigned offset, intptr_t value)
uint32_t GetFrameSize() const
static int continuation_offset()
static int frame_content_offset()
void SetCallerConstantPool(unsigned offset, intptr_t value)
static int state_offset()
static int registers_offset()
double GetDoubleRegister(unsigned n) const
static int double_registers_offset()
void SetRegister(unsigned n, intptr_t value)
void SetCallerPc(unsigned offset, intptr_t value)
void SetFrameSlot(unsigned offset, intptr_t value)
void SetDoubleRegister(unsigned n, double value)
static const int kFunctionOffset
static uintptr_t & uintptr_at(Address addr)
static Smi * FromInt(int value)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
static int Push(SpecialRPOStackFrame *stack, int depth, BasicBlock *child, int unvisited)
const unsigned kNumberOfRegisters
static const int kNoCodeAgeSequenceLength
Debugger support for the V8 JavaScript engine.
static int NumAllocatableRegisters()
static const int kNumRegisters
static Register from_code(int code)
static XMMRegister FromAllocationIndex(int index)
static int NumAllocatableRegisters()