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

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

Issue 870007: Implement a custom call compiler for Array.pop. (Closed)
Patch Set: Ultimate version Created 10 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 | « no previous file | src/ia32/stub-cache-ia32.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 857
858 // Return the generated code. 858 // Return the generated code.
859 String* function_name = NULL; 859 String* function_name = NULL;
860 if (function->shared()->name()->IsString()) { 860 if (function->shared()->name()->IsString()) {
861 function_name = String::cast(function->shared()->name()); 861 function_name = String::cast(function->shared()->name());
862 } 862 }
863 return GetCode(CONSTANT_FUNCTION, function_name); 863 return GetCode(CONSTANT_FUNCTION, function_name);
864 } 864 }
865 865
866 866
867 Object* CallStubCompiler::CompileArrayPopCall(Object* object,
868 JSObject* holder,
869 JSFunction* function,
870 String* name,
871 CheckType check) {
872 // ----------- S t a t e -------------
873 // -- r2 : name
874 // -- lr : return address
875 // -----------------------------------
876
877 // TODO(642): faster implementation.
878 ASSERT(check == RECEIVER_MAP_CHECK);
879
880 Label miss;
881
882 // Get the receiver from the stack
883 const int argc = arguments().immediate();
884 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
885
886 // Check that the receiver isn't a smi.
887 __ tst(r1, Operand(kSmiTagMask));
888 __ b(eq, &miss);
889
890 // Check that the maps haven't changed.
891 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r0, name, &miss);
892
893 if (object->IsGlobalObject()) {
894 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
895 __ str(r3, MemOperand(sp, argc * kPointerSize));
896 }
897
898 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
899 argc + 1,
900 1);
901
902 // Handle call cache miss.
903 __ bind(&miss);
904 Handle<Code> ic = ComputeCallMiss(arguments().immediate());
905 __ Jump(ic, RelocInfo::CODE_TARGET);
906
907 // Return the generated code.
908 String* function_name = NULL;
909 if (function->shared()->name()->IsString()) {
910 function_name = String::cast(function->shared()->name());
911 }
912 return GetCode(CONSTANT_FUNCTION, function_name);
913 }
914
915
867 Object* CallStubCompiler::CompileCallConstant(Object* object, 916 Object* CallStubCompiler::CompileCallConstant(Object* object,
868 JSObject* holder, 917 JSObject* holder,
869 JSFunction* function, 918 JSFunction* function,
870 String* name, 919 String* name,
871 CheckType check) { 920 CheckType check) {
872 // ----------- S t a t e ------------- 921 // ----------- S t a t e -------------
873 // -- r2 : name 922 // -- r2 : name
874 // -- lr : return address 923 // -- lr : return address
875 // ----------------------------------- 924 // -----------------------------------
876 SharedFunctionInfo* function_info = function->shared(); 925 SharedFunctionInfo* function_info = function->shared();
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); 1894 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
1846 1895
1847 // Return the generated code. 1896 // Return the generated code.
1848 return GetCode(); 1897 return GetCode();
1849 } 1898 }
1850 1899
1851 1900
1852 #undef __ 1901 #undef __
1853 1902
1854 } } // namespace v8::internal 1903 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698