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