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

Side by Side Diff: src/arm/codegen-arm.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/arm/assembler-arm-inl.h ('k') | src/arm/deoptimizer-arm.cc » ('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 #include "src/arm/codegen-arm.h" 5 #include "src/arm/codegen-arm.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 __ mov(chars, Operand(chars, LSL, 31), SetCC); 161 __ mov(chars, Operand(chars, LSL, 31), SetCC);
162 // bit0 => Z (ne), bit1 => C (cs) 162 // bit0 => Z (ne), bit1 => C (cs)
163 __ ldrh(temp1, MemOperand(src, 2, PostIndex), cs); 163 __ ldrh(temp1, MemOperand(src, 2, PostIndex), cs);
164 __ strh(temp1, MemOperand(dest, 2, PostIndex), cs); 164 __ strh(temp1, MemOperand(dest, 2, PostIndex), cs);
165 __ ldrb(temp1, MemOperand(src), ne); 165 __ ldrb(temp1, MemOperand(src), ne);
166 __ strb(temp1, MemOperand(dest), ne); 166 __ strb(temp1, MemOperand(dest), ne);
167 __ Ret(); 167 __ Ret();
168 168
169 CodeDesc desc; 169 CodeDesc desc;
170 masm.GetCode(&desc); 170 masm.GetCode(&desc);
171 DCHECK(!RelocInfo::RequiresRelocation(desc)); 171 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
172 172
173 Assembler::FlushICache(isolate, buffer, actual_size); 173 Assembler::FlushICache(isolate, buffer, actual_size);
174 base::OS::ProtectCode(buffer, actual_size); 174 base::OS::ProtectCode(buffer, actual_size);
175 return FUNCTION_CAST<MemCopyUint8Function>(buffer); 175 return FUNCTION_CAST<MemCopyUint8Function>(buffer);
176 #endif 176 #endif
177 } 177 }
178 178
179 179
180 // Convert 8 to 16. The number of character to copy must be at least 8. 180 // Convert 8 to 16. The number of character to copy must be at least 8.
181 MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( 181 MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function(
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), 278 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size),
279 CodeObjectRequired::kNo); 279 CodeObjectRequired::kNo);
280 280
281 __ MovFromFloatParameter(d0); 281 __ MovFromFloatParameter(d0);
282 __ vsqrt(d0, d0); 282 __ vsqrt(d0, d0);
283 __ MovToFloatResult(d0); 283 __ MovToFloatResult(d0);
284 __ Ret(); 284 __ Ret();
285 285
286 CodeDesc desc; 286 CodeDesc desc;
287 masm.GetCode(&desc); 287 masm.GetCode(&desc);
288 DCHECK(!RelocInfo::RequiresRelocation(desc)); 288 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
289 289
290 Assembler::FlushICache(isolate, buffer, actual_size); 290 Assembler::FlushICache(isolate, buffer, actual_size);
291 base::OS::ProtectCode(buffer, actual_size); 291 base::OS::ProtectCode(buffer, actual_size);
292 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); 292 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
293 #endif 293 #endif
294 } 294 }
295 295
296 #undef __ 296 #undef __
297 297
298 298
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 459
460 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence, 460 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence,
461 Code::Age age) { 461 Code::Age age) {
462 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); 462 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length();
463 if (age == kNoAgeCodeAge) { 463 if (age == kNoAgeCodeAge) {
464 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); 464 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence);
465 Assembler::FlushICache(isolate, sequence, young_length); 465 Assembler::FlushICache(isolate, sequence, young_length);
466 } else { 466 } else {
467 Code* stub = GetCodeAgeStub(isolate, age); 467 Code* stub = GetCodeAgeStub(isolate, age);
468 CodePatcher patcher(isolate, sequence, 468 PatchingAssembler patcher(Assembler::IsolateData(isolate), sequence,
469 young_length / Assembler::kInstrSize); 469 young_length / Assembler::kInstrSize);
470 patcher.masm()->add(r0, pc, Operand(-8)); 470 patcher.add(r0, pc, Operand(-8));
471 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 471 patcher.ldr(pc, MemOperand(pc, -4));
472 patcher.masm()->emit_code_stub_address(stub); 472 patcher.emit_code_stub_address(stub);
473 patcher.FlushICache(isolate);
473 } 474 }
474 } 475 }
475 476
476 } // namespace internal 477 } // namespace internal
477 } // namespace v8 478 } // namespace v8
478 479
479 #endif // V8_TARGET_ARCH_ARM 480 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm-inl.h ('k') | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698