| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 Register holder = ecx; | 168 Register holder = ecx; |
| 169 Register api_function_address = edx; | 169 Register api_function_address = edx; |
| 170 scratch = no_reg; | 170 scratch = no_reg; |
| 171 | 171 |
| 172 // Put callee in place. | 172 // Put callee in place. |
| 173 __ LoadAccessor(callee, accessor_holder, accessor_index, | 173 __ LoadAccessor(callee, accessor_holder, accessor_index, |
| 174 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); | 174 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); |
| 175 | 175 |
| 176 // Put holder in place. | 176 // Put holder in place. |
| 177 CallOptimization::HolderLookup holder_lookup; | 177 CallOptimization::HolderLookup holder_lookup; |
| 178 Handle<JSObject> api_holder = | 178 int holder_depth = 0; |
| 179 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); | 179 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup, |
| 180 &holder_depth); |
| 180 switch (holder_lookup) { | 181 switch (holder_lookup) { |
| 181 case CallOptimization::kHolderIsReceiver: | 182 case CallOptimization::kHolderIsReceiver: |
| 182 __ Move(holder, receiver); | 183 __ Move(holder, receiver); |
| 183 break; | 184 break; |
| 184 case CallOptimization::kHolderFound: | 185 case CallOptimization::kHolderFound: |
| 185 __ LoadHeapObject(holder, api_holder); | 186 __ mov(holder, FieldOperand(receiver, HeapObject::kMapOffset)); |
| 187 __ mov(holder, FieldOperand(holder, Map::kPrototypeOffset)); |
| 188 for (int i = 1; i < holder_depth; i++) { |
| 189 __ mov(holder, FieldOperand(holder, HeapObject::kMapOffset)); |
| 190 __ mov(holder, FieldOperand(holder, Map::kPrototypeOffset)); |
| 191 } |
| 186 break; | 192 break; |
| 187 case CallOptimization::kHolderNotFound: | 193 case CallOptimization::kHolderNotFound: |
| 188 UNREACHABLE(); | 194 UNREACHABLE(); |
| 189 break; | 195 break; |
| 190 } | 196 } |
| 191 | 197 |
| 192 Isolate* isolate = masm->isolate(); | 198 Isolate* isolate = masm->isolate(); |
| 193 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 199 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 194 bool call_data_undefined = false; | 200 bool call_data_undefined = false; |
| 195 // Put call data in place. | 201 // Put call data in place. |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 // Return the generated code. | 771 // Return the generated code. |
| 766 return GetCode(kind(), Code::NORMAL, name); | 772 return GetCode(kind(), Code::NORMAL, name); |
| 767 } | 773 } |
| 768 | 774 |
| 769 | 775 |
| 770 #undef __ | 776 #undef __ |
| 771 } | 777 } |
| 772 } // namespace v8::internal | 778 } // namespace v8::internal |
| 773 | 779 |
| 774 #endif // V8_TARGET_ARCH_X87 | 780 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |