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

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 150225: Improved code for megamorphic stub on ia32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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 | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 Label number, non_number, non_string, boolean, probe, miss; 430 Label number, non_number, non_string, boolean, probe, miss;
431 431
432 // Get the receiver of the function from the stack; 1 ~ return address. 432 // Get the receiver of the function from the stack; 1 ~ return address.
433 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); 433 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
434 // Get the name of the function from the stack; 2 ~ return address, receiver 434 // Get the name of the function from the stack; 2 ~ return address, receiver
435 __ mov(ecx, Operand(esp, (argc + 2) * kPointerSize)); 435 __ mov(ecx, Operand(esp, (argc + 2) * kPointerSize));
436 436
437 // Probe the stub cache. 437 // Probe the stub cache.
438 Code::Flags flags = 438 Code::Flags flags =
439 Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc); 439 Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
440 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); 440 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx, eax);
441 441
442 // If the stub cache probing failed, the receiver might be a value. 442 // If the stub cache probing failed, the receiver might be a value.
443 // For value objects, we use the map of the prototype objects for 443 // For value objects, we use the map of the prototype objects for
444 // the corresponding JSValue for the cache and that is what we need 444 // the corresponding JSValue for the cache and that is what we need
445 // to probe. 445 // to probe.
446 // 446 //
447 // Check for number. 447 // Check for number.
448 __ test(edx, Immediate(kSmiTagMask)); 448 __ test(edx, Immediate(kSmiTagMask));
449 __ j(zero, &number, not_taken); 449 __ j(zero, &number, not_taken);
450 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ebx); 450 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ebx);
(...skipping 16 matching lines...) Expand all
467 __ cmp(edx, Factory::true_value()); 467 __ cmp(edx, Factory::true_value());
468 __ j(equal, &boolean, not_taken); 468 __ j(equal, &boolean, not_taken);
469 __ cmp(edx, Factory::false_value()); 469 __ cmp(edx, Factory::false_value());
470 __ j(not_equal, &miss, taken); 470 __ j(not_equal, &miss, taken);
471 __ bind(&boolean); 471 __ bind(&boolean);
472 StubCompiler::GenerateLoadGlobalFunctionPrototype( 472 StubCompiler::GenerateLoadGlobalFunctionPrototype(
473 masm, Context::BOOLEAN_FUNCTION_INDEX, edx); 473 masm, Context::BOOLEAN_FUNCTION_INDEX, edx);
474 474
475 // Probe the stub cache for the value object. 475 // Probe the stub cache for the value object.
476 __ bind(&probe); 476 __ bind(&probe);
477 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); 477 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx, no_reg);
478 478
479 // Cache miss: Jump to runtime. 479 // Cache miss: Jump to runtime.
480 __ bind(&miss); 480 __ bind(&miss);
481 Generate(masm, argc, ExternalReference(IC_Utility(kCallIC_Miss))); 481 Generate(masm, argc, ExternalReference(IC_Utility(kCallIC_Miss)));
482 } 482 }
483 483
484 484
485 static void GenerateNormalHelper(MacroAssembler* masm, 485 static void GenerateNormalHelper(MacroAssembler* masm,
486 int argc, 486 int argc,
487 bool is_global_object, 487 bool is_global_object,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // -- esp[0] : return address 641 // -- esp[0] : return address
642 // -- esp[4] : receiver 642 // -- esp[4] : receiver
643 // ----------------------------------- 643 // -----------------------------------
644 644
645 __ mov(eax, Operand(esp, kPointerSize)); 645 __ mov(eax, Operand(esp, kPointerSize));
646 646
647 // Probe the stub cache. 647 // Probe the stub cache.
648 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, 648 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC,
649 NOT_IN_LOOP, 649 NOT_IN_LOOP,
650 MONOMORPHIC); 650 MONOMORPHIC);
651 StubCache::GenerateProbe(masm, flags, eax, ecx, ebx); 651 StubCache::GenerateProbe(masm, flags, eax, ecx, ebx, edx);
652 652
653 // Cache miss: Jump to runtime. 653 // Cache miss: Jump to runtime.
654 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); 654 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss)));
655 } 655 }
656 656
657 657
658 void LoadIC::GenerateNormal(MacroAssembler* masm) { 658 void LoadIC::GenerateNormal(MacroAssembler* masm) {
659 // ----------- S t a t e ------------- 659 // ----------- S t a t e -------------
660 // -- ecx : name 660 // -- ecx : name
661 // -- esp[0] : return address 661 // -- esp[0] : return address
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 // -- ecx : name 871 // -- ecx : name
872 // -- esp[0] : return address 872 // -- esp[0] : return address
873 // -- esp[4] : receiver 873 // -- esp[4] : receiver
874 // ----------------------------------- 874 // -----------------------------------
875 875
876 // Get the receiver from the stack and probe the stub cache. 876 // Get the receiver from the stack and probe the stub cache.
877 __ mov(edx, Operand(esp, 4)); 877 __ mov(edx, Operand(esp, 4));
878 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, 878 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC,
879 NOT_IN_LOOP, 879 NOT_IN_LOOP,
880 MONOMORPHIC); 880 MONOMORPHIC);
881 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); 881 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx, no_reg);
882 882
883 // Cache miss: Jump to runtime. 883 // Cache miss: Jump to runtime.
884 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); 884 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss)));
885 } 885 }
886 886
887 887
888 void StoreIC::GenerateExtendStorage(MacroAssembler* masm) { 888 void StoreIC::GenerateExtendStorage(MacroAssembler* masm) {
889 // ----------- S t a t e ------------- 889 // ----------- S t a t e -------------
890 // -- eax : value 890 // -- eax : value
891 // -- ecx : transition map 891 // -- ecx : transition map
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 966
967 // Do tail-call to runtime routine. 967 // Do tail-call to runtime routine.
968 __ TailCallRuntime( 968 __ TailCallRuntime(
969 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); 969 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3);
970 } 970 }
971 971
972 #undef __ 972 #undef __
973 973
974 974
975 } } // namespace v8::internal 975 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698