| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2536 __ JumpIfSmi(receiver, miss); | 2536 __ JumpIfSmi(receiver, miss); |
| 2537 | 2537 |
| 2538 // Check that the maps haven't changed. | 2538 // Check that the maps haven't changed. |
| 2539 Register reg = | 2539 Register reg = |
| 2540 CheckPrototypes(object, receiver, holder, scratch1, | 2540 CheckPrototypes(object, receiver, holder, scratch1, |
| 2541 scratch2, scratch3, name, miss); | 2541 scratch2, scratch3, name, miss); |
| 2542 | 2542 |
| 2543 Handle<AccessorInfo> callback_handle(callback); | 2543 Handle<AccessorInfo> callback_handle(callback); |
| 2544 | 2544 |
| 2545 __ EnterInternalFrame(); | 2545 __ EnterInternalFrame(); |
| 2546 __ PushHandleScope(scratch2); | |
| 2547 // Push the stack address where the list of arguments ends. | 2546 // Push the stack address where the list of arguments ends. |
| 2548 __ movq(scratch2, rsp); | 2547 __ movq(scratch2, rsp); |
| 2549 __ subq(scratch2, Immediate(2 * kPointerSize)); | 2548 __ subq(scratch2, Immediate(2 * kPointerSize)); |
| 2550 __ push(scratch2); | 2549 __ push(scratch2); |
| 2551 __ push(receiver); // receiver | 2550 __ push(receiver); // receiver |
| 2552 __ push(reg); // holder | 2551 __ push(reg); // holder |
| 2553 if (Heap::InNewSpace(callback_handle->data())) { | 2552 if (Heap::InNewSpace(callback_handle->data())) { |
| 2554 __ Move(scratch2, callback_handle); | 2553 __ Move(scratch2, callback_handle); |
| 2555 __ push(FieldOperand(scratch2, AccessorInfo::kDataOffset)); // data | 2554 __ push(FieldOperand(scratch2, AccessorInfo::kDataOffset)); // data |
| 2556 } else { | 2555 } else { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2590 // object. | 2589 // object. |
| 2591 Object* result = masm()->TryCallStub(&stub); | 2590 Object* result = masm()->TryCallStub(&stub); |
| 2592 if (result->IsFailure()) { | 2591 if (result->IsFailure()) { |
| 2593 *failure = Failure::cast(result); | 2592 *failure = Failure::cast(result); |
| 2594 return false; | 2593 return false; |
| 2595 } | 2594 } |
| 2596 #ifdef _WIN64 | 2595 #ifdef _WIN64 |
| 2597 // Discard allocated slot. | 2596 // Discard allocated slot. |
| 2598 __ addq(rsp, Immediate(kPointerSize)); | 2597 __ addq(rsp, Immediate(kPointerSize)); |
| 2599 #endif | 2598 #endif |
| 2600 | |
| 2601 // We need to avoid using rax since that now holds the result. | |
| 2602 Register tmp = scratch2.is(rax) ? reg : scratch2; | |
| 2603 // Emitting PopHandleScope may try to allocate. Do not allow the | |
| 2604 // assembler to perform a garbage collection but instead return a | |
| 2605 // failure object. | |
| 2606 result = masm()->TryPopHandleScope(rax, tmp); | |
| 2607 if (result->IsFailure()) { | |
| 2608 *failure = Failure::cast(result); | |
| 2609 return false; | |
| 2610 } | |
| 2611 __ LeaveInternalFrame(); | 2599 __ LeaveInternalFrame(); |
| 2612 | 2600 |
| 2613 __ ret(0); | 2601 __ ret(0); |
| 2614 | 2602 |
| 2615 return true; | 2603 return true; |
| 2616 } | 2604 } |
| 2617 | 2605 |
| 2618 | 2606 |
| 2619 Register StubCompiler::CheckPrototypes(JSObject* object, | 2607 Register StubCompiler::CheckPrototypes(JSObject* object, |
| 2620 Register object_reg, | 2608 Register object_reg, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2934 // Return the generated code. | 2922 // Return the generated code. |
| 2935 return GetCode(); | 2923 return GetCode(); |
| 2936 } | 2924 } |
| 2937 | 2925 |
| 2938 | 2926 |
| 2939 #undef __ | 2927 #undef __ |
| 2940 | 2928 |
| 2941 } } // namespace v8::internal | 2929 } } // namespace v8::internal |
| 2942 | 2930 |
| 2943 #endif // V8_TARGET_ARCH_X64 | 2931 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |