OLD | NEW |
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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
10 | 10 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 if (emit_debug_code()) { | 514 if (emit_debug_code()) { |
515 ldr(dst, FieldMemOperand(map, HeapObject::kMapOffset)); | 515 ldr(dst, FieldMemOperand(map, HeapObject::kMapOffset)); |
516 cmp(dst, Operand(isolate()->factory()->meta_map())); | 516 cmp(dst, Operand(isolate()->factory()->meta_map())); |
517 Check(eq, kWrongAddressOrValuePassedToRecordWrite); | 517 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
518 } | 518 } |
519 | 519 |
520 if (!FLAG_incremental_marking) { | 520 if (!FLAG_incremental_marking) { |
521 return; | 521 return; |
522 } | 522 } |
523 | 523 |
524 // Count number of write barriers in generated code. | |
525 isolate()->counters()->write_barriers_static()->Increment(); | |
526 // TODO(mstarzinger): Dynamic counter missing. | |
527 | |
528 if (emit_debug_code()) { | 524 if (emit_debug_code()) { |
529 ldr(ip, FieldMemOperand(object, HeapObject::kMapOffset)); | 525 ldr(ip, FieldMemOperand(object, HeapObject::kMapOffset)); |
530 cmp(ip, map); | 526 cmp(ip, map); |
531 Check(eq, kWrongAddressOrValuePassedToRecordWrite); | 527 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
532 } | 528 } |
533 | 529 |
534 Label done; | 530 Label done; |
535 | 531 |
536 // A single check of the map's pages interesting flag suffices, since it is | 532 // A single check of the map's pages interesting flag suffices, since it is |
537 // only set during incremental collection, and then it's also guaranteed that | 533 // only set during incremental collection, and then it's also guaranteed that |
(...skipping 20 matching lines...) Expand all Loading... |
558 } | 554 } |
559 RecordWriteStub stub(isolate(), object, map, dst, OMIT_REMEMBERED_SET, | 555 RecordWriteStub stub(isolate(), object, map, dst, OMIT_REMEMBERED_SET, |
560 fp_mode); | 556 fp_mode); |
561 CallStub(&stub); | 557 CallStub(&stub); |
562 if (lr_status == kLRHasNotBeenSaved) { | 558 if (lr_status == kLRHasNotBeenSaved) { |
563 pop(lr); | 559 pop(lr); |
564 } | 560 } |
565 | 561 |
566 bind(&done); | 562 bind(&done); |
567 | 563 |
| 564 // Count number of write barriers in generated code. |
| 565 isolate()->counters()->write_barriers_static()->Increment(); |
| 566 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, ip, dst); |
| 567 |
568 // Clobber clobbered registers when running with the debug-code flag | 568 // Clobber clobbered registers when running with the debug-code flag |
569 // turned on to provoke errors. | 569 // turned on to provoke errors. |
570 if (emit_debug_code()) { | 570 if (emit_debug_code()) { |
571 mov(dst, Operand(BitCast<int32_t>(kZapValue + 12))); | 571 mov(dst, Operand(BitCast<int32_t>(kZapValue + 12))); |
572 mov(map, Operand(BitCast<int32_t>(kZapValue + 16))); | 572 mov(map, Operand(BitCast<int32_t>(kZapValue + 16))); |
573 } | 573 } |
574 } | 574 } |
575 | 575 |
576 | 576 |
577 // Will clobber 4 registers: object, address, scratch, ip. The | 577 // Will clobber 4 registers: object, address, scratch, ip. The |
(...skipping 13 matching lines...) Expand all Loading... |
591 ldr(ip, MemOperand(address)); | 591 ldr(ip, MemOperand(address)); |
592 cmp(ip, value); | 592 cmp(ip, value); |
593 Check(eq, kWrongAddressOrValuePassedToRecordWrite); | 593 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
594 } | 594 } |
595 | 595 |
596 if (remembered_set_action == OMIT_REMEMBERED_SET && | 596 if (remembered_set_action == OMIT_REMEMBERED_SET && |
597 !FLAG_incremental_marking) { | 597 !FLAG_incremental_marking) { |
598 return; | 598 return; |
599 } | 599 } |
600 | 600 |
601 // Count number of write barriers in generated code. | |
602 isolate()->counters()->write_barriers_static()->Increment(); | |
603 // TODO(mstarzinger): Dynamic counter missing. | |
604 | |
605 // First, check if a write barrier is even needed. The tests below | 601 // First, check if a write barrier is even needed. The tests below |
606 // catch stores of smis and stores into the young generation. | 602 // catch stores of smis and stores into the young generation. |
607 Label done; | 603 Label done; |
608 | 604 |
609 if (smi_check == INLINE_SMI_CHECK) { | 605 if (smi_check == INLINE_SMI_CHECK) { |
610 JumpIfSmi(value, &done); | 606 JumpIfSmi(value, &done); |
611 } | 607 } |
612 | 608 |
613 if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) { | 609 if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) { |
614 CheckPageFlag(value, | 610 CheckPageFlag(value, |
(...skipping 14 matching lines...) Expand all Loading... |
629 } | 625 } |
630 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action, | 626 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action, |
631 fp_mode); | 627 fp_mode); |
632 CallStub(&stub); | 628 CallStub(&stub); |
633 if (lr_status == kLRHasNotBeenSaved) { | 629 if (lr_status == kLRHasNotBeenSaved) { |
634 pop(lr); | 630 pop(lr); |
635 } | 631 } |
636 | 632 |
637 bind(&done); | 633 bind(&done); |
638 | 634 |
| 635 // Count number of write barriers in generated code. |
| 636 isolate()->counters()->write_barriers_static()->Increment(); |
| 637 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, ip, |
| 638 value); |
| 639 |
639 // Clobber clobbered registers when running with the debug-code flag | 640 // Clobber clobbered registers when running with the debug-code flag |
640 // turned on to provoke errors. | 641 // turned on to provoke errors. |
641 if (emit_debug_code()) { | 642 if (emit_debug_code()) { |
642 mov(address, Operand(BitCast<int32_t>(kZapValue + 12))); | 643 mov(address, Operand(BitCast<int32_t>(kZapValue + 12))); |
643 mov(value, Operand(BitCast<int32_t>(kZapValue + 16))); | 644 mov(value, Operand(BitCast<int32_t>(kZapValue + 16))); |
644 } | 645 } |
645 } | 646 } |
646 | 647 |
647 | 648 |
648 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. | 649 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. |
(...skipping 3453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4102 sub(result, result, Operand(dividend)); | 4103 sub(result, result, Operand(dividend)); |
4103 } | 4104 } |
4104 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); | 4105 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); |
4105 add(result, result, Operand(dividend, LSR, 31)); | 4106 add(result, result, Operand(dividend, LSR, 31)); |
4106 } | 4107 } |
4107 | 4108 |
4108 | 4109 |
4109 } } // namespace v8::internal | 4110 } } // namespace v8::internal |
4110 | 4111 |
4111 #endif // V8_TARGET_ARCH_ARM | 4112 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |