| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
| 10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1())); | 687 DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1())); |
| 688 | 688 |
| 689 // Preserve the receiver register explicitly whenever it is different from the | 689 // Preserve the receiver register explicitly whenever it is different from the |
| 690 // holder and it is needed should the interceptor return without any result. | 690 // holder and it is needed should the interceptor return without any result. |
| 691 // The ACCESSOR case needs the receiver to be passed into C++ code, the FIELD | 691 // The ACCESSOR case needs the receiver to be passed into C++ code, the FIELD |
| 692 // case might cause a miss during the prototype check. | 692 // case might cause a miss during the prototype check. |
| 693 bool must_perform_prototype_check = | 693 bool must_perform_prototype_check = |
| 694 !holder().is_identical_to(it->GetHolder<JSObject>()); | 694 !holder().is_identical_to(it->GetHolder<JSObject>()); |
| 695 bool must_preserve_receiver_reg = | 695 bool must_preserve_receiver_reg = |
| 696 !receiver().is(holder_reg) && | 696 !receiver().is(holder_reg) && |
| 697 (it->property_kind() == LookupIterator::ACCESSOR || | 697 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); |
| 698 must_perform_prototype_check); | |
| 699 | 698 |
| 700 // Save necessary data before invoking an interceptor. | 699 // Save necessary data before invoking an interceptor. |
| 701 // Requires a frame to make GC aware of pushed pointers. | 700 // Requires a frame to make GC aware of pushed pointers. |
| 702 { | 701 { |
| 703 FrameScope frame_scope(masm(), StackFrame::INTERNAL); | 702 FrameScope frame_scope(masm(), StackFrame::INTERNAL); |
| 704 | 703 |
| 705 if (must_preserve_receiver_reg) { | 704 if (must_preserve_receiver_reg) { |
| 706 __ Push(receiver()); | 705 __ Push(receiver()); |
| 707 } | 706 } |
| 708 __ Push(holder_reg); | 707 __ Push(holder_reg); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 // Return the generated code. | 826 // Return the generated code. |
| 828 return GetCode(kind(), Code::NORMAL, name); | 827 return GetCode(kind(), Code::NORMAL, name); |
| 829 } | 828 } |
| 830 | 829 |
| 831 | 830 |
| 832 #undef __ | 831 #undef __ |
| 833 } | 832 } |
| 834 } // namespace v8::internal | 833 } // namespace v8::internal |
| 835 | 834 |
| 836 #endif // V8_TARGET_ARCH_X64 | 835 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |