Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 9699071: MIPS: Branch delay slot and other optimizations. (Closed)
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/simulator-mips.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 MacroAssembler* masm, 570 MacroAssembler* masm,
571 Register receiver, 571 Register receiver,
572 Register holder, 572 Register holder,
573 Register name, 573 Register name,
574 Handle<JSObject> holder_obj) { 574 Handle<JSObject> holder_obj) {
575 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 575 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
576 576
577 ExternalReference ref = 577 ExternalReference ref =
578 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly), 578 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly),
579 masm->isolate()); 579 masm->isolate());
580 __ li(a0, Operand(5)); 580 __ PrepareCEntryArgs(5);
581 __ li(a1, Operand(ref)); 581 __ PrepareCEntryFunction(ref);
582 582
583 CEntryStub stub(1); 583 CEntryStub stub(1);
584 __ CallStub(&stub); 584 __ CallStub(&stub);
585 } 585 }
586 586
587 587
588 static const int kFastApiCallArguments = 3; 588 static const int kFastApiCallArguments = 3;
589 589
590 590
591 // Reserves space for the extra arguments to FastHandleApiCall in the 591 // Reserves space for the extra arguments to FastHandleApiCall in the
(...skipping 3508 matching lines...) Expand 10 before | Expand all | Expand 10 after
4100 // -- ra : return address 4100 // -- ra : return address
4101 // -- a0 : key 4101 // -- a0 : key
4102 // -- a1 : receiver 4102 // -- a1 : receiver
4103 // ----------------------------------- 4103 // -----------------------------------
4104 Label miss_force_generic; 4104 Label miss_force_generic;
4105 4105
4106 // This stub is meant to be tail-jumped to, the receiver must already 4106 // This stub is meant to be tail-jumped to, the receiver must already
4107 // have been verified by the caller to not be a smi. 4107 // have been verified by the caller to not be a smi.
4108 4108
4109 // Check that the key is a smi. 4109 // Check that the key is a smi.
4110 __ JumpIfNotSmi(a0, &miss_force_generic); 4110 __ JumpIfNotSmi(a0, &miss_force_generic, at, USE_DELAY_SLOT);
4111 // The delay slot can be safely used here, a1 is an object pointer.
4111 4112
4112 // Get the elements array. 4113 // Get the elements array.
4113 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); 4114 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset));
4114 __ AssertFastElements(a2); 4115 __ AssertFastElements(a2);
4115 4116
4116 // Check that the key is within bounds. 4117 // Check that the key is within bounds.
4117 __ lw(a3, FieldMemOperand(a2, FixedArray::kLengthOffset)); 4118 __ lw(a3, FieldMemOperand(a2, FixedArray::kLengthOffset));
4118 __ Branch(&miss_force_generic, hs, a0, Operand(a3)); 4119 __ Branch(USE_DELAY_SLOT, &miss_force_generic, hs, a0, Operand(a3));
4119 4120
4120 // Load the result and make sure it's not the hole. 4121 // Load the result and make sure it's not the hole.
4121 __ Addu(a3, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4122 __ Addu(a3, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4122 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 4123 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
4123 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize); 4124 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize);
4124 __ Addu(t0, t0, a3); 4125 __ Addu(t0, t0, a3);
4125 __ lw(t0, MemOperand(t0)); 4126 __ lw(t0, MemOperand(t0));
4126 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex); 4127 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex);
4127 __ Branch(&miss_force_generic, eq, t0, Operand(t1)); 4128 __ Branch(&miss_force_generic, eq, t0, Operand(t1));
4129 __ Ret(USE_DELAY_SLOT);
4128 __ mov(v0, t0); 4130 __ mov(v0, t0);
4129 __ Ret();
4130 4131
4131 __ bind(&miss_force_generic); 4132 __ bind(&miss_force_generic);
4132 Handle<Code> stub = 4133 Handle<Code> stub =
4133 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric(); 4134 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
4134 __ Jump(stub, RelocInfo::CODE_TARGET); 4135 __ Jump(stub, RelocInfo::CODE_TARGET);
4135 } 4136 }
4136 4137
4137 4138
4138 void KeyedLoadStubCompiler::GenerateLoadFastDoubleElement( 4139 void KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(
4139 MacroAssembler* masm) { 4140 MacroAssembler* masm) {
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
4509 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4510 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4510 } 4511 }
4511 } 4512 }
4512 4513
4513 4514
4514 #undef __ 4515 #undef __
4515 4516
4516 } } // namespace v8::internal 4517 } } // namespace v8::internal
4517 4518
4518 #endif // V8_TARGET_ARCH_MIPS 4519 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/simulator-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698