| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 Register holder = rcx; | 154 Register holder = rcx; |
| 155 Register api_function_address = rdx; | 155 Register api_function_address = rdx; |
| 156 scratch = no_reg; | 156 scratch = no_reg; |
| 157 | 157 |
| 158 // Put callee in place. | 158 // Put callee in place. |
| 159 __ LoadAccessor(callee, accessor_holder, accessor_index, | 159 __ LoadAccessor(callee, accessor_holder, accessor_index, |
| 160 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); | 160 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); |
| 161 | 161 |
| 162 // Put holder in place. | 162 // Put holder in place. |
| 163 CallOptimization::HolderLookup holder_lookup; | 163 CallOptimization::HolderLookup holder_lookup; |
| 164 Handle<JSObject> api_holder = | 164 int holder_depth = 0; |
| 165 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); | 165 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup, |
| 166 &holder_depth); |
| 166 switch (holder_lookup) { | 167 switch (holder_lookup) { |
| 167 case CallOptimization::kHolderIsReceiver: | 168 case CallOptimization::kHolderIsReceiver: |
| 168 __ Move(holder, receiver); | 169 __ Move(holder, receiver); |
| 169 break; | 170 break; |
| 170 case CallOptimization::kHolderFound: | 171 case CallOptimization::kHolderFound: |
| 171 __ Move(holder, api_holder); | 172 __ movp(holder, FieldOperand(receiver, HeapObject::kMapOffset)); |
| 173 __ movp(holder, FieldOperand(holder, Map::kPrototypeOffset)); |
| 174 for (int i = 1; i < holder_depth; i++) { |
| 175 __ movp(holder, FieldOperand(holder, HeapObject::kMapOffset)); |
| 176 __ movp(holder, FieldOperand(holder, Map::kPrototypeOffset)); |
| 177 } |
| 172 break; | 178 break; |
| 173 case CallOptimization::kHolderNotFound: | 179 case CallOptimization::kHolderNotFound: |
| 174 UNREACHABLE(); | 180 UNREACHABLE(); |
| 175 break; | 181 break; |
| 176 } | 182 } |
| 177 | 183 |
| 178 Isolate* isolate = masm->isolate(); | 184 Isolate* isolate = masm->isolate(); |
| 179 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 185 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 180 bool call_data_undefined = false; | 186 bool call_data_undefined = false; |
| 181 // Put call data in place. | 187 // Put call data in place. |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 // Return the generated code. | 758 // Return the generated code. |
| 753 return GetCode(kind(), Code::NORMAL, name); | 759 return GetCode(kind(), Code::NORMAL, name); |
| 754 } | 760 } |
| 755 | 761 |
| 756 | 762 |
| 757 #undef __ | 763 #undef __ |
| 758 } | 764 } |
| 759 } // namespace v8::internal | 765 } // namespace v8::internal |
| 760 | 766 |
| 761 #endif // V8_TARGET_ARCH_X64 | 767 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |