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

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

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 years, 9 months 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/ia32/codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.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_IA32 5 #if V8_TARGET_ARCH_IA32
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/ia32/frames-ia32.h" 10 #include "src/ia32/frames-ia32.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 Handle<ByteArray> new_reloc = 69 Handle<ByteArray> new_reloc =
70 factory->NewByteArray(reloc_length + padding, TENURED); 70 factory->NewByteArray(reloc_length + padding, TENURED);
71 MemCopy(new_reloc->GetDataStartAddress() + padding, 71 MemCopy(new_reloc->GetDataStartAddress() + padding,
72 code->relocation_info()->GetDataStartAddress(), reloc_length); 72 code->relocation_info()->GetDataStartAddress(), reloc_length);
73 // Create a relocation writer to write the comments in the padding 73 // Create a relocation writer to write the comments in the padding
74 // space. Use position 0 for everything to ensure short encoding. 74 // space. Use position 0 for everything to ensure short encoding.
75 RelocInfoWriter reloc_info_writer( 75 RelocInfoWriter reloc_info_writer(
76 new_reloc->GetDataStartAddress() + padding, 0); 76 new_reloc->GetDataStartAddress() + padding, 0);
77 intptr_t comment_string 77 intptr_t comment_string
78 = reinterpret_cast<intptr_t>(RelocInfo::kFillerCommentString); 78 = reinterpret_cast<intptr_t>(RelocInfo::kFillerCommentString);
79 RelocInfo rinfo(isolate, 0, RelocInfo::COMMENT, comment_string, NULL); 79 RelocInfo rinfo(0, RelocInfo::COMMENT, comment_string, NULL);
80 for (int i = 0; i < additional_comments; ++i) { 80 for (int i = 0; i < additional_comments; ++i) {
81 #ifdef DEBUG 81 #ifdef DEBUG
82 byte* pos_before = reloc_info_writer.pos(); 82 byte* pos_before = reloc_info_writer.pos();
83 #endif 83 #endif
84 reloc_info_writer.Write(&rinfo); 84 reloc_info_writer.Write(&rinfo);
85 DCHECK(RelocInfo::kMinRelocCommentSize == 85 DCHECK(RelocInfo::kMinRelocCommentSize ==
86 pos_before - reloc_info_writer.pos()); 86 pos_before - reloc_info_writer.pos());
87 } 87 }
88 // Replace relocation information on the code object. 88 // Replace relocation information on the code object.
89 code->set_relocation_info(*new_reloc); 89 code->set_relocation_info(*new_reloc);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // For each LLazyBailout instruction insert a call to the corresponding 136 // For each LLazyBailout instruction insert a call to the corresponding
137 // deoptimization entry. 137 // deoptimization entry.
138 for (int i = 0; i < deopt_data->DeoptCount(); i++) { 138 for (int i = 0; i < deopt_data->DeoptCount(); i++) {
139 if (deopt_data->Pc(i)->value() == -1) continue; 139 if (deopt_data->Pc(i)->value() == -1) continue;
140 // Patch lazy deoptimization entry. 140 // Patch lazy deoptimization entry.
141 Address call_address = code_start_address + deopt_data->Pc(i)->value(); 141 Address call_address = code_start_address + deopt_data->Pc(i)->value();
142 CodePatcher patcher(isolate, call_address, patch_size()); 142 CodePatcher patcher(isolate, call_address, patch_size());
143 Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY); 143 Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY);
144 patcher.masm()->call(deopt_entry, RelocInfo::NONE32); 144 patcher.masm()->call(deopt_entry, RelocInfo::NONE32);
145 // We use RUNTIME_ENTRY for deoptimization bailouts. 145 // We use RUNTIME_ENTRY for deoptimization bailouts.
146 RelocInfo rinfo(isolate, call_address + 1, // 1 after the call opcode. 146 RelocInfo rinfo(call_address + 1, // 1 after the call opcode.
147 RelocInfo::RUNTIME_ENTRY, 147 RelocInfo::RUNTIME_ENTRY,
148 reinterpret_cast<intptr_t>(deopt_entry), NULL); 148 reinterpret_cast<intptr_t>(deopt_entry), NULL);
149 reloc_info_writer.Write(&rinfo); 149 reloc_info_writer.Write(&rinfo);
150 DCHECK_GE(reloc_info_writer.pos(), 150 DCHECK_GE(reloc_info_writer.pos(),
151 reloc_info->address() + ByteArray::kHeaderSize); 151 reloc_info->address() + ByteArray::kHeaderSize);
152 DCHECK(prev_call_address == NULL || 152 DCHECK(prev_call_address == NULL ||
153 call_address >= prev_call_address + patch_size()); 153 call_address >= prev_call_address + patch_size());
154 DCHECK(call_address + patch_size() <= code->instruction_end()); 154 DCHECK(call_address + patch_size() <= code->instruction_end());
155 #ifdef DEBUG 155 #ifdef DEBUG
156 prev_call_address = call_address; 156 prev_call_address = call_address;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 } 386 }
387 387
388 388
389 #undef __ 389 #undef __
390 390
391 391
392 } // namespace internal 392 } // namespace internal
393 } // namespace v8 393 } // namespace v8
394 394
395 #endif // V8_TARGET_ARCH_IA32 395 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698