OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4042 // rax is object map. | 4042 // rax is object map. |
4043 // rdx is function. | 4043 // rdx is function. |
4044 // rbx is function prototype. | 4044 // rbx is function prototype. |
4045 if (!HasCallSiteInlineCheck()) { | 4045 if (!HasCallSiteInlineCheck()) { |
4046 __ StoreRoot(rdx, Heap::kInstanceofCacheFunctionRootIndex); | 4046 __ StoreRoot(rdx, Heap::kInstanceofCacheFunctionRootIndex); |
4047 __ StoreRoot(rax, Heap::kInstanceofCacheMapRootIndex); | 4047 __ StoreRoot(rax, Heap::kInstanceofCacheMapRootIndex); |
4048 } else { | 4048 } else { |
4049 // Get return address and delta to inlined map check. | 4049 // Get return address and delta to inlined map check. |
4050 __ movq(kScratchRegister, Operand(rsp, 0 * kPointerSize)); | 4050 __ movq(kScratchRegister, Operand(rsp, 0 * kPointerSize)); |
4051 __ subq(kScratchRegister, Operand(rsp, 1 * kPointerSize)); | 4051 __ subq(kScratchRegister, Operand(rsp, 1 * kPointerSize)); |
4052 __ movq(Operand(kScratchRegister, kOffsetToMapCheckValue), rax); | |
4053 if (FLAG_debug_code) { | 4052 if (FLAG_debug_code) { |
4054 __ movl(rdi, Immediate(kWordBeforeMapCheckValue)); | 4053 __ movl(rdi, Immediate(kWordBeforeMapCheckValue)); |
4055 __ cmpl(Operand(kScratchRegister, kOffsetToMapCheckValue - 4), rdi); | 4054 __ cmpl(Operand(kScratchRegister, kOffsetToMapCheckValue - 4), rdi); |
4056 __ Assert(equal, "InstanceofStub unexpected call site cache (check)."); | 4055 __ Assert(equal, "InstanceofStub unexpected call site cache (check)."); |
4057 } | 4056 } |
| 4057 __ movq(kScratchRegister, |
| 4058 Operand(kScratchRegister, kOffsetToMapCheckValue)); |
| 4059 __ movq(Operand(kScratchRegister, 0), rax); |
4058 } | 4060 } |
4059 | 4061 |
4060 __ movq(rcx, FieldOperand(rax, Map::kPrototypeOffset)); | 4062 __ movq(rcx, FieldOperand(rax, Map::kPrototypeOffset)); |
4061 | 4063 |
4062 // Loop through the prototype chain looking for the function prototype. | 4064 // Loop through the prototype chain looking for the function prototype. |
4063 Label loop, is_instance, is_not_instance; | 4065 Label loop, is_instance, is_not_instance; |
4064 __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex); | 4066 __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex); |
4065 __ bind(&loop); | 4067 __ bind(&loop); |
4066 __ cmpq(rcx, rbx); | 4068 __ cmpq(rcx, rbx); |
4067 __ j(equal, &is_instance, Label::kNear); | 4069 __ j(equal, &is_instance, Label::kNear); |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6093 xmm0, | 6095 xmm0, |
6094 &slow_elements); | 6096 &slow_elements); |
6095 __ ret(0); | 6097 __ ret(0); |
6096 } | 6098 } |
6097 | 6099 |
6098 #undef __ | 6100 #undef __ |
6099 | 6101 |
6100 } } // namespace v8::internal | 6102 } } // namespace v8::internal |
6101 | 6103 |
6102 #endif // V8_TARGET_ARCH_X64 | 6104 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |