| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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( | 284 void ElementHandlerCompiler::GenerateLoadDictionaryElement( | 
| 285     MacroAssembler* masm) { | 285     MacroAssembler* masm) { | 
| 286   // The return address is in ra. | 286   // The return address is in ra. | 
| 287   Label slow, miss; | 287   Label slow, miss; | 
| 288 | 288 | 
| 289   Register key = LoadIC::NameRegister(); | 289   Register key = LoadConvention::NameRegister(); | 
| 290   Register receiver = LoadIC::ReceiverRegister(); | 290   Register receiver = LoadConvention::ReceiverRegister(); | 
| 291   DCHECK(receiver.is(a1)); | 291   DCHECK(receiver.is(a1)); | 
| 292   DCHECK(key.is(a2)); | 292   DCHECK(key.is(a2)); | 
| 293 | 293 | 
| 294   __ UntagAndJumpIfNotSmi(t2, key, &miss); | 294   __ UntagAndJumpIfNotSmi(t2, key, &miss); | 
| 295   __ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 295   __ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 
| 296   __ LoadFromNumberDictionary(&slow, t0, key, v0, t2, a3, t1); | 296   __ LoadFromNumberDictionary(&slow, t0, key, v0, t2, a3, t1); | 
| 297   __ Ret(); | 297   __ Ret(); | 
| 298 | 298 | 
| 299   // Slow case, key and receiver still unmodified. | 299   // Slow case, key and receiver still unmodified. | 
| 300   __ bind(&slow); | 300   __ bind(&slow); | 
| 301   __ IncrementCounter( | 301   __ IncrementCounter( | 
| 302       masm->isolate()->counters()->keyed_load_external_array_slow(), 1, a2, a3); | 302       masm->isolate()->counters()->keyed_load_external_array_slow(), 1, a2, a3); | 
| 303 | 303 | 
| 304   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); | 304   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); | 
| 305 | 305 | 
| 306   // Miss case, call the runtime. | 306   // Miss case, call the runtime. | 
| 307   __ bind(&miss); | 307   __ bind(&miss); | 
| 308 | 308 | 
| 309   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 309   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 
| 310 } | 310 } | 
| 311 | 311 | 
| 312 | 312 | 
| 313 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 313 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 
| 314   // Push receiver, key and value for runtime call. | 314   // Push receiver, key and value for runtime call. | 
| 315   __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(), | 315   __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), | 
| 316           StoreIC::ValueRegister()); | 316           StoreConvention::ValueRegister()); | 
| 317 | 317 | 
| 318   // The slow case calls into the runtime to complete the store without causing | 318   // 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. | 319   // an IC miss that would otherwise cause a transition to the generic stub. | 
| 320   ExternalReference ref = | 320   ExternalReference ref = | 
| 321       ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); | 321       ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); | 
| 322   __ TailCallExternalReference(ref, 3, 1); | 322   __ TailCallExternalReference(ref, 3, 1); | 
| 323 } | 323 } | 
| 324 | 324 | 
| 325 | 325 | 
| 326 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 326 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 
| 327   // Push receiver, key and value for runtime call. | 327   // Push receiver, key and value for runtime call. | 
| 328   __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(), | 328   __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), | 
| 329           StoreIC::ValueRegister()); | 329           StoreConvention::ValueRegister()); | 
| 330 | 330 | 
| 331   // The slow case calls into the runtime to complete the store without causing | 331   // The slow case calls into the runtime to complete the store without causing | 
| 332   // an IC miss that would otherwise cause a transition to the generic stub. | 332   // an IC miss that would otherwise cause a transition to the generic stub. | 
| 333   ExternalReference ref = | 333   ExternalReference ref = | 
| 334       ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate()); | 334       ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate()); | 
| 335   __ TailCallExternalReference(ref, 3, 1); | 335   __ TailCallExternalReference(ref, 3, 1); | 
| 336 } | 336 } | 
| 337 | 337 | 
| 338 | 338 | 
| 339 #undef __ | 339 #undef __ | 
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 821   // Do tail-call to the runtime system. | 821   // Do tail-call to the runtime system. | 
| 822   ExternalReference store_ic_property = ExternalReference( | 822   ExternalReference store_ic_property = ExternalReference( | 
| 823       IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); | 823       IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); | 
| 824   __ TailCallExternalReference(store_ic_property, 3, 1); | 824   __ TailCallExternalReference(store_ic_property, 3, 1); | 
| 825 | 825 | 
| 826   // Return the generated code. | 826   // Return the generated code. | 
| 827   return GetCode(kind(), Code::FAST, name); | 827   return GetCode(kind(), Code::FAST, name); | 
| 828 } | 828 } | 
| 829 | 829 | 
| 830 | 830 | 
| 831 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } | 831 Register NamedStoreHandlerCompiler::value() { | 
|  | 832   return StoreConvention::ValueRegister(); | 
|  | 833 } | 
| 832 | 834 | 
| 833 | 835 | 
| 834 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 836 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 
| 835     Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 837     Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 
| 836   Label miss; | 838   Label miss; | 
| 837 | 839 | 
| 838   FrontendHeader(receiver(), name, &miss); | 840   FrontendHeader(receiver(), name, &miss); | 
| 839 | 841 | 
| 840   // Get the value from the cell. | 842   // Get the value from the cell. | 
| 841   Register result = StoreIC::ValueRegister(); | 843   Register result = StoreConvention::ValueRegister(); | 
| 842   __ li(result, Operand(cell)); | 844   __ li(result, Operand(cell)); | 
| 843   __ lw(result, FieldMemOperand(result, Cell::kValueOffset)); | 845   __ lw(result, FieldMemOperand(result, Cell::kValueOffset)); | 
| 844 | 846 | 
| 845   // Check for deleted property if property can actually be deleted. | 847   // Check for deleted property if property can actually be deleted. | 
| 846   if (is_configurable) { | 848   if (is_configurable) { | 
| 847     __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 849     __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 
| 848     __ Branch(&miss, eq, result, Operand(at)); | 850     __ Branch(&miss, eq, result, Operand(at)); | 
| 849   } | 851   } | 
| 850 | 852 | 
| 851   Counters* counters = isolate()->counters(); | 853   Counters* counters = isolate()->counters(); | 
| 852   __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); | 854   __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); | 
| 853   __ Ret(USE_DELAY_SLOT); | 855   __ Ret(USE_DELAY_SLOT); | 
| 854   __ mov(v0, result); | 856   __ mov(v0, result); | 
| 855 | 857 | 
| 856   FrontendFooter(name, &miss); | 858   FrontendFooter(name, &miss); | 
| 857 | 859 | 
| 858   // Return the generated code. | 860   // Return the generated code. | 
| 859   return GetCode(kind(), Code::NORMAL, name); | 861   return GetCode(kind(), Code::NORMAL, name); | 
| 860 } | 862 } | 
| 861 | 863 | 
| 862 | 864 | 
| 863 #undef __ | 865 #undef __ | 
| 864 } | 866 } | 
| 865 }  // namespace v8::internal | 867 }  // namespace v8::internal | 
| 866 | 868 | 
| 867 #endif  // V8_TARGET_ARCH_MIPS | 869 #endif  // V8_TARGET_ARCH_MIPS | 
| OLD | NEW | 
|---|