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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 12781004: Refactoring Store ICs. A first step towards polymorphic store ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: space nits Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.cc ('k') | src/x64/ic-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 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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 // ----------- S t a t e ------------- 2396 // ----------- S t a t e -------------
2397 // -- rax : receiver 2397 // -- rax : receiver
2398 // -- rcx : name 2398 // -- rcx : name
2399 // -- rsp[0] : return address 2399 // -- rsp[0] : return address
2400 // ----------------------------------- 2400 // -----------------------------------
2401 receiver = rax; 2401 receiver = rax;
2402 } 2402 }
2403 2403
2404 StubCompiler::GenerateLoadArrayLength(masm, receiver, r8, &miss); 2404 StubCompiler::GenerateLoadArrayLength(masm, receiver, r8, &miss);
2405 __ bind(&miss); 2405 __ bind(&miss);
2406 StubCompiler::GenerateLoadMiss(masm, kind()); 2406 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind()));
2407 } 2407 }
2408 2408
2409 2409
2410 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { 2410 void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
2411 Label miss; 2411 Label miss;
2412 Register receiver; 2412 Register receiver;
2413 if (kind() == Code::KEYED_LOAD_IC) { 2413 if (kind() == Code::KEYED_LOAD_IC) {
2414 // ----------- S t a t e ------------- 2414 // ----------- S t a t e -------------
2415 // -- rax : key 2415 // -- rax : key
2416 // -- rdx : receiver 2416 // -- rdx : receiver
2417 // -- rsp[0] : return address 2417 // -- rsp[0] : return address
2418 // ----------------------------------- 2418 // -----------------------------------
2419 __ Cmp(rax, masm->isolate()->factory()->prototype_string()); 2419 __ Cmp(rax, masm->isolate()->factory()->prototype_string());
2420 __ j(not_equal, &miss); 2420 __ j(not_equal, &miss);
2421 receiver = rdx; 2421 receiver = rdx;
2422 } else { 2422 } else {
2423 ASSERT(kind() == Code::LOAD_IC); 2423 ASSERT(kind() == Code::LOAD_IC);
2424 // ----------- S t a t e ------------- 2424 // ----------- S t a t e -------------
2425 // -- rax : receiver 2425 // -- rax : receiver
2426 // -- rcx : name 2426 // -- rcx : name
2427 // -- rsp[0] : return address 2427 // -- rsp[0] : return address
2428 // ----------------------------------- 2428 // -----------------------------------
2429 receiver = rax; 2429 receiver = rax;
2430 } 2430 }
2431 2431
2432 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss); 2432 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss);
2433 __ bind(&miss); 2433 __ bind(&miss);
2434 StubCompiler::GenerateLoadMiss(masm, kind()); 2434 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind()));
2435 } 2435 }
2436 2436
2437 2437
2438 void StringLengthStub::Generate(MacroAssembler* masm) { 2438 void StringLengthStub::Generate(MacroAssembler* masm) {
2439 Label miss; 2439 Label miss;
2440 Register receiver; 2440 Register receiver;
2441 if (kind() == Code::KEYED_LOAD_IC) { 2441 if (kind() == Code::KEYED_LOAD_IC) {
2442 // ----------- S t a t e ------------- 2442 // ----------- S t a t e -------------
2443 // -- rax : key 2443 // -- rax : key
2444 // -- rdx : receiver 2444 // -- rdx : receiver
2445 // -- rsp[0] : return address 2445 // -- rsp[0] : return address
2446 // ----------------------------------- 2446 // -----------------------------------
2447 __ Cmp(rax, masm->isolate()->factory()->length_string()); 2447 __ Cmp(rax, masm->isolate()->factory()->length_string());
2448 __ j(not_equal, &miss); 2448 __ j(not_equal, &miss);
2449 receiver = rdx; 2449 receiver = rdx;
2450 } else { 2450 } else {
2451 ASSERT(kind() == Code::LOAD_IC); 2451 ASSERT(kind() == Code::LOAD_IC);
2452 // ----------- S t a t e ------------- 2452 // ----------- S t a t e -------------
2453 // -- rax : receiver 2453 // -- rax : receiver
2454 // -- rcx : name 2454 // -- rcx : name
2455 // -- rsp[0] : return address 2455 // -- rsp[0] : return address
2456 // ----------------------------------- 2456 // -----------------------------------
2457 receiver = rax; 2457 receiver = rax;
2458 } 2458 }
2459 2459
2460 StubCompiler::GenerateLoadStringLength(masm, receiver, r8, r9, &miss, 2460 StubCompiler::GenerateLoadStringLength(masm, receiver, r8, r9, &miss,
2461 support_wrapper_); 2461 support_wrapper_);
2462 __ bind(&miss); 2462 __ bind(&miss);
2463 StubCompiler::GenerateLoadMiss(masm, kind()); 2463 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind()));
2464 } 2464 }
2465 2465
2466 2466
2467 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { 2467 void StoreArrayLengthStub::Generate(MacroAssembler* masm) {
2468 // ----------- S t a t e ------------- 2468 // ----------- S t a t e -------------
2469 // -- rax : value 2469 // -- rax : value
2470 // -- rcx : key 2470 // -- rcx : key
2471 // -- rdx : receiver 2471 // -- rdx : receiver
2472 // -- rsp[0] : return address 2472 // -- rsp[0] : return address
2473 // ----------------------------------- 2473 // -----------------------------------
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 __ push(receiver); 2516 __ push(receiver);
2517 __ push(value); 2517 __ push(value);
2518 __ push(scratch); // return address 2518 __ push(scratch); // return address
2519 2519
2520 ExternalReference ref = 2520 ExternalReference ref =
2521 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), masm->isolate()); 2521 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), masm->isolate());
2522 __ TailCallExternalReference(ref, 2, 1); 2522 __ TailCallExternalReference(ref, 2, 1);
2523 2523
2524 __ bind(&miss); 2524 __ bind(&miss);
2525 2525
2526 StubCompiler::GenerateStoreMiss(masm, kind()); 2526 StubCompiler::TailCallBuiltin(masm, StubCompiler::MissBuiltin(kind()));
2527 } 2527 }
2528 2528
2529 2529
2530 void LoadFieldStub::Generate(MacroAssembler* masm) { 2530 void LoadFieldStub::Generate(MacroAssembler* masm) {
2531 StubCompiler::DoGenerateFastPropertyLoad(masm, rax, reg_, inobject_, index_); 2531 StubCompiler::DoGenerateFastPropertyLoad(masm, rax, reg_, inobject_, index_);
2532 __ ret(0); 2532 __ ret(0);
2533 } 2533 }
2534 2534
2535 2535
2536 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { 2536 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
(...skipping 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after
6885 #endif 6885 #endif
6886 6886
6887 __ Ret(); 6887 __ Ret();
6888 } 6888 }
6889 6889
6890 #undef __ 6890 #undef __
6891 6891
6892 } } // namespace v8::internal 6892 } } // namespace v8::internal
6893 6893
6894 #endif // V8_TARGET_ARCH_X64 6894 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698