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

Side by Side Diff: src/ic/x64/handler-compiler-x64.cc

Issue 486213003: Move register conventions out of the IC classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/x64/access-compiler-x64.cc ('k') | src/ic/x64/ic-compiler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_X64 7 #if V8_TARGET_ARCH_X64
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 277
278 278
279 void ElementHandlerCompiler::GenerateLoadDictionaryElement( 279 void ElementHandlerCompiler::GenerateLoadDictionaryElement(
280 MacroAssembler* masm) { 280 MacroAssembler* masm) {
281 // ----------- S t a t e ------------- 281 // ----------- S t a t e -------------
282 // -- rcx : key 282 // -- rcx : key
283 // -- rdx : receiver 283 // -- rdx : receiver
284 // -- rsp[0] : return address 284 // -- rsp[0] : return address
285 // ----------------------------------- 285 // -----------------------------------
286 DCHECK(rdx.is(LoadIC::ReceiverRegister())); 286 DCHECK(rdx.is(LoadConvention::ReceiverRegister()));
287 DCHECK(rcx.is(LoadIC::NameRegister())); 287 DCHECK(rcx.is(LoadConvention::NameRegister()));
288 Label slow, miss; 288 Label slow, miss;
289 289
290 // This stub is meant to be tail-jumped to, the receiver must already 290 // This stub is meant to be tail-jumped to, the receiver must already
291 // have been verified by the caller to not be a smi. 291 // have been verified by the caller to not be a smi.
292 292
293 __ JumpIfNotSmi(rcx, &miss); 293 __ JumpIfNotSmi(rcx, &miss);
294 __ SmiToInteger32(rbx, rcx); 294 __ SmiToInteger32(rbx, rcx);
295 __ movp(rax, FieldOperand(rdx, JSObject::kElementsOffset)); 295 __ movp(rax, FieldOperand(rdx, JSObject::kElementsOffset));
296 296
297 // Check whether the elements is a number dictionary. 297 // Check whether the elements is a number dictionary.
(...skipping 16 matching lines...) Expand all
314 // ----------- S t a t e ------------- 314 // ----------- S t a t e -------------
315 // -- rcx : key 315 // -- rcx : key
316 // -- rdx : receiver 316 // -- rdx : receiver
317 // -- rsp[0] : return address 317 // -- rsp[0] : return address
318 // ----------------------------------- 318 // -----------------------------------
319 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 319 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
320 } 320 }
321 321
322 322
323 static void StoreIC_PushArgs(MacroAssembler* masm) { 323 static void StoreIC_PushArgs(MacroAssembler* masm) {
324 Register receiver = StoreIC::ReceiverRegister(); 324 Register receiver = StoreConvention::ReceiverRegister();
325 Register name = StoreIC::NameRegister(); 325 Register name = StoreConvention::NameRegister();
326 Register value = StoreIC::ValueRegister(); 326 Register value = StoreConvention::ValueRegister();
327 327
328 DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value)); 328 DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value));
329 329
330 __ PopReturnAddressTo(rbx); 330 __ PopReturnAddressTo(rbx);
331 __ Push(receiver); 331 __ Push(receiver);
332 __ Push(name); 332 __ Push(name);
333 __ Push(value); 333 __ Push(value);
334 __ PushReturnAddressFrom(rbx); 334 __ PushReturnAddressFrom(rbx);
335 } 335 }
336 336
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 // Do tail-call to the runtime system. 831 // Do tail-call to the runtime system.
832 ExternalReference store_ic_property = ExternalReference( 832 ExternalReference store_ic_property = ExternalReference(
833 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); 833 IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
834 __ TailCallExternalReference(store_ic_property, 3, 1); 834 __ TailCallExternalReference(store_ic_property, 3, 1);
835 835
836 // Return the generated code. 836 // Return the generated code.
837 return GetCode(kind(), Code::FAST, name); 837 return GetCode(kind(), Code::FAST, name);
838 } 838 }
839 839
840 840
841 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } 841 Register NamedStoreHandlerCompiler::value() {
842 return StoreConvention::ValueRegister();
843 }
842 844
843 845
844 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( 846 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
845 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { 847 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
846 Label miss; 848 Label miss;
847 FrontendHeader(receiver(), name, &miss); 849 FrontendHeader(receiver(), name, &miss);
848 850
849 // Get the value from the cell. 851 // Get the value from the cell.
850 Register result = StoreIC::ValueRegister(); 852 Register result = StoreConvention::ValueRegister();
851 __ Move(result, cell); 853 __ Move(result, cell);
852 __ movp(result, FieldOperand(result, PropertyCell::kValueOffset)); 854 __ movp(result, FieldOperand(result, PropertyCell::kValueOffset));
853 855
854 // Check for deleted property if property can actually be deleted. 856 // Check for deleted property if property can actually be deleted.
855 if (is_configurable) { 857 if (is_configurable) {
856 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 858 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
857 __ j(equal, &miss); 859 __ j(equal, &miss);
858 } else if (FLAG_debug_code) { 860 } else if (FLAG_debug_code) {
859 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 861 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
860 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); 862 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
861 } 863 }
862 864
863 Counters* counters = isolate()->counters(); 865 Counters* counters = isolate()->counters();
864 __ IncrementCounter(counters->named_load_global_stub(), 1); 866 __ IncrementCounter(counters->named_load_global_stub(), 1);
865 __ ret(0); 867 __ ret(0);
866 868
867 FrontendFooter(name, &miss); 869 FrontendFooter(name, &miss);
868 870
869 // Return the generated code. 871 // Return the generated code.
870 return GetCode(kind(), Code::NORMAL, name); 872 return GetCode(kind(), Code::NORMAL, name);
871 } 873 }
872 874
873 875
874 #undef __ 876 #undef __
875 } 877 }
876 } // namespace v8::internal 878 } // namespace v8::internal
877 879
878 #endif // V8_TARGET_ARCH_X64 880 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/x64/access-compiler-x64.cc ('k') | src/ic/x64/ic-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698