Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Side by Side Diff: src/x64/deoptimizer-x64.cc

Issue 1474763008: Always pass an Isolate to AssemblerBase (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/full-codegen/full-codegen.h" 9 #include "src/full-codegen/full-codegen.h"
10 #include "src/register-configuration.h" 10 #include "src/register-configuration.h"
(...skipping 23 matching lines...) Expand all
34 code->InvalidateRelocation(); 34 code->InvalidateRelocation();
35 35
36 if (FLAG_zap_code_space) { 36 if (FLAG_zap_code_space) {
37 // Fail hard and early if we enter this code object again. 37 // Fail hard and early if we enter this code object again.
38 byte* pointer = code->FindCodeAgeSequence(); 38 byte* pointer = code->FindCodeAgeSequence();
39 if (pointer != NULL) { 39 if (pointer != NULL) {
40 pointer += kNoCodeAgeSequenceLength; 40 pointer += kNoCodeAgeSequenceLength;
41 } else { 41 } else {
42 pointer = code->instruction_start(); 42 pointer = code->instruction_start();
43 } 43 }
44 CodePatcher patcher(pointer, 1); 44 CodePatcher patcher(isolate, pointer, 1);
45 patcher.masm()->int3(); 45 patcher.masm()->int3();
46 46
47 DeoptimizationInputData* data = 47 DeoptimizationInputData* data =
48 DeoptimizationInputData::cast(code->deoptimization_data()); 48 DeoptimizationInputData::cast(code->deoptimization_data());
49 int osr_offset = data->OsrPcOffset()->value(); 49 int osr_offset = data->OsrPcOffset()->value();
50 if (osr_offset > 0) { 50 if (osr_offset > 0) {
51 CodePatcher osr_patcher(code->instruction_start() + osr_offset, 1); 51 CodePatcher osr_patcher(isolate, code->instruction_start() + osr_offset,
52 1);
52 osr_patcher.masm()->int3(); 53 osr_patcher.masm()->int3();
53 } 54 }
54 } 55 }
55 56
56 // For each LLazyBailout instruction insert a absolute call to the 57 // For each LLazyBailout instruction insert a absolute call to the
57 // corresponding deoptimization entry, or a short call to an absolute 58 // corresponding deoptimization entry, or a short call to an absolute
58 // jump if space is short. The absolute jumps are put in a table just 59 // jump if space is short. The absolute jumps are put in a table just
59 // before the safepoint table (space was allocated there when the Code 60 // before the safepoint table (space was allocated there when the Code
60 // object was created, if necessary). 61 // object was created, if necessary).
61 62
62 Address instruction_start = code->instruction_start(); 63 Address instruction_start = code->instruction_start();
63 #ifdef DEBUG 64 #ifdef DEBUG
64 Address prev_call_address = NULL; 65 Address prev_call_address = NULL;
65 #endif 66 #endif
66 DeoptimizationInputData* deopt_data = 67 DeoptimizationInputData* deopt_data =
67 DeoptimizationInputData::cast(code->deoptimization_data()); 68 DeoptimizationInputData::cast(code->deoptimization_data());
68 deopt_data->SetSharedFunctionInfo(Smi::FromInt(0)); 69 deopt_data->SetSharedFunctionInfo(Smi::FromInt(0));
69 // For each LLazyBailout instruction insert a call to the corresponding 70 // For each LLazyBailout instruction insert a call to the corresponding
70 // deoptimization entry. 71 // deoptimization entry.
71 for (int i = 0; i < deopt_data->DeoptCount(); i++) { 72 for (int i = 0; i < deopt_data->DeoptCount(); i++) {
72 if (deopt_data->Pc(i)->value() == -1) continue; 73 if (deopt_data->Pc(i)->value() == -1) continue;
73 // Position where Call will be patched in. 74 // Position where Call will be patched in.
74 Address call_address = instruction_start + deopt_data->Pc(i)->value(); 75 Address call_address = instruction_start + deopt_data->Pc(i)->value();
75 // There is room enough to write a long call instruction because we pad 76 // There is room enough to write a long call instruction because we pad
76 // LLazyBailout instructions with nops if necessary. 77 // LLazyBailout instructions with nops if necessary.
77 CodePatcher patcher(call_address, Assembler::kCallSequenceLength); 78 CodePatcher patcher(isolate, call_address, Assembler::kCallSequenceLength);
78 patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY), 79 patcher.masm()->Call(GetDeoptimizationEntry(isolate, i, LAZY),
79 Assembler::RelocInfoNone()); 80 Assembler::RelocInfoNone());
80 DCHECK(prev_call_address == NULL || 81 DCHECK(prev_call_address == NULL ||
81 call_address >= prev_call_address + patch_size()); 82 call_address >= prev_call_address + patch_size());
82 DCHECK(call_address + patch_size() <= code->instruction_end()); 83 DCHECK(call_address + patch_size() <= code->instruction_end());
83 #ifdef DEBUG 84 #ifdef DEBUG
84 prev_call_address = call_address; 85 prev_call_address = call_address;
85 #endif 86 #endif
86 } 87 }
87 } 88 }
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 354 }
354 355
355 356
356 #undef __ 357 #undef __
357 358
358 359
359 } // namespace internal 360 } // namespace internal
360 } // namespace v8 361 } // namespace v8
361 362
362 #endif // V8_TARGET_ARCH_X64 363 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698