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/ia32/builtins-ia32.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 | « src/heap.cc ('k') | 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { 422 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
423 Generate_JSEntryTrampolineHelper(masm, false); 423 Generate_JSEntryTrampolineHelper(masm, false);
424 } 424 }
425 425
426 426
427 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { 427 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
428 Generate_JSEntryTrampolineHelper(masm, true); 428 Generate_JSEntryTrampolineHelper(masm, true);
429 } 429 }
430 430
431 431
432 void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
433 // Enter an internal frame.
434 __ EnterInternalFrame();
435
436 // Push a copy of the function onto the stack.
437 __ push(edi);
438
439 __ push(edi); // Function is also the parameter to the runtime call.
440 __ CallRuntime(Runtime::kLazyCompile, 1);
441 __ pop(edi);
442
443 // Tear down temporary frame.
444 __ LeaveInternalFrame();
445
446 // Do a tail-call of the compiled function.
447 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize));
448 __ jmp(Operand(ecx));
449 }
450
451
432 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { 452 void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
433 // 1. Make sure we have at least one argument. 453 // 1. Make sure we have at least one argument.
434 { Label done; 454 { Label done;
435 __ test(eax, Operand(eax)); 455 __ test(eax, Operand(eax));
436 __ j(not_zero, &done, taken); 456 __ j(not_zero, &done, taken);
437 __ pop(ebx); 457 __ pop(ebx);
438 __ push(Immediate(Factory::undefined_value())); 458 __ push(Immediate(Factory::undefined_value()));
439 __ push(ebx); 459 __ push(ebx);
440 __ inc(eax); 460 __ inc(eax);
441 __ bind(&done); 461 __ bind(&done);
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 __ bind(&dont_adapt_arguments); 1272 __ bind(&dont_adapt_arguments);
1253 __ jmp(Operand(edx)); 1273 __ jmp(Operand(edx));
1254 } 1274 }
1255 1275
1256 1276
1257 #undef __ 1277 #undef __
1258 1278
1259 } } // namespace v8::internal 1279 } } // namespace v8::internal
1260 1280
1261 #endif // V8_TARGET_ARCH_IA32 1281 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698