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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 274 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
275 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 275 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
276 __ li(api_function_address, Operand(ref)); | 276 __ li(api_function_address, Operand(ref)); |
277 | 277 |
278 // Jump to stub. | 278 // Jump to stub. |
279 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); | 279 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); |
280 __ TailCallStub(&stub); | 280 __ TailCallStub(&stub); |
281 } | 281 } |
282 | 282 |
283 | 283 |
284 void ElementHandlerCompiler::GenerateLoadDictionaryElement( | |
285 MacroAssembler* masm) { | |
286 // The return address is in ra. | |
287 Label slow, miss; | |
288 | |
289 Register key = LoadDescriptor::NameRegister(); | |
290 Register receiver = LoadDescriptor::ReceiverRegister(); | |
291 DCHECK(receiver.is(a1)); | |
292 DCHECK(key.is(a2)); | |
293 | |
294 __ UntagAndJumpIfNotSmi(t2, key, &miss); | |
295 __ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset)); | |
296 __ LoadFromNumberDictionary(&slow, t0, key, v0, t2, a3, t1); | |
297 __ Ret(); | |
298 | |
299 // Slow case, key and receiver still unmodified. | |
300 __ bind(&slow); | |
301 __ IncrementCounter( | |
302 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, a2, a3); | |
303 | |
304 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); | |
305 | |
306 // Miss case, call the runtime. | |
307 __ bind(&miss); | |
308 | |
309 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | |
310 } | |
311 | |
312 | |
313 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 284 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
314 // Push receiver, key and value for runtime call. | 285 // Push receiver, key and value for runtime call. |
315 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 286 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
316 StoreDescriptor::ValueRegister()); | 287 StoreDescriptor::ValueRegister()); |
317 | 288 |
318 // The slow case calls into the runtime to complete the store without causing | 289 // The slow case calls into the runtime to complete the store without causing |
319 // an IC miss that would otherwise cause a transition to the generic stub. | 290 // an IC miss that would otherwise cause a transition to the generic stub. |
320 ExternalReference ref = | 291 ExternalReference ref = |
321 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); | 292 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); |
322 __ TailCallExternalReference(ref, 3, 1); | 293 __ TailCallExternalReference(ref, 3, 1); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 // Return the generated code. | 831 // Return the generated code. |
861 return GetCode(kind(), Code::NORMAL, name); | 832 return GetCode(kind(), Code::NORMAL, name); |
862 } | 833 } |
863 | 834 |
864 | 835 |
865 #undef __ | 836 #undef __ |
866 } | 837 } |
867 } // namespace v8::internal | 838 } // namespace v8::internal |
868 | 839 |
869 #endif // V8_TARGET_ARCH_MIPS | 840 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |