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

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

Issue 153953005: A64: Synchronize with r16993. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/hydrogen-osr.cc ('k') | src/ia32/full-codegen-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 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) { 623 void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
624 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); 624 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
625 } 625 }
626 626
627 627
628 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { 628 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
629 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); 629 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
630 } 630 }
631 631
632 632
633 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) {
634 // TODO(kasperl): Do we need to save/restore the XMM registers too?
635 // TODO(mvstanton): We should save these regs, do this in a future
636 // checkin.
637
638 // For now, we are relying on the fact that Runtime::NotifyOSR
639 // doesn't do any garbage collection which allows us to save/restore
640 // the registers without worrying about which of them contain
641 // pointers. This seems a bit fragile.
642 __ pushad();
643 {
644 FrameScope scope(masm, StackFrame::INTERNAL);
645 __ CallRuntime(Runtime::kNotifyOSR, 0);
646 }
647 __ popad();
648 __ ret(0);
649 }
650
651
652 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { 633 void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
653 Factory* factory = masm->isolate()->factory(); 634 Factory* factory = masm->isolate()->factory();
654 635
655 // 1. Make sure we have at least one argument. 636 // 1. Make sure we have at least one argument.
656 { Label done; 637 { Label done;
657 __ test(eax, eax); 638 __ test(eax, eax);
658 __ j(not_zero, &done); 639 __ j(not_zero, &done);
659 __ pop(ebx); 640 __ pop(ebx);
660 __ push(Immediate(factory->undefined_value())); 641 __ push(Immediate(factory->undefined_value()));
661 __ push(ebx); 642 __ push(ebx);
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 __ lea(eax, Operand(eax, ebx, times_1, Code::kHeaderSize - kHeapObjectTag)); 1300 __ lea(eax, Operand(eax, ebx, times_1, Code::kHeaderSize - kHeapObjectTag));
1320 1301
1321 // Overwrite the return address on the stack. 1302 // Overwrite the return address on the stack.
1322 __ mov(Operand(esp, 0), eax); 1303 __ mov(Operand(esp, 0), eax);
1323 1304
1324 // And "return" to the OSR entry point of the function. 1305 // And "return" to the OSR entry point of the function.
1325 __ ret(0); 1306 __ ret(0);
1326 } 1307 }
1327 1308
1328 1309
1310 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) {
1311 // We check the stack limit as indicator that recompilation might be done.
1312 Label ok;
1313 ExternalReference stack_limit =
1314 ExternalReference::address_of_stack_limit(masm->isolate());
1315 __ cmp(esp, Operand::StaticVariable(stack_limit));
1316 __ j(above_equal, &ok, Label::kNear);
1317 {
1318 FrameScope scope(masm, StackFrame::INTERNAL);
1319 __ CallRuntime(Runtime::kStackGuard, 0);
1320 }
1321 __ jmp(masm->isolate()->builtins()->OnStackReplacement(),
1322 RelocInfo::CODE_TARGET);
1323
1324 __ bind(&ok);
1325 __ ret(0);
1326 }
1327
1329 #undef __ 1328 #undef __
1330 } 1329 }
1331 } // namespace v8::internal 1330 } // namespace v8::internal
1332 1331
1333 #endif // V8_TARGET_ARCH_IA32 1332 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-osr.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698