| Index: src/x64/deoptimizer-x64.cc
|
| diff --git a/src/x64/deoptimizer-x64.cc b/src/x64/deoptimizer-x64.cc
|
| index 1094dabf8e83ed07d0c27e45d824d0a07e7b920b..0b6791e59a40cd37a9bfca449d769e49f9342370 100644
|
| --- a/src/x64/deoptimizer-x64.cc
|
| +++ b/src/x64/deoptimizer-x64.cc
|
| @@ -51,6 +51,26 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
|
| // code patching below, and is not needed any more.
|
| code->InvalidateRelocation();
|
|
|
| + if (FLAG_zap_code_space) {
|
| + // Fail hard and early if we enter this code object again.
|
| + byte* pointer = code->FindCodeAgeSequence();
|
| + if (pointer != NULL) {
|
| + pointer += kNoCodeAgeSequenceLength;
|
| + } else {
|
| + pointer = code->instruction_start();
|
| + }
|
| + CodePatcher patcher(pointer, 1);
|
| + patcher.masm()->int3();
|
| +
|
| + DeoptimizationInputData* data =
|
| + DeoptimizationInputData::cast(code->deoptimization_data());
|
| + int osr_offset = data->OsrPcOffset()->value();
|
| + if (osr_offset > 0) {
|
| + CodePatcher osr_patcher(code->instruction_start() + osr_offset, 1);
|
| + osr_patcher.masm()->int3();
|
| + }
|
| + }
|
| +
|
| // For each LLazyBailout instruction insert a absolute call to the
|
| // corresponding deoptimization entry, or a short call to an absolute
|
| // jump if space is short. The absolute jumps are put in a table just
|
| @@ -63,6 +83,12 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
|
| #endif
|
| DeoptimizationInputData* deopt_data =
|
| DeoptimizationInputData::cast(code->deoptimization_data());
|
| + SharedFunctionInfo* shared =
|
| + SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo());
|
| + shared->EvictFromOptimizedCodeMap(code, "deoptimized code");
|
| + deopt_data->SetSharedFunctionInfo(Smi::FromInt(0));
|
| + // For each LLazyBailout instruction insert a call to the corresponding
|
| + // deoptimization entry.
|
| for (int i = 0; i < deopt_data->DeoptCount(); i++) {
|
| if (deopt_data->Pc(i)->value() == -1) continue;
|
| // Position where Call will be patched in.
|
| @@ -71,7 +97,7 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
|
| // LLazyBailout instructions with nops if necessary.
|
| CodePatcher patcher(call_address, Assembler::kCallSequenceLength);
|
| patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY),
|
| - RelocInfo::NONE64);
|
| + Assembler::RelocInfoNone());
|
| ASSERT(prev_call_address == NULL ||
|
| call_address >= prev_call_address + patch_size());
|
| ASSERT(call_address + patch_size() <= code->instruction_end());
|
| @@ -97,7 +123,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
|
|
|
| // Fill the frame content from the actual data on the frame.
|
| for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
|
| - input_->SetFrameSlot(i, Memory::uint64_at(tos + i));
|
| + input_->SetFrameSlot(i, Memory::uintptr_at(tos + i));
|
| }
|
| }
|
|
|
| @@ -186,9 +212,9 @@ void Deoptimizer::EntryGenerator::Generate() {
|
| // On windows put the arguments on the stack (PrepareCallCFunction
|
| // has created space for this). On linux pass the arguments in r8 and r9.
|
| #ifdef _WIN64
|
| - __ movp(Operand(rsp, 4 * kPointerSize), arg5);
|
| + __ movq(Operand(rsp, 4 * kRegisterSize), arg5);
|
| __ LoadAddress(arg5, ExternalReference::isolate_address(isolate()));
|
| - __ movp(Operand(rsp, 5 * kPointerSize), arg5);
|
| + __ movq(Operand(rsp, 5 * kRegisterSize), arg5);
|
| #else
|
| __ movp(r8, arg5);
|
| __ LoadAddress(r9, ExternalReference::isolate_address(isolate()));
|
|
|