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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 133443009: A64: Synchronize with r17441. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.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 // 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 cmpb(Operand(rax, 0), Immediate(0)); 733 cmpb(Operand(rax, 0), Immediate(0));
734 j(zero, &profiler_disabled); 734 j(zero, &profiler_disabled);
735 735
736 // Third parameter is the address of the actual getter function. 736 // Third parameter is the address of the actual getter function.
737 movq(thunk_last_arg, function_address, RelocInfo::EXTERNAL_REFERENCE); 737 movq(thunk_last_arg, function_address, RelocInfo::EXTERNAL_REFERENCE);
738 movq(rax, thunk_address, RelocInfo::EXTERNAL_REFERENCE); 738 movq(rax, thunk_address, RelocInfo::EXTERNAL_REFERENCE);
739 jmp(&end_profiler_check); 739 jmp(&end_profiler_check);
740 740
741 bind(&profiler_disabled); 741 bind(&profiler_disabled);
742 // Call the api function! 742 // Call the api function!
743 movq(rax, reinterpret_cast<int64_t>(function_address), 743 movq(rax, reinterpret_cast<Address>(function_address),
744 RelocInfo::EXTERNAL_REFERENCE); 744 RelocInfo::EXTERNAL_REFERENCE);
745 745
746 bind(&end_profiler_check); 746 bind(&end_profiler_check);
747 747
748 // Call the api function! 748 // Call the api function!
749 call(rax); 749 call(rax);
750 750
751 if (FLAG_log_timer_events) { 751 if (FLAG_log_timer_events) {
752 FrameScope frame(this, StackFrame::MANUAL); 752 FrameScope frame(this, StackFrame::MANUAL);
753 PushSafepointRegisters(); 753 PushSafepointRegisters();
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 } 941 }
942 942
943 943
944 void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) { 944 void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) {
945 xorps(dst, dst); 945 xorps(dst, dst);
946 cvtlsi2sd(dst, src); 946 cvtlsi2sd(dst, src);
947 } 947 }
948 948
949 949
950 void MacroAssembler::Load(Register dst, const Operand& src, Representation r) { 950 void MacroAssembler::Load(Register dst, const Operand& src, Representation r) {
951 ASSERT(!r.IsDouble());
951 if (r.IsByte()) { 952 if (r.IsByte()) {
952 movzxbl(dst, src); 953 movzxbl(dst, src);
953 } else if (r.IsInteger32()) { 954 } else if (r.IsInteger32()) {
954 movl(dst, src); 955 movl(dst, src);
955 } else { 956 } else {
956 movq(dst, src); 957 movq(dst, src);
957 } 958 }
958 } 959 }
959 960
960 961
961 void MacroAssembler::Store(const Operand& dst, Register src, Representation r) { 962 void MacroAssembler::Store(const Operand& dst, Register src, Representation r) {
963 ASSERT(!r.IsDouble());
962 if (r.IsByte()) { 964 if (r.IsByte()) {
963 movb(dst, src); 965 movb(dst, src);
964 } else if (r.IsInteger32()) { 966 } else if (r.IsInteger32()) {
965 movl(dst, src); 967 movl(dst, src);
966 } else { 968 } else {
967 movq(dst, src); 969 movq(dst, src);
968 } 970 }
969 } 971 }
970 972
971 973
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 movq(dst, src); 2485 movq(dst, src);
2484 } 2486 }
2485 } 2487 }
2486 2488
2487 2489
2488 void MacroAssembler::Move(Register dst, Handle<Object> source) { 2490 void MacroAssembler::Move(Register dst, Handle<Object> source) {
2489 AllowDeferredHandleDereference smi_check; 2491 AllowDeferredHandleDereference smi_check;
2490 if (source->IsSmi()) { 2492 if (source->IsSmi()) {
2491 Move(dst, Smi::cast(*source)); 2493 Move(dst, Smi::cast(*source));
2492 } else { 2494 } else {
2493 ASSERT(source->IsHeapObject()); 2495 MoveHeapObject(dst, source);
2494 movq(dst, source, RelocInfo::EMBEDDED_OBJECT);
2495 } 2496 }
2496 } 2497 }
2497 2498
2498 2499
2499 void MacroAssembler::Move(const Operand& dst, Handle<Object> source) { 2500 void MacroAssembler::Move(const Operand& dst, Handle<Object> source) {
2500 AllowDeferredHandleDereference smi_check; 2501 AllowDeferredHandleDereference smi_check;
2501 if (source->IsSmi()) { 2502 if (source->IsSmi()) {
2502 Move(dst, Smi::cast(*source)); 2503 Move(dst, Smi::cast(*source));
2503 } else { 2504 } else {
2504 ASSERT(source->IsHeapObject()); 2505 MoveHeapObject(kScratchRegister, source);
2505 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
2506 movq(dst, kScratchRegister); 2506 movq(dst, kScratchRegister);
2507 } 2507 }
2508 } 2508 }
2509 2509
2510 2510
2511 void MacroAssembler::Cmp(Register dst, Handle<Object> source) { 2511 void MacroAssembler::Cmp(Register dst, Handle<Object> source) {
2512 AllowDeferredHandleDereference smi_check; 2512 AllowDeferredHandleDereference smi_check;
2513 if (source->IsSmi()) { 2513 if (source->IsSmi()) {
2514 Cmp(dst, Smi::cast(*source)); 2514 Cmp(dst, Smi::cast(*source));
2515 } else { 2515 } else {
2516 ASSERT(source->IsHeapObject()); 2516 MoveHeapObject(kScratchRegister, source);
2517 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
2518 cmpq(dst, kScratchRegister); 2517 cmpq(dst, kScratchRegister);
2519 } 2518 }
2520 } 2519 }
2521 2520
2522 2521
2523 void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) { 2522 void MacroAssembler::Cmp(const Operand& dst, Handle<Object> source) {
2524 AllowDeferredHandleDereference smi_check; 2523 AllowDeferredHandleDereference smi_check;
2525 if (source->IsSmi()) { 2524 if (source->IsSmi()) {
2526 Cmp(dst, Smi::cast(*source)); 2525 Cmp(dst, Smi::cast(*source));
2527 } else { 2526 } else {
2528 ASSERT(source->IsHeapObject()); 2527 MoveHeapObject(kScratchRegister, source);
2529 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
2530 cmpq(dst, kScratchRegister); 2528 cmpq(dst, kScratchRegister);
2531 } 2529 }
2532 } 2530 }
2533 2531
2534 2532
2535 void MacroAssembler::Push(Handle<Object> source) { 2533 void MacroAssembler::Push(Handle<Object> source) {
2536 AllowDeferredHandleDereference smi_check; 2534 AllowDeferredHandleDereference smi_check;
2537 if (source->IsSmi()) { 2535 if (source->IsSmi()) {
2538 Push(Smi::cast(*source)); 2536 Push(Smi::cast(*source));
2539 } else { 2537 } else {
2540 ASSERT(source->IsHeapObject()); 2538 MoveHeapObject(kScratchRegister, source);
2541 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT);
2542 push(kScratchRegister); 2539 push(kScratchRegister);
2543 } 2540 }
2544 } 2541 }
2545 2542
2546 2543
2547 void MacroAssembler::LoadHeapObject(Register result, 2544 void MacroAssembler::MoveHeapObject(Register result,
2548 Handle<HeapObject> object) { 2545 Handle<Object> object) {
2549 AllowDeferredHandleDereference using_raw_address; 2546 AllowDeferredHandleDereference using_raw_address;
2547 ASSERT(object->IsHeapObject());
2550 if (isolate()->heap()->InNewSpace(*object)) { 2548 if (isolate()->heap()->InNewSpace(*object)) {
2551 Handle<Cell> cell = isolate()->factory()->NewCell(object); 2549 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2552 movq(result, cell, RelocInfo::CELL); 2550 movq(result, cell, RelocInfo::CELL);
2553 movq(result, Operand(result, 0)); 2551 movq(result, Operand(result, 0));
2554 } else { 2552 } else {
2555 Move(result, object); 2553 movq(result, object, RelocInfo::EMBEDDED_OBJECT);
2556 } 2554 }
2557 } 2555 }
2558 2556
2559
2560 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) {
2561 AllowDeferredHandleDereference using_raw_address;
2562 if (isolate()->heap()->InNewSpace(*object)) {
2563 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2564 movq(kScratchRegister, cell, RelocInfo::CELL);
2565 cmpq(reg, Operand(kScratchRegister, 0));
2566 } else {
2567 Cmp(reg, object);
2568 }
2569 }
2570
2571
2572 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
2573 AllowDeferredHandleDereference using_raw_address;
2574 if (isolate()->heap()->InNewSpace(*object)) {
2575 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2576 movq(kScratchRegister, cell, RelocInfo::CELL);
2577 movq(kScratchRegister, Operand(kScratchRegister, 0));
2578 push(kScratchRegister);
2579 } else {
2580 Push(object);
2581 }
2582 }
2583
2584 2557
2585 void MacroAssembler::LoadGlobalCell(Register dst, Handle<Cell> cell) { 2558 void MacroAssembler::LoadGlobalCell(Register dst, Handle<Cell> cell) {
2586 if (dst.is(rax)) { 2559 if (dst.is(rax)) {
2587 AllowDeferredHandleDereference embedding_raw_address; 2560 AllowDeferredHandleDereference embedding_raw_address;
2588 load_rax(cell.location(), RelocInfo::CELL); 2561 load_rax(cell.location(), RelocInfo::CELL);
2589 } else { 2562 } else {
2590 movq(dst, cell, RelocInfo::CELL); 2563 movq(dst, cell, RelocInfo::CELL);
2591 movq(dst, Operand(dst, 0)); 2564 movq(dst, Operand(dst, 0));
2592 } 2565 }
2593 } 2566 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2655 #endif 2628 #endif
2656 } 2629 }
2657 2630
2658 2631
2659 void MacroAssembler::Call(Handle<Code> code_object, 2632 void MacroAssembler::Call(Handle<Code> code_object,
2660 RelocInfo::Mode rmode, 2633 RelocInfo::Mode rmode,
2661 TypeFeedbackId ast_id) { 2634 TypeFeedbackId ast_id) {
2662 #ifdef DEBUG 2635 #ifdef DEBUG
2663 int end_position = pc_offset() + CallSize(code_object); 2636 int end_position = pc_offset() + CallSize(code_object);
2664 #endif 2637 #endif
2665 ASSERT(RelocInfo::IsCodeTarget(rmode)); 2638 ASSERT(RelocInfo::IsCodeTarget(rmode) ||
2639 rmode == RelocInfo::CODE_AGE_SEQUENCE);
2666 call(code_object, rmode, ast_id); 2640 call(code_object, rmode, ast_id);
2667 #ifdef DEBUG 2641 #ifdef DEBUG
2668 CHECK_EQ(end_position, pc_offset()); 2642 CHECK_EQ(end_position, pc_offset());
2669 #endif 2643 #endif
2670 } 2644 }
2671 2645
2672 2646
2673 void MacroAssembler::Pushad() { 2647 void MacroAssembler::Pushad() {
2674 push(rax); 2648 push(rax);
2675 push(rcx); 2649 push(rcx);
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, 3556 void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
3583 const ParameterCount& expected, 3557 const ParameterCount& expected,
3584 const ParameterCount& actual, 3558 const ParameterCount& actual,
3585 InvokeFlag flag, 3559 InvokeFlag flag,
3586 const CallWrapper& call_wrapper, 3560 const CallWrapper& call_wrapper,
3587 CallKind call_kind) { 3561 CallKind call_kind) {
3588 // You can't call a function without a valid frame. 3562 // You can't call a function without a valid frame.
3589 ASSERT(flag == JUMP_FUNCTION || has_frame()); 3563 ASSERT(flag == JUMP_FUNCTION || has_frame());
3590 3564
3591 // Get the function and setup the context. 3565 // Get the function and setup the context.
3592 LoadHeapObject(rdi, function); 3566 Move(rdi, function);
3593 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); 3567 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
3594 3568
3595 // We call indirectly through the code field in the function to 3569 // We call indirectly through the code field in the function to
3596 // allow recompilation to take effect without changing any of the 3570 // allow recompilation to take effect without changing any of the
3597 // call sites. 3571 // call sites.
3598 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); 3572 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
3599 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind); 3573 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind);
3600 } 3574 }
3601 3575
3602 3576
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
3669 } 3643 }
3670 } else { 3644 } else {
3671 SetCallKind(rcx, call_kind); 3645 SetCallKind(rcx, call_kind);
3672 Jump(adaptor, RelocInfo::CODE_TARGET); 3646 Jump(adaptor, RelocInfo::CODE_TARGET);
3673 } 3647 }
3674 bind(&invoke); 3648 bind(&invoke);
3675 } 3649 }
3676 } 3650 }
3677 3651
3678 3652
3653 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
3654 if (frame_mode == BUILD_STUB_FRAME) {
3655 push(rbp); // Caller's frame pointer.
3656 movq(rbp, rsp);
3657 push(rsi); // Callee's context.
3658 Push(Smi::FromInt(StackFrame::STUB));
3659 } else {
3660 PredictableCodeSizeScope predictible_code_size_scope(this,
3661 kNoCodeAgeSequenceLength);
3662 if (FLAG_optimize_for_size && FLAG_age_code) {
3663 // Pre-age the code.
3664 Call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
3665 RelocInfo::CODE_AGE_SEQUENCE);
3666 Nop(kNoCodeAgeSequenceLength - Assembler::kShortCallInstructionLength);
3667 } else {
3668 push(rbp); // Caller's frame pointer.
3669 movq(rbp, rsp);
3670 push(rsi); // Callee's context.
3671 push(rdi); // Callee's JS function.
3672 }
3673 }
3674 }
3675
3676
3679 void MacroAssembler::EnterFrame(StackFrame::Type type) { 3677 void MacroAssembler::EnterFrame(StackFrame::Type type) {
3680 push(rbp); 3678 push(rbp);
3681 movq(rbp, rsp); 3679 movq(rbp, rsp);
3682 push(rsi); // Context. 3680 push(rsi); // Context.
3683 Push(Smi::FromInt(type)); 3681 Push(Smi::FromInt(type));
3684 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); 3682 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
3685 push(kScratchRegister); 3683 push(kScratchRegister);
3686 if (emit_debug_code()) { 3684 if (emit_debug_code()) {
3687 movq(kScratchRegister, 3685 movq(kScratchRegister,
3688 isolate()->factory()->undefined_value(), 3686 isolate()->factory()->undefined_value(),
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
4084 } 4082 }
4085 } 4083 }
4086 jmp(gc_required); 4084 jmp(gc_required);
4087 return; 4085 return;
4088 } 4086 }
4089 ASSERT(!result.is(result_end)); 4087 ASSERT(!result.is(result_end));
4090 4088
4091 // Load address of new object into result. 4089 // Load address of new object into result.
4092 LoadAllocationTopHelper(result, scratch, flags); 4090 LoadAllocationTopHelper(result, scratch, flags);
4093 4091
4092 if (isolate()->heap_profiler()->is_tracking_allocations()) {
4093 RecordObjectAllocation(isolate(), result, object_size);
4094 }
4095
4094 // Align the next allocation. Storing the filler map without checking top is 4096 // Align the next allocation. Storing the filler map without checking top is
4095 // safe in new-space because the limit of the heap is aligned there. 4097 // safe in new-space because the limit of the heap is aligned there.
4096 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) { 4098 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
4097 testq(result, Immediate(kDoubleAlignmentMask)); 4099 testq(result, Immediate(kDoubleAlignmentMask));
4098 Check(zero, kAllocationIsNotDoubleAligned); 4100 Check(zero, kAllocationIsNotDoubleAligned);
4099 } 4101 }
4100 4102
4101 // Calculate new top and bail out if new space is exhausted. 4103 // Calculate new top and bail out if new space is exhausted.
4102 ExternalReference allocation_limit = 4104 ExternalReference allocation_limit =
4103 AllocationUtils::GetAllocationLimitReference(isolate(), flags); 4105 AllocationUtils::GetAllocationLimitReference(isolate(), flags);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
4163 // object_size is left unchanged by this function. 4165 // object_size is left unchanged by this function.
4164 } 4166 }
4165 jmp(gc_required); 4167 jmp(gc_required);
4166 return; 4168 return;
4167 } 4169 }
4168 ASSERT(!result.is(result_end)); 4170 ASSERT(!result.is(result_end));
4169 4171
4170 // Load address of new object into result. 4172 // Load address of new object into result.
4171 LoadAllocationTopHelper(result, scratch, flags); 4173 LoadAllocationTopHelper(result, scratch, flags);
4172 4174
4175 if (isolate()->heap_profiler()->is_tracking_allocations()) {
4176 RecordObjectAllocation(isolate(), result, object_size);
4177 }
4178
4173 // Align the next allocation. Storing the filler map without checking top is 4179 // Align the next allocation. Storing the filler map without checking top is
4174 // safe in new-space because the limit of the heap is aligned there. 4180 // safe in new-space because the limit of the heap is aligned there.
4175 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) { 4181 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
4176 testq(result, Immediate(kDoubleAlignmentMask)); 4182 testq(result, Immediate(kDoubleAlignmentMask));
4177 Check(zero, kAllocationIsNotDoubleAligned); 4183 Check(zero, kAllocationIsNotDoubleAligned);
4178 } 4184 }
4179 4185
4180 // Calculate new top and bail out if new space is exhausted. 4186 // Calculate new top and bail out if new space is exhausted.
4181 ExternalReference allocation_limit = 4187 ExternalReference allocation_limit =
4182 AllocationUtils::GetAllocationLimitReference(isolate(), flags); 4188 AllocationUtils::GetAllocationLimitReference(isolate(), flags);
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
4904 FieldOperand(rcx, JSObject::kElementsOffset)); 4910 FieldOperand(rcx, JSObject::kElementsOffset));
4905 j(not_equal, call_runtime); 4911 j(not_equal, call_runtime);
4906 4912
4907 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 4913 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
4908 cmpq(rcx, null_value); 4914 cmpq(rcx, null_value);
4909 j(not_equal, &next); 4915 j(not_equal, &next);
4910 } 4916 }
4911 4917
4912 void MacroAssembler::TestJSArrayForAllocationMemento( 4918 void MacroAssembler::TestJSArrayForAllocationMemento(
4913 Register receiver_reg, 4919 Register receiver_reg,
4914 Register scratch_reg) { 4920 Register scratch_reg,
4915 Label no_memento_available; 4921 Label* no_memento_found) {
4916 ExternalReference new_space_start = 4922 ExternalReference new_space_start =
4917 ExternalReference::new_space_start(isolate()); 4923 ExternalReference::new_space_start(isolate());
4918 ExternalReference new_space_allocation_top = 4924 ExternalReference new_space_allocation_top =
4919 ExternalReference::new_space_allocation_top_address(isolate()); 4925 ExternalReference::new_space_allocation_top_address(isolate());
4920 4926
4921 lea(scratch_reg, Operand(receiver_reg, 4927 lea(scratch_reg, Operand(receiver_reg,
4922 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); 4928 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag));
4923 movq(kScratchRegister, new_space_start); 4929 movq(kScratchRegister, new_space_start);
4924 cmpq(scratch_reg, kScratchRegister); 4930 cmpq(scratch_reg, kScratchRegister);
4925 j(less, &no_memento_available); 4931 j(less, no_memento_found);
4926 cmpq(scratch_reg, ExternalOperand(new_space_allocation_top)); 4932 cmpq(scratch_reg, ExternalOperand(new_space_allocation_top));
4927 j(greater, &no_memento_available); 4933 j(greater, no_memento_found);
4928 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4934 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4929 Heap::kAllocationMementoMapRootIndex); 4935 Heap::kAllocationMementoMapRootIndex);
4930 bind(&no_memento_available);
4931 } 4936 }
4932 4937
4933 4938
4939 void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
4940 Register object,
4941 Register object_size) {
4942 FrameScope frame(this, StackFrame::EXIT);
4943 PushSafepointRegisters();
4944 PrepareCallCFunction(3);
4945 // In case object is rdx
4946 movq(kScratchRegister, object);
4947 movq(arg_reg_3, object_size);
4948 movq(arg_reg_2, kScratchRegister);
4949 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
4950 CallCFunction(
4951 ExternalReference::record_object_allocation_function(isolate), 3);
4952 PopSafepointRegisters();
4953 }
4954
4955
4956 void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
4957 Register object,
4958 int object_size) {
4959 FrameScope frame(this, StackFrame::EXIT);
4960 PushSafepointRegisters();
4961 PrepareCallCFunction(3);
4962 movq(arg_reg_2, object);
4963 movq(arg_reg_3, Immediate(object_size));
4964 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
4965 CallCFunction(
4966 ExternalReference::record_object_allocation_function(isolate), 3);
4967 PopSafepointRegisters();
4968 }
4969
4970
4934 } } // namespace v8::internal 4971 } } // namespace v8::internal
4935 4972
4936 #endif // V8_TARGET_ARCH_X64 4973 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698