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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 Register name, | 372 Register name, |
373 Handle<JSObject> holder_obj) { | 373 Handle<JSObject> holder_obj) { |
374 __ push(name); | 374 __ push(name); |
375 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); | 375 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); |
376 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); | 376 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); |
377 __ Move(kScratchRegister, interceptor); | 377 __ Move(kScratchRegister, interceptor); |
378 __ push(kScratchRegister); | 378 __ push(kScratchRegister); |
379 __ push(receiver); | 379 __ push(receiver); |
380 __ push(holder); | 380 __ push(holder); |
381 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset)); | 381 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset)); |
382 __ movq(kScratchRegister, ExternalReference::isolate_address()); | 382 __ PushAddress(ExternalReference::isolate_address()); |
383 __ push(kScratchRegister); | |
384 } | 383 } |
385 | 384 |
386 | 385 |
387 static void CompileCallLoadPropertyWithInterceptor( | 386 static void CompileCallLoadPropertyWithInterceptor( |
388 MacroAssembler* masm, | 387 MacroAssembler* masm, |
389 Register receiver, | 388 Register receiver, |
390 Register holder, | 389 Register holder, |
391 Register name, | 390 Register name, |
392 Handle<JSObject> holder_obj) { | 391 Handle<JSObject> holder_obj) { |
393 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 392 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 __ movq(Operand(rsp, 3 * kPointerSize), rbx); | 474 __ movq(Operand(rsp, 3 * kPointerSize), rbx); |
476 } else { | 475 } else { |
477 __ Move(Operand(rsp, 3 * kPointerSize), call_data); | 476 __ Move(Operand(rsp, 3 * kPointerSize), call_data); |
478 } | 477 } |
479 __ movq(kScratchRegister, ExternalReference::isolate_address()); | 478 __ movq(kScratchRegister, ExternalReference::isolate_address()); |
480 __ movq(Operand(rsp, 4 * kPointerSize), kScratchRegister); | 479 __ movq(Operand(rsp, 4 * kPointerSize), kScratchRegister); |
481 | 480 |
482 // Prepare arguments. | 481 // Prepare arguments. |
483 __ lea(rbx, Operand(rsp, 4 * kPointerSize)); | 482 __ lea(rbx, Operand(rsp, 4 * kPointerSize)); |
484 | 483 |
485 #ifdef _WIN64 | 484 #if defined(__MINGW64__) |
| 485 Register arguments_arg = rcx; |
| 486 #elif defined(_WIN64) |
486 // Win64 uses first register--rcx--for returned value. | 487 // Win64 uses first register--rcx--for returned value. |
487 Register arguments_arg = rdx; | 488 Register arguments_arg = rdx; |
488 #else | 489 #else |
489 Register arguments_arg = rdi; | 490 Register arguments_arg = rdi; |
490 #endif | 491 #endif |
491 | 492 |
492 // Allocate the v8::Arguments structure in the arguments' space since | 493 // Allocate the v8::Arguments structure in the arguments' space since |
493 // it's not controlled by GC. | 494 // it's not controlled by GC. |
494 const int kApiStackSpace = 4; | 495 const int kApiStackSpace = 4; |
495 | 496 |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 __ pop(scratch2); // Get return address to place it below. | 1004 __ pop(scratch2); // Get return address to place it below. |
1004 | 1005 |
1005 __ push(receiver); // receiver | 1006 __ push(receiver); // receiver |
1006 __ push(reg); // holder | 1007 __ push(reg); // holder |
1007 if (heap()->InNewSpace(callback->data())) { | 1008 if (heap()->InNewSpace(callback->data())) { |
1008 __ Move(scratch1, callback); | 1009 __ Move(scratch1, callback); |
1009 __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset)); // data | 1010 __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset)); // data |
1010 } else { | 1011 } else { |
1011 __ Push(Handle<Object>(callback->data())); | 1012 __ Push(Handle<Object>(callback->data())); |
1012 } | 1013 } |
1013 __ movq(kScratchRegister, ExternalReference::isolate_address()); | 1014 __ PushAddress(ExternalReference::isolate_address()); // isolate |
1014 __ push(kScratchRegister); // isolate | |
1015 __ push(name_reg); // name | 1015 __ push(name_reg); // name |
1016 // Save a pointer to where we pushed the arguments pointer. | 1016 // Save a pointer to where we pushed the arguments pointer. |
1017 // This will be passed as the const AccessorInfo& to the C++ callback. | 1017 // This will be passed as the const AccessorInfo& to the C++ callback. |
1018 | 1018 |
1019 #ifdef _WIN64 | 1019 #if defined(__MINGW64__) |
| 1020 Register accessor_info_arg = rdx; |
| 1021 Register name_arg = rcx; |
| 1022 #elif defined(_WIN64) |
1020 // Win64 uses first register--rcx--for returned value. | 1023 // Win64 uses first register--rcx--for returned value. |
1021 Register accessor_info_arg = r8; | 1024 Register accessor_info_arg = r8; |
1022 Register name_arg = rdx; | 1025 Register name_arg = rdx; |
1023 #else | 1026 #else |
1024 Register accessor_info_arg = rsi; | 1027 Register accessor_info_arg = rsi; |
1025 Register name_arg = rdi; | 1028 Register name_arg = rdi; |
1026 #endif | 1029 #endif |
1027 | 1030 |
1028 ASSERT(!name_arg.is(scratch2)); | 1031 ASSERT(!name_arg.is(scratch2)); |
1029 __ movq(name_arg, rsp); | 1032 __ movq(name_arg, rsp); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 ASSERT(callback->getter() != NULL); | 1182 ASSERT(callback->getter() != NULL); |
1180 | 1183 |
1181 // Tail call to runtime. | 1184 // Tail call to runtime. |
1182 // Important invariant in CALLBACKS case: the code above must be | 1185 // Important invariant in CALLBACKS case: the code above must be |
1183 // structured to never clobber |receiver| register. | 1186 // structured to never clobber |receiver| register. |
1184 __ pop(scratch2); // return address | 1187 __ pop(scratch2); // return address |
1185 __ push(receiver); | 1188 __ push(receiver); |
1186 __ push(holder_reg); | 1189 __ push(holder_reg); |
1187 __ Move(holder_reg, callback); | 1190 __ Move(holder_reg, callback); |
1188 __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset)); | 1191 __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset)); |
1189 __ movq(kScratchRegister, ExternalReference::isolate_address()); | 1192 __ PushAddress(ExternalReference::isolate_address()); |
1190 __ push(kScratchRegister); | |
1191 __ push(holder_reg); | 1193 __ push(holder_reg); |
1192 __ push(name_reg); | 1194 __ push(name_reg); |
1193 __ push(scratch2); // restore return address | 1195 __ push(scratch2); // restore return address |
1194 | 1196 |
1195 ExternalReference ref = | 1197 ExternalReference ref = |
1196 ExternalReference(IC_Utility(IC::kLoadCallbackProperty), | 1198 ExternalReference(IC_Utility(IC::kLoadCallbackProperty), |
1197 isolate()); | 1199 isolate()); |
1198 __ TailCallExternalReference(ref, 6, 1); | 1200 __ TailCallExternalReference(ref, 6, 1); |
1199 } | 1201 } |
1200 } else { // !compile_followup_inline | 1202 } else { // !compile_followup_inline |
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3823 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 3825 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
3824 } | 3826 } |
3825 } | 3827 } |
3826 | 3828 |
3827 | 3829 |
3828 #undef __ | 3830 #undef __ |
3829 | 3831 |
3830 } } // namespace v8::internal | 3832 } } // namespace v8::internal |
3831 | 3833 |
3832 #endif // V8_TARGET_ARCH_X64 | 3834 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |