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

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

Issue 43333003: Move movq(Register, ExternalReference) into X64 MacroAssembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/x64/assembler-x64.cc ('k') | src/x64/code-stubs-x64.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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 // Try to allocate the object without transitioning into C code. If any of 152 // Try to allocate the object without transitioning into C code. If any of
153 // the preconditions is not met, the code bails out to the runtime call. 153 // the preconditions is not met, the code bails out to the runtime call.
154 Label rt_call, allocated; 154 Label rt_call, allocated;
155 if (FLAG_inline_new) { 155 if (FLAG_inline_new) {
156 Label undo_allocation; 156 Label undo_allocation;
157 157
158 #ifdef ENABLE_DEBUGGER_SUPPORT 158 #ifdef ENABLE_DEBUGGER_SUPPORT
159 ExternalReference debug_step_in_fp = 159 ExternalReference debug_step_in_fp =
160 ExternalReference::debug_step_in_fp_address(masm->isolate()); 160 ExternalReference::debug_step_in_fp_address(masm->isolate());
161 __ movq(kScratchRegister, debug_step_in_fp); 161 __ Move(kScratchRegister, debug_step_in_fp);
162 __ cmpq(Operand(kScratchRegister, 0), Immediate(0)); 162 __ cmpq(Operand(kScratchRegister, 0), Immediate(0));
163 __ j(not_equal, &rt_call); 163 __ j(not_equal, &rt_call);
164 #endif 164 #endif
165 165
166 // Verified that the constructor is a JSFunction. 166 // Verified that the constructor is a JSFunction.
167 // Load the initial map and verify that it is in fact a map. 167 // Load the initial map and verify that it is in fact a map.
168 // rdi: constructor 168 // rdi: constructor
169 __ movq(rax, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); 169 __ movq(rax, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
170 // Will both indicate a NULL and a Smi 170 // Will both indicate a NULL and a Smi
171 ASSERT(kSmiTag == 0); 171 ASSERT(kSmiTag == 0);
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 // For now, we are relying on the fact that make_code_young doesn't do any 593 // For now, we are relying on the fact that make_code_young doesn't do any
594 // garbage collection which allows us to save/restore the registers without 594 // garbage collection which allows us to save/restore the registers without
595 // worrying about which of them contain pointers. We also don't build an 595 // worrying about which of them contain pointers. We also don't build an
596 // internal frame to make the code faster, since we shouldn't have to do stack 596 // internal frame to make the code faster, since we shouldn't have to do stack
597 // crawls in MakeCodeYoung. This seems a bit fragile. 597 // crawls in MakeCodeYoung. This seems a bit fragile.
598 598
599 // Re-execute the code that was patched back to the young age when 599 // Re-execute the code that was patched back to the young age when
600 // the stub returns. 600 // the stub returns.
601 __ subq(Operand(rsp, 0), Immediate(5)); 601 __ subq(Operand(rsp, 0), Immediate(5));
602 __ Pushad(); 602 __ Pushad();
603 __ movq(arg_reg_2, 603 __ Move(arg_reg_2, ExternalReference::isolate_address(masm->isolate()));
604 ExternalReference::isolate_address(masm->isolate()));
605 __ movq(arg_reg_1, Operand(rsp, kNumSafepointRegisters * kPointerSize)); 604 __ movq(arg_reg_1, Operand(rsp, kNumSafepointRegisters * kPointerSize));
606 { // NOLINT 605 { // NOLINT
607 FrameScope scope(masm, StackFrame::MANUAL); 606 FrameScope scope(masm, StackFrame::MANUAL);
608 __ PrepareCallCFunction(1); 607 __ PrepareCallCFunction(1);
609 __ CallCFunction( 608 __ CallCFunction(
610 ExternalReference::get_make_code_young_function(masm->isolate()), 1); 609 ExternalReference::get_make_code_young_function(masm->isolate()), 1);
611 } 610 }
612 __ Popad(); 611 __ Popad();
613 __ ret(0); 612 __ ret(0);
614 } 613 }
(...skipping 11 matching lines...) Expand all
626 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) 625 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
627 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR 626 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
628 627
629 628
630 void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) { 629 void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
631 // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact 630 // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
632 // that make_code_young doesn't do any garbage collection which allows us to 631 // that make_code_young doesn't do any garbage collection which allows us to
633 // save/restore the registers without worrying about which of them contain 632 // save/restore the registers without worrying about which of them contain
634 // pointers. 633 // pointers.
635 __ Pushad(); 634 __ Pushad();
636 __ movq(arg_reg_2, ExternalReference::isolate_address(masm->isolate())); 635 __ Move(arg_reg_2, ExternalReference::isolate_address(masm->isolate()));
637 __ movq(arg_reg_1, Operand(rsp, kNumSafepointRegisters * kPointerSize)); 636 __ movq(arg_reg_1, Operand(rsp, kNumSafepointRegisters * kPointerSize));
638 __ subq(arg_reg_1, Immediate(Assembler::kShortCallInstructionLength)); 637 __ subq(arg_reg_1, Immediate(Assembler::kShortCallInstructionLength));
639 { // NOLINT 638 { // NOLINT
640 FrameScope scope(masm, StackFrame::MANUAL); 639 FrameScope scope(masm, StackFrame::MANUAL);
641 __ PrepareCallCFunction(1); 640 __ PrepareCallCFunction(1);
642 __ CallCFunction( 641 __ CallCFunction(
643 ExternalReference::get_mark_code_as_executed_function(masm->isolate()), 642 ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
644 1); 643 1);
645 } 644 }
646 __ Popad(); 645 __ Popad();
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 __ bind(&ok); 1436 __ bind(&ok);
1438 __ ret(0); 1437 __ ret(0);
1439 } 1438 }
1440 1439
1441 1440
1442 #undef __ 1441 #undef __
1443 1442
1444 } } // namespace v8::internal 1443 } } // namespace v8::internal
1445 1444
1446 #endif // V8_TARGET_ARCH_X64 1445 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698