OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 406 } |
407 | 407 |
408 if (emit_debug_code()) { | 408 if (emit_debug_code()) { |
409 Label ok; | 409 Label ok; |
410 cmpq(value, Operand(address, 0)); | 410 cmpq(value, Operand(address, 0)); |
411 j(equal, &ok, Label::kNear); | 411 j(equal, &ok, Label::kNear); |
412 int3(); | 412 int3(); |
413 bind(&ok); | 413 bind(&ok); |
414 } | 414 } |
415 | 415 |
| 416 // Count number of write barriers in generated code. |
| 417 isolate()->counters()->write_barriers_static()->Increment(); |
| 418 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1); |
| 419 |
416 // First, check if a write barrier is even needed. The tests below | 420 // First, check if a write barrier is even needed. The tests below |
417 // catch stores of smis and stores into the young generation. | 421 // catch stores of smis and stores into the young generation. |
418 Label done; | 422 Label done; |
419 | 423 |
420 if (smi_check == INLINE_SMI_CHECK) { | 424 if (smi_check == INLINE_SMI_CHECK) { |
421 // Skip barrier if writing a smi. | 425 // Skip barrier if writing a smi. |
422 JumpIfSmi(value, &done); | 426 JumpIfSmi(value, &done); |
423 } | 427 } |
424 | 428 |
425 CheckPageFlag(value, | 429 CheckPageFlag(value, |
(...skipping 4503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4929 j(greater, &no_memento_available); | 4933 j(greater, &no_memento_available); |
4930 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), | 4934 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), |
4931 Heap::kAllocationMementoMapRootIndex); | 4935 Heap::kAllocationMementoMapRootIndex); |
4932 bind(&no_memento_available); | 4936 bind(&no_memento_available); |
4933 } | 4937 } |
4934 | 4938 |
4935 | 4939 |
4936 } } // namespace v8::internal | 4940 } } // namespace v8::internal |
4937 | 4941 |
4938 #endif // V8_TARGET_ARCH_X64 | 4942 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |