| 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 Register data = a4; | 253 Register data = a4; |
| 254 Register holder = a2; | 254 Register holder = a2; |
| 255 Register api_function_address = a1; | 255 Register api_function_address = a1; |
| 256 | 256 |
| 257 // Put callee in place. | 257 // Put callee in place. |
| 258 __ LoadAccessor(callee, holder, accessor_index, | 258 __ LoadAccessor(callee, holder, accessor_index, |
| 259 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); | 259 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); |
| 260 | 260 |
| 261 // Put holder in place. | 261 // Put holder in place. |
| 262 CallOptimization::HolderLookup holder_lookup; | 262 CallOptimization::HolderLookup holder_lookup; |
| 263 Handle<JSObject> api_holder = | 263 int holder_depth = 0; |
| 264 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); | 264 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup, |
| 265 &holder_depth); |
| 265 switch (holder_lookup) { | 266 switch (holder_lookup) { |
| 266 case CallOptimization::kHolderIsReceiver: | 267 case CallOptimization::kHolderIsReceiver: |
| 267 __ Move(holder, receiver); | 268 __ Move(holder, receiver); |
| 268 break; | 269 break; |
| 269 case CallOptimization::kHolderFound: | 270 case CallOptimization::kHolderFound: |
| 270 __ li(holder, api_holder); | 271 __ ld(holder, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 272 __ ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); |
| 273 for (int i = 1; i < holder_depth; i++) { |
| 274 __ ld(holder, FieldMemOperand(holder, HeapObject::kMapOffset)); |
| 275 __ ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); |
| 276 } |
| 271 break; | 277 break; |
| 272 case CallOptimization::kHolderNotFound: | 278 case CallOptimization::kHolderNotFound: |
| 273 UNREACHABLE(); | 279 UNREACHABLE(); |
| 274 break; | 280 break; |
| 275 } | 281 } |
| 276 | 282 |
| 277 Isolate* isolate = masm->isolate(); | 283 Isolate* isolate = masm->isolate(); |
| 278 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 284 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 279 bool call_data_undefined = false; | 285 bool call_data_undefined = false; |
| 280 // Put call data in place. | 286 // Put call data in place. |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 // Return the generated code. | 740 // Return the generated code. |
| 735 return GetCode(kind(), Code::NORMAL, name); | 741 return GetCode(kind(), Code::NORMAL, name); |
| 736 } | 742 } |
| 737 | 743 |
| 738 | 744 |
| 739 #undef __ | 745 #undef __ |
| 740 } | 746 } |
| 741 } // namespace v8::internal | 747 } // namespace v8::internal |
| 742 | 748 |
| 743 #endif // V8_TARGET_ARCH_MIPS64 | 749 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |