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