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 4234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4245 ASSERT(!ReturnTrueFalseObject() || HasCallSiteInlineCheck()); | 4245 ASSERT(!ReturnTrueFalseObject() || HasCallSiteInlineCheck()); |
4246 | 4246 |
4247 // Fixed register usage throughout the stub: | 4247 // Fixed register usage throughout the stub: |
4248 const Register object = a0; // Object (lhs). | 4248 const Register object = a0; // Object (lhs). |
4249 Register map = a3; // Map of the object. | 4249 Register map = a3; // Map of the object. |
4250 const Register function = a1; // Function (rhs). | 4250 const Register function = a1; // Function (rhs). |
4251 const Register prototype = t0; // Prototype of the function. | 4251 const Register prototype = t0; // Prototype of the function. |
4252 const Register inline_site = t5; | 4252 const Register inline_site = t5; |
4253 const Register scratch = a2; | 4253 const Register scratch = a2; |
4254 | 4254 |
4255 const int32_t kDeltaToLoadBoolResult = 4 * kPointerSize; | 4255 const int32_t kDeltaToLoadBoolResult = 5 * kPointerSize; |
4256 | 4256 |
4257 Label slow, loop, is_instance, is_not_instance, not_js_object; | 4257 Label slow, loop, is_instance, is_not_instance, not_js_object; |
4258 | 4258 |
4259 if (!HasArgsInRegisters()) { | 4259 if (!HasArgsInRegisters()) { |
4260 __ lw(object, MemOperand(sp, 1 * kPointerSize)); | 4260 __ lw(object, MemOperand(sp, 1 * kPointerSize)); |
4261 __ lw(function, MemOperand(sp, 0)); | 4261 __ lw(function, MemOperand(sp, 0)); |
4262 } | 4262 } |
4263 | 4263 |
4264 // Check that the left hand is a JS object and load map. | 4264 // Check that the left hand is a JS object and load map. |
4265 __ JumpIfSmi(object, ¬_js_object); | 4265 __ JumpIfSmi(object, ¬_js_object); |
(...skipping 23 matching lines...) Expand all Loading... |
4289 // Update the global instanceof or call site inlined cache with the current | 4289 // Update the global instanceof or call site inlined cache with the current |
4290 // map and function. The cached answer will be set when it is known below. | 4290 // map and function. The cached answer will be set when it is known below. |
4291 if (!HasCallSiteInlineCheck()) { | 4291 if (!HasCallSiteInlineCheck()) { |
4292 __ StoreRoot(function, Heap::kInstanceofCacheFunctionRootIndex); | 4292 __ StoreRoot(function, Heap::kInstanceofCacheFunctionRootIndex); |
4293 __ StoreRoot(map, Heap::kInstanceofCacheMapRootIndex); | 4293 __ StoreRoot(map, Heap::kInstanceofCacheMapRootIndex); |
4294 } else { | 4294 } else { |
4295 ASSERT(HasArgsInRegisters()); | 4295 ASSERT(HasArgsInRegisters()); |
4296 // Patch the (relocated) inlined map check. | 4296 // Patch the (relocated) inlined map check. |
4297 | 4297 |
4298 // The offset was stored in t0 safepoint slot. | 4298 // The offset was stored in t0 safepoint slot. |
4299 // (See LCodeGen::DoDeferredLInstanceOfKnownGlobal) | 4299 // (See LCodeGen::DoDeferredLInstanceOfKnownGlobal). |
4300 __ LoadFromSafepointRegisterSlot(scratch, t0); | 4300 __ LoadFromSafepointRegisterSlot(scratch, t0); |
4301 __ Subu(inline_site, ra, scratch); | 4301 __ Subu(inline_site, ra, scratch); |
4302 // Patch the relocated value to map. | 4302 // Get the map location in scratch and patch it. |
4303 __ PatchRelocatedValue(inline_site, scratch, map); | 4303 __ GetRelocatedValue(inline_site, scratch, v1); // v1 used as scratch. |
| 4304 __ sw(map, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
4304 } | 4305 } |
4305 | 4306 |
4306 // Register mapping: a3 is object map and t0 is function prototype. | 4307 // Register mapping: a3 is object map and t0 is function prototype. |
4307 // Get prototype of object into a2. | 4308 // Get prototype of object into a2. |
4308 __ lw(scratch, FieldMemOperand(map, Map::kPrototypeOffset)); | 4309 __ lw(scratch, FieldMemOperand(map, Map::kPrototypeOffset)); |
4309 | 4310 |
4310 // We don't need map any more. Use it as a scratch register. | 4311 // We don't need map any more. Use it as a scratch register. |
4311 Register scratch2 = map; | 4312 Register scratch2 = map; |
4312 map = no_reg; | 4313 map = no_reg; |
4313 | 4314 |
(...skipping 3267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7581 __ Ret(USE_DELAY_SLOT); | 7582 __ Ret(USE_DELAY_SLOT); |
7582 __ mov(v0, a0); | 7583 __ mov(v0, a0); |
7583 } | 7584 } |
7584 | 7585 |
7585 | 7586 |
7586 #undef __ | 7587 #undef __ |
7587 | 7588 |
7588 } } // namespace v8::internal | 7589 } } // namespace v8::internal |
7589 | 7590 |
7590 #endif // V8_TARGET_ARCH_MIPS | 7591 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |