| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 __ bind(&patch); | 519 __ bind(&patch); |
| 520 GenerateTypeTransition(masm); | 520 GenerateTypeTransition(masm); |
| 521 } | 521 } |
| 522 | 522 |
| 523 | 523 |
| 524 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { | 524 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
| 525 __ PushCallerSaved(save_doubles_); | 525 __ PushCallerSaved(save_doubles_); |
| 526 const int argument_count = 1; | 526 const int argument_count = 1; |
| 527 __ PrepareCallCFunction(argument_count); | 527 __ PrepareCallCFunction(argument_count); |
| 528 #ifdef _WIN64 | 528 #ifdef _WIN64 |
| 529 __ LoadAddress(rcx, ExternalReference::isolate_address()); | 529 __ LoadAddress(rcx, ExternalReference::isolate_address(masm->isolate())); |
| 530 #else | 530 #else |
| 531 __ LoadAddress(rdi, ExternalReference::isolate_address()); | 531 __ LoadAddress(rdi, ExternalReference::isolate_address(masm->isolate())); |
| 532 #endif | 532 #endif |
| 533 | 533 |
| 534 AllowExternalCallThatCantCauseGC scope(masm); | 534 AllowExternalCallThatCantCauseGC scope(masm); |
| 535 __ CallCFunction( | 535 __ CallCFunction( |
| 536 ExternalReference::store_buffer_overflow_function(masm->isolate()), | 536 ExternalReference::store_buffer_overflow_function(masm->isolate()), |
| 537 argument_count); | 537 argument_count); |
| 538 __ PopCallerSaved(save_doubles_); | 538 __ PopCallerSaved(save_doubles_); |
| 539 __ ret(0); | 539 __ ret(0); |
| 540 } | 540 } |
| 541 | 541 |
| (...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2972 Counters* counters = masm->isolate()->counters(); | 2972 Counters* counters = masm->isolate()->counters(); |
| 2973 __ IncrementCounter(counters->regexp_entry_native(), 1); | 2973 __ IncrementCounter(counters->regexp_entry_native(), 1); |
| 2974 | 2974 |
| 2975 // Isolates: note we add an additional parameter here (isolate pointer). | 2975 // Isolates: note we add an additional parameter here (isolate pointer). |
| 2976 static const int kRegExpExecuteArguments = 9; | 2976 static const int kRegExpExecuteArguments = 9; |
| 2977 int argument_slots_on_stack = | 2977 int argument_slots_on_stack = |
| 2978 masm->ArgumentStackSlotsForCFunctionCall(kRegExpExecuteArguments); | 2978 masm->ArgumentStackSlotsForCFunctionCall(kRegExpExecuteArguments); |
| 2979 __ EnterApiExitFrame(argument_slots_on_stack); | 2979 __ EnterApiExitFrame(argument_slots_on_stack); |
| 2980 | 2980 |
| 2981 // Argument 9: Pass current isolate address. | 2981 // Argument 9: Pass current isolate address. |
| 2982 // __ movq(Operand(rsp, (argument_slots_on_stack - 1) * kPointerSize), | 2982 __ LoadAddress(kScratchRegister, |
| 2983 // Immediate(ExternalReference::isolate_address())); | 2983 ExternalReference::isolate_address(masm->isolate())); |
| 2984 __ LoadAddress(kScratchRegister, ExternalReference::isolate_address()); | |
| 2985 __ movq(Operand(rsp, (argument_slots_on_stack - 1) * kPointerSize), | 2984 __ movq(Operand(rsp, (argument_slots_on_stack - 1) * kPointerSize), |
| 2986 kScratchRegister); | 2985 kScratchRegister); |
| 2987 | 2986 |
| 2988 // Argument 8: Indicate that this is a direct call from JavaScript. | 2987 // Argument 8: Indicate that this is a direct call from JavaScript. |
| 2989 __ movq(Operand(rsp, (argument_slots_on_stack - 2) * kPointerSize), | 2988 __ movq(Operand(rsp, (argument_slots_on_stack - 2) * kPointerSize), |
| 2990 Immediate(1)); | 2989 Immediate(1)); |
| 2991 | 2990 |
| 2992 // Argument 7: Start (high end) of backtracking stack memory area. | 2991 // Argument 7: Start (high end) of backtracking stack memory area. |
| 2993 __ movq(kScratchRegister, address_of_regexp_stack_memory_address); | 2992 __ movq(kScratchRegister, address_of_regexp_stack_memory_address); |
| 2994 __ movq(r9, Operand(kScratchRegister, 0)); | 2993 __ movq(r9, Operand(kScratchRegister, 0)); |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4110 // Call C function. | 4109 // Call C function. |
| 4111 #ifdef _WIN64 | 4110 #ifdef _WIN64 |
| 4112 // Windows 64-bit ABI passes arguments in rcx, rdx, r8, r9 | 4111 // Windows 64-bit ABI passes arguments in rcx, rdx, r8, r9 |
| 4113 // Store Arguments object on stack, below the 4 WIN64 ABI parameter slots. | 4112 // Store Arguments object on stack, below the 4 WIN64 ABI parameter slots. |
| 4114 __ movq(StackSpaceOperand(0), r14); // argc. | 4113 __ movq(StackSpaceOperand(0), r14); // argc. |
| 4115 __ movq(StackSpaceOperand(1), r15); // argv. | 4114 __ movq(StackSpaceOperand(1), r15); // argv. |
| 4116 if (result_size_ < 2) { | 4115 if (result_size_ < 2) { |
| 4117 // Pass a pointer to the Arguments object as the first argument. | 4116 // Pass a pointer to the Arguments object as the first argument. |
| 4118 // Return result in single register (rax). | 4117 // Return result in single register (rax). |
| 4119 __ lea(rcx, StackSpaceOperand(0)); | 4118 __ lea(rcx, StackSpaceOperand(0)); |
| 4120 __ LoadAddress(rdx, ExternalReference::isolate_address()); | 4119 __ LoadAddress(rdx, ExternalReference::isolate_address(masm->isolate())); |
| 4121 } else { | 4120 } else { |
| 4122 ASSERT_EQ(2, result_size_); | 4121 ASSERT_EQ(2, result_size_); |
| 4123 // Pass a pointer to the result location as the first argument. | 4122 // Pass a pointer to the result location as the first argument. |
| 4124 __ lea(rcx, StackSpaceOperand(2)); | 4123 __ lea(rcx, StackSpaceOperand(2)); |
| 4125 // Pass a pointer to the Arguments object as the second argument. | 4124 // Pass a pointer to the Arguments object as the second argument. |
| 4126 __ lea(rdx, StackSpaceOperand(0)); | 4125 __ lea(rdx, StackSpaceOperand(0)); |
| 4127 __ LoadAddress(r8, ExternalReference::isolate_address()); | 4126 __ LoadAddress(r8, ExternalReference::isolate_address(masm->isolate())); |
| 4128 } | 4127 } |
| 4129 | 4128 |
| 4130 #else // _WIN64 | 4129 #else // _WIN64 |
| 4131 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9. | 4130 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9. |
| 4132 __ movq(rdi, r14); // argc. | 4131 __ movq(rdi, r14); // argc. |
| 4133 __ movq(rsi, r15); // argv. | 4132 __ movq(rsi, r15); // argv. |
| 4134 __ movq(rdx, ExternalReference::isolate_address()); | 4133 __ movq(rdx, ExternalReference::isolate_address(masm->isolate())); |
| 4135 #endif | 4134 #endif |
| 4136 __ call(rbx); | 4135 __ call(rbx); |
| 4137 // Result is in rax - do not destroy this register! | 4136 // Result is in rax - do not destroy this register! |
| 4138 | 4137 |
| 4139 if (always_allocate_scope) { | 4138 if (always_allocate_scope) { |
| 4140 Operand scope_depth_operand = masm->ExternalOperand(scope_depth); | 4139 Operand scope_depth_operand = masm->ExternalOperand(scope_depth); |
| 4141 __ decl(scope_depth_operand); | 4140 __ decl(scope_depth_operand); |
| 4142 } | 4141 } |
| 4143 | 4142 |
| 4144 // Check for failure result. | 4143 // Check for failure result. |
| (...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6492 Register arg1 = rdi; | 6491 Register arg1 = rdi; |
| 6493 #endif | 6492 #endif |
| 6494 Register address = | 6493 Register address = |
| 6495 arg1.is(regs_.address()) ? kScratchRegister : regs_.address(); | 6494 arg1.is(regs_.address()) ? kScratchRegister : regs_.address(); |
| 6496 ASSERT(!address.is(regs_.object())); | 6495 ASSERT(!address.is(regs_.object())); |
| 6497 ASSERT(!address.is(arg1)); | 6496 ASSERT(!address.is(arg1)); |
| 6498 __ Move(address, regs_.address()); | 6497 __ Move(address, regs_.address()); |
| 6499 __ Move(arg1, regs_.object()); | 6498 __ Move(arg1, regs_.object()); |
| 6500 // TODO(gc) Can we just set address arg2 in the beginning? | 6499 // TODO(gc) Can we just set address arg2 in the beginning? |
| 6501 __ Move(arg2, address); | 6500 __ Move(arg2, address); |
| 6502 __ LoadAddress(arg3, ExternalReference::isolate_address()); | 6501 __ LoadAddress(arg3, ExternalReference::isolate_address(masm->isolate())); |
| 6503 int argument_count = 3; | 6502 int argument_count = 3; |
| 6504 | 6503 |
| 6505 AllowExternalCallThatCantCauseGC scope(masm); | 6504 AllowExternalCallThatCantCauseGC scope(masm); |
| 6506 __ PrepareCallCFunction(argument_count); | 6505 __ PrepareCallCFunction(argument_count); |
| 6507 if (mode == INCREMENTAL_COMPACTION) { | 6506 if (mode == INCREMENTAL_COMPACTION) { |
| 6508 __ CallCFunction( | 6507 __ CallCFunction( |
| 6509 ExternalReference::incremental_evacuation_record_write_function( | 6508 ExternalReference::incremental_evacuation_record_write_function( |
| 6510 masm->isolate()), | 6509 masm->isolate()), |
| 6511 argument_count); | 6510 argument_count); |
| 6512 } else { | 6511 } else { |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6768 #endif | 6767 #endif |
| 6769 | 6768 |
| 6770 __ Ret(); | 6769 __ Ret(); |
| 6771 } | 6770 } |
| 6772 | 6771 |
| 6773 #undef __ | 6772 #undef __ |
| 6774 | 6773 |
| 6775 } } // namespace v8::internal | 6774 } } // namespace v8::internal |
| 6776 | 6775 |
| 6777 #endif // V8_TARGET_ARCH_X64 | 6776 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |