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

Side by Side Diff: src/arm64/codegen-arm64.cc

Issue 261953002: Fix for 3303 MultithreadedParallelIsolates has a race condition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed ICache arm simulator issue. Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/arm64/macro-assembler-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "codegen.h" 9 #include "codegen.h"
10 #include "macro-assembler.h" 10 #include "macro-assembler.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 __ Pop(lr); 343 __ Pop(lr);
344 344
345 __ Bind(&only_change_map); 345 __ Bind(&only_change_map);
346 __ Str(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); 346 __ Str(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset));
347 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, x13, 347 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, x13,
348 kLRHasNotBeenSaved, kDontSaveFPRegs, OMIT_REMEMBERED_SET, 348 kLRHasNotBeenSaved, kDontSaveFPRegs, OMIT_REMEMBERED_SET,
349 OMIT_SMI_CHECK); 349 OMIT_SMI_CHECK);
350 } 350 }
351 351
352 352
353 bool Code::IsYoungSequence(byte* sequence) { 353 CodeAgingHelper::CodeAgingHelper() {
354 return MacroAssembler::IsYoungSequence(sequence); 354 ASSERT(young_sequence_.length() == kNoCodeAgeSequenceLength);
355 // The sequence of instructions that is patched out for aging code is the
356 // following boilerplate stack-building prologue that is found both in
357 // FUNCTION and OPTIMIZED_FUNCTION code:
358 PatchingAssembler patcher(young_sequence_.start(),
359 young_sequence_.length() / kInstructionSize);
360 // The young sequence is the frame setup code for FUNCTION code types. It is
361 // generated by FullCodeGenerator::Generate.
362 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher);
363
364 #ifdef DEBUG
365 const int length = kCodeAgeStubEntryOffset / kInstructionSize;
366 ASSERT(old_sequence_.length() >= kCodeAgeStubEntryOffset);
367 PatchingAssembler patcher_old(old_sequence_.start(), length);
368 MacroAssembler::EmitCodeAgeSequence(&patcher_old, NULL);
369 #endif
355 } 370 }
356 371
357 372
358 void Code::GetCodeAgeAndParity(byte* sequence, Age* age, 373 #ifdef DEBUG
374 bool CodeAgingHelper::IsOld(byte* candidate) const {
375 return memcmp(candidate, old_sequence_.start(), kCodeAgeStubEntryOffset) == 0;
376 }
377 #endif
378
379
380 bool Code::IsYoungSequence(Isolate* isolate, byte* sequence) {
381 return MacroAssembler::IsYoungSequence(isolate, sequence);
382 }
383
384
385 void Code::GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age,
359 MarkingParity* parity) { 386 MarkingParity* parity) {
360 if (IsYoungSequence(sequence)) { 387 if (IsYoungSequence(isolate, sequence)) {
361 *age = kNoAgeCodeAge; 388 *age = kNoAgeCodeAge;
362 *parity = NO_MARKING_PARITY; 389 *parity = NO_MARKING_PARITY;
363 } else { 390 } else {
364 byte* target = sequence + kCodeAgeStubEntryOffset; 391 byte* target = sequence + kCodeAgeStubEntryOffset;
365 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); 392 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target));
366 GetCodeAgeAndParity(stub, age, parity); 393 GetCodeAgeAndParity(stub, age, parity);
367 } 394 }
368 } 395 }
369 396
370 397
371 void Code::PatchPlatformCodeAge(Isolate* isolate, 398 void Code::PatchPlatformCodeAge(Isolate* isolate,
372 byte* sequence, 399 byte* sequence,
373 Code::Age age, 400 Code::Age age,
374 MarkingParity parity) { 401 MarkingParity parity) {
375 PatchingAssembler patcher(sequence, kCodeAgeSequenceSize / kInstructionSize); 402 PatchingAssembler patcher(sequence,
403 kNoCodeAgeSequenceLength / kInstructionSize);
376 if (age == kNoAgeCodeAge) { 404 if (age == kNoAgeCodeAge) {
377 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); 405 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher);
378 } else { 406 } else {
379 Code * stub = GetCodeAgeStub(isolate, age, parity); 407 Code * stub = GetCodeAgeStub(isolate, age, parity);
380 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); 408 MacroAssembler::EmitCodeAgeSequence(&patcher, stub);
381 } 409 }
382 } 410 }
383 411
384 412
385 void StringCharLoadGenerator::Generate(MacroAssembler* masm, 413 void StringCharLoadGenerator::Generate(MacroAssembler* masm,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 __ Fmul(result, double_temp3, double_temp1); 611 __ Fmul(result, double_temp3, double_temp1);
584 612
585 __ Bind(&done); 613 __ Bind(&done);
586 } 614 }
587 615
588 #undef __ 616 #undef __
589 617
590 } } // namespace v8::internal 618 } } // namespace v8::internal
591 619
592 #endif // V8_TARGET_ARCH_ARM64 620 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/arm64/macro-assembler-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698