| 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 | 482 |
| 483 void MacroAssembler::RecordWriteCodeEntryField(Register js_function, | 483 void MacroAssembler::RecordWriteCodeEntryField(Register js_function, |
| 484 Register code_entry, | 484 Register code_entry, |
| 485 Register scratch) { | 485 Register scratch) { |
| 486 const int offset = JSFunction::kCodeEntryOffset; | 486 const int offset = JSFunction::kCodeEntryOffset; |
| 487 | 487 |
| 488 // The input registers are fixed to make calling the C write barrier function | 488 // The input registers are fixed to make calling the C write barrier function |
| 489 // easier. | 489 // easier. |
| 490 DCHECK(js_function.is(rdi)); | 490 DCHECK(js_function.is(rdi)); |
| 491 DCHECK(code_entry.is(rcx)); | 491 DCHECK(code_entry.is(rcx)); |
| 492 DCHECK(scratch.is(r15)); | 492 DCHECK(scratch.is(rax)); |
| 493 | 493 |
| 494 // Since a code entry (value) is always in old space, we don't need to update | 494 // Since a code entry (value) is always in old space, we don't need to update |
| 495 // remembered set. If incremental marking is off, there is nothing for us to | 495 // remembered set. If incremental marking is off, there is nothing for us to |
| 496 // do. | 496 // do. |
| 497 if (!FLAG_incremental_marking) return; | 497 if (!FLAG_incremental_marking) return; |
| 498 | 498 |
| 499 AssertNotSmi(js_function); | 499 AssertNotSmi(js_function); |
| 500 | 500 |
| 501 if (emit_debug_code()) { | 501 if (emit_debug_code()) { |
| 502 Label ok; | 502 Label ok; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 530 | 530 |
| 531 int argument_count = 3; | 531 int argument_count = 3; |
| 532 PrepareCallCFunction(argument_count); | 532 PrepareCallCFunction(argument_count); |
| 533 | 533 |
| 534 // Load the argument registers. | 534 // Load the argument registers. |
| 535 if (arg_reg_1.is(rcx)) { | 535 if (arg_reg_1.is(rcx)) { |
| 536 // Windows calling convention. | 536 // Windows calling convention. |
| 537 DCHECK(arg_reg_2.is(rdx) && arg_reg_3.is(r8)); | 537 DCHECK(arg_reg_2.is(rdx) && arg_reg_3.is(r8)); |
| 538 | 538 |
| 539 movp(arg_reg_1, js_function); // rcx gets rdi. | 539 movp(arg_reg_1, js_function); // rcx gets rdi. |
| 540 movp(arg_reg_2, dst); // rdx gets r15. | 540 movp(arg_reg_2, dst); // rdx gets rax. |
| 541 } else { | 541 } else { |
| 542 // AMD64 calling convention. | 542 // AMD64 calling convention. |
| 543 DCHECK(arg_reg_1.is(rdi) && arg_reg_2.is(rsi) && arg_reg_3.is(rdx)); | 543 DCHECK(arg_reg_1.is(rdi) && arg_reg_2.is(rsi) && arg_reg_3.is(rdx)); |
| 544 | 544 |
| 545 // rdi is already loaded with js_function. | 545 // rdi is already loaded with js_function. |
| 546 movp(arg_reg_2, dst); // rsi gets r15. | 546 movp(arg_reg_2, dst); // rsi gets rax. |
| 547 } | 547 } |
| 548 Move(arg_reg_3, ExternalReference::isolate_address(isolate())); | 548 Move(arg_reg_3, ExternalReference::isolate_address(isolate())); |
| 549 | 549 |
| 550 { | 550 { |
| 551 AllowExternalCallThatCantCauseGC scope(this); | 551 AllowExternalCallThatCantCauseGC scope(this); |
| 552 CallCFunction( | 552 CallCFunction( |
| 553 ExternalReference::incremental_marking_record_write_code_entry_function( | 553 ExternalReference::incremental_marking_record_write_code_entry_function( |
| 554 isolate()), | 554 isolate()), |
| 555 argument_count); | 555 argument_count); |
| 556 } | 556 } |
| (...skipping 5156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5713 movl(rax, dividend); | 5713 movl(rax, dividend); |
| 5714 shrl(rax, Immediate(31)); | 5714 shrl(rax, Immediate(31)); |
| 5715 addl(rdx, rax); | 5715 addl(rdx, rax); |
| 5716 } | 5716 } |
| 5717 | 5717 |
| 5718 | 5718 |
| 5719 } // namespace internal | 5719 } // namespace internal |
| 5720 } // namespace v8 | 5720 } // namespace v8 |
| 5721 | 5721 |
| 5722 #endif // V8_TARGET_ARCH_X64 | 5722 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |