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

Side by Side Diff: src/arm/builtins-arm.cc

Issue 3146008: Change lazy compilation stub to a builtin.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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/arm/stub-cache-arm.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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { 904 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
905 Generate_JSEntryTrampolineHelper(masm, false); 905 Generate_JSEntryTrampolineHelper(masm, false);
906 } 906 }
907 907
908 908
909 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { 909 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
910 Generate_JSEntryTrampolineHelper(masm, true); 910 Generate_JSEntryTrampolineHelper(masm, true);
911 } 911 }
912 912
913 913
914 void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
915 // Enter an internal frame.
916 __ EnterInternalFrame();
917
918 // Preserve the function.
919 __ push(r1);
920
921 // Push the function on the stack as the argument to the runtime function.
922 __ push(r1);
923 __ CallRuntime(Runtime::kLazyCompile, 1);
924 // Calculate the entry point.
925 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag));
926 // Restore saved function.
927 __ pop(r1);
928
929 // Tear down temporary frame.
930 __ LeaveInternalFrame();
931
932 // Do a tail-call of the compiled function.
933 __ Jump(r2);
934 }
935
936
914 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { 937 void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
915 // 1. Make sure we have at least one argument. 938 // 1. Make sure we have at least one argument.
916 // r0: actual number of arguments 939 // r0: actual number of arguments
917 { Label done; 940 { Label done;
918 __ tst(r0, Operand(r0)); 941 __ tst(r0, Operand(r0));
919 __ b(ne, &done); 942 __ b(ne, &done);
920 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 943 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
921 __ push(r2); 944 __ push(r2);
922 __ add(r0, r0, Operand(1)); 945 __ add(r0, r0, Operand(1));
923 __ bind(&done); 946 __ bind(&done);
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 __ bind(&dont_adapt_arguments); 1334 __ bind(&dont_adapt_arguments);
1312 __ Jump(r3); 1335 __ Jump(r3);
1313 } 1336 }
1314 1337
1315 1338
1316 #undef __ 1339 #undef __
1317 1340
1318 } } // namespace v8::internal 1341 } } // namespace v8::internal
1319 1342
1320 #endif // V8_TARGET_ARCH_ARM 1343 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698