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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // -- rsp[(argc + 5) * 8] : receiver | 465 // -- rsp[(argc + 5) * 8] : receiver |
466 // ----------------------------------- | 466 // ----------------------------------- |
467 // Get the function and setup the context. | 467 // Get the function and setup the context. |
468 Handle<JSFunction> function = optimization.constant_function(); | 468 Handle<JSFunction> function = optimization.constant_function(); |
469 __ LoadHeapObject(rdi, function); | 469 __ LoadHeapObject(rdi, function); |
470 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 470 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
471 | 471 |
472 // Pass the additional arguments. | 472 // Pass the additional arguments. |
473 __ movq(Operand(rsp, 2 * kPointerSize), rdi); | 473 __ movq(Operand(rsp, 2 * kPointerSize), rdi); |
474 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 474 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
475 Handle<Object> call_data(api_call_info->data()); | 475 Handle<Object> call_data(api_call_info->data(), masm->isolate()); |
476 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 476 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
477 __ Move(rcx, api_call_info); | 477 __ Move(rcx, api_call_info); |
478 __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset)); | 478 __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset)); |
479 __ movq(Operand(rsp, 3 * kPointerSize), rbx); | 479 __ movq(Operand(rsp, 3 * kPointerSize), rbx); |
480 } else { | 480 } else { |
481 __ Move(Operand(rsp, 3 * kPointerSize), call_data); | 481 __ Move(Operand(rsp, 3 * kPointerSize), call_data); |
482 } | 482 } |
483 __ movq(kScratchRegister, ExternalReference::isolate_address()); | 483 __ movq(kScratchRegister, ExternalReference::isolate_address()); |
484 __ movq(Operand(rsp, 4 * kPointerSize), kScratchRegister); | 484 __ movq(Operand(rsp, 4 * kPointerSize), kScratchRegister); |
485 | 485 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 // Insert additional parameters into the stack frame above return address. | 1113 // Insert additional parameters into the stack frame above return address. |
1114 ASSERT(!scratch2.is(reg)); | 1114 ASSERT(!scratch2.is(reg)); |
1115 __ pop(scratch2); // Get return address to place it below. | 1115 __ pop(scratch2); // Get return address to place it below. |
1116 | 1116 |
1117 __ push(receiver); // receiver | 1117 __ push(receiver); // receiver |
1118 __ push(reg); // holder | 1118 __ push(reg); // holder |
1119 if (heap()->InNewSpace(callback->data())) { | 1119 if (heap()->InNewSpace(callback->data())) { |
1120 __ Move(scratch1, callback); | 1120 __ Move(scratch1, callback); |
1121 __ push(FieldOperand(scratch1, ExecutableAccessorInfo::kDataOffset)); | 1121 __ push(FieldOperand(scratch1, ExecutableAccessorInfo::kDataOffset)); |
1122 } else { | 1122 } else { |
1123 __ Push(Handle<Object>(callback->data())); | 1123 __ Push(Handle<Object>(callback->data(), isolate())); |
1124 } | 1124 } |
1125 __ PushAddress(ExternalReference::isolate_address()); // isolate | 1125 __ PushAddress(ExternalReference::isolate_address()); // isolate |
1126 __ push(name_reg); // name | 1126 __ push(name_reg); // name |
1127 // Save a pointer to where we pushed the arguments pointer. | 1127 // Save a pointer to where we pushed the arguments pointer. |
1128 // This will be passed as the const AccessorInfo& to the C++ callback. | 1128 // This will be passed as the const AccessorInfo& to the C++ callback. |
1129 | 1129 |
1130 #if defined(__MINGW64__) | 1130 #if defined(__MINGW64__) |
1131 Register accessor_info_arg = rdx; | 1131 Register accessor_info_arg = rdx; |
1132 Register name_arg = rcx; | 1132 Register name_arg = rcx; |
1133 #elif defined(_WIN64) | 1133 #elif defined(_WIN64) |
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3108 // If argument is not passed the property is set to undefined, | 3108 // If argument is not passed the property is set to undefined, |
3109 // otherwise find it on the stack. | 3109 // otherwise find it on the stack. |
3110 int arg_number = shared->GetThisPropertyAssignmentArgument(i); | 3110 int arg_number = shared->GetThisPropertyAssignmentArgument(i); |
3111 __ movq(rbx, r8); | 3111 __ movq(rbx, r8); |
3112 __ cmpq(rax, Immediate(arg_number)); | 3112 __ cmpq(rax, Immediate(arg_number)); |
3113 __ cmovq(above, rbx, Operand(rcx, arg_number * -kPointerSize)); | 3113 __ cmovq(above, rbx, Operand(rcx, arg_number * -kPointerSize)); |
3114 // Store value in the property. | 3114 // Store value in the property. |
3115 __ movq(Operand(r9, i * kPointerSize), rbx); | 3115 __ movq(Operand(r9, i * kPointerSize), rbx); |
3116 } else { | 3116 } else { |
3117 // Set the property to the constant value. | 3117 // Set the property to the constant value. |
3118 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i)); | 3118 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i), |
| 3119 isolate()); |
3119 __ Move(Operand(r9, i * kPointerSize), constant); | 3120 __ Move(Operand(r9, i * kPointerSize), constant); |
3120 } | 3121 } |
3121 } | 3122 } |
3122 | 3123 |
3123 // Fill the unused in-object property fields with undefined. | 3124 // Fill the unused in-object property fields with undefined. |
3124 for (int i = shared->this_property_assignments_count(); | 3125 for (int i = shared->this_property_assignments_count(); |
3125 i < function->initial_map()->inobject_properties(); | 3126 i < function->initial_map()->inobject_properties(); |
3126 i++) { | 3127 i++) { |
3127 __ movq(Operand(r9, i * kPointerSize), r8); | 3128 __ movq(Operand(r9, i * kPointerSize), r8); |
3128 } | 3129 } |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3695 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 3696 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
3696 } | 3697 } |
3697 } | 3698 } |
3698 | 3699 |
3699 | 3700 |
3700 #undef __ | 3701 #undef __ |
3701 | 3702 |
3702 } } // namespace v8::internal | 3703 } } // namespace v8::internal |
3703 | 3704 |
3704 #endif // V8_TARGET_ARCH_X64 | 3705 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |