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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 23530066: Lazily save double registers for HCallRuntime instructions within Hydrogen code stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/x64/macro-assembler-x64.h ('k') | no next file » | 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 // hash: key's hash field, including its array index value. 598 // hash: key's hash field, including its array index value.
599 and_(hash, Immediate(String::kArrayIndexValueMask)); 599 and_(hash, Immediate(String::kArrayIndexValueMask));
600 shr(hash, Immediate(String::kHashShift)); 600 shr(hash, Immediate(String::kHashShift));
601 // Here we actually clobber the key which will be used if calling into 601 // Here we actually clobber the key which will be used if calling into
602 // runtime later. However as the new key is the numeric value of a string key 602 // runtime later. However as the new key is the numeric value of a string key
603 // there is no difference in using either key. 603 // there is no difference in using either key.
604 Integer32ToSmi(index, hash); 604 Integer32ToSmi(index, hash);
605 } 605 }
606 606
607 607
608 void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) {
609 CallRuntime(Runtime::FunctionForId(id), num_arguments);
610 }
611
612
613 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) {
614 const Runtime::Function* function = Runtime::FunctionForId(id);
615 Set(rax, function->nargs);
616 LoadAddress(rbx, ExternalReference(function, isolate()));
617 CEntryStub ces(1, kSaveFPRegs);
618 CallStub(&ces);
619 }
620
621
622 void MacroAssembler::CallRuntime(const Runtime::Function* f, 608 void MacroAssembler::CallRuntime(const Runtime::Function* f,
623 int num_arguments) { 609 int num_arguments,
610 SaveFPRegsMode save_doubles) {
624 // If the expected number of arguments of the runtime function is 611 // If the expected number of arguments of the runtime function is
625 // constant, we check that the actual number of arguments match the 612 // constant, we check that the actual number of arguments match the
626 // expectation. 613 // expectation.
627 if (f->nargs >= 0 && f->nargs != num_arguments) { 614 if (f->nargs >= 0 && f->nargs != num_arguments) {
628 IllegalOperation(num_arguments); 615 IllegalOperation(num_arguments);
629 return; 616 return;
630 } 617 }
631 618
632 // TODO(1236192): Most runtime routines don't need the number of 619 // TODO(1236192): Most runtime routines don't need the number of
633 // arguments passed in because it is constant. At some point we 620 // arguments passed in because it is constant. At some point we
634 // should remove this need and make the runtime routine entry code 621 // should remove this need and make the runtime routine entry code
635 // smarter. 622 // smarter.
636 Set(rax, num_arguments); 623 Set(rax, num_arguments);
637 LoadAddress(rbx, ExternalReference(f, isolate())); 624 LoadAddress(rbx, ExternalReference(f, isolate()));
638 CEntryStub ces(f->result_size); 625 CEntryStub ces(f->result_size, save_doubles);
639 CallStub(&ces); 626 CallStub(&ces);
640 } 627 }
641 628
642 629
643 void MacroAssembler::CallExternalReference(const ExternalReference& ext, 630 void MacroAssembler::CallExternalReference(const ExternalReference& ext,
644 int num_arguments) { 631 int num_arguments) {
645 Set(rax, num_arguments); 632 Set(rax, num_arguments);
646 LoadAddress(rbx, ext); 633 LoadAddress(rbx, ext);
647 634
648 CEntryStub stub(1); 635 CEntryStub stub(1);
(...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after
4917 j(greater, &no_memento_available); 4904 j(greater, &no_memento_available);
4918 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4905 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4919 Heap::kAllocationMementoMapRootIndex); 4906 Heap::kAllocationMementoMapRootIndex);
4920 bind(&no_memento_available); 4907 bind(&no_memento_available);
4921 } 4908 }
4922 4909
4923 4910
4924 } } // namespace v8::internal 4911 } } // namespace v8::internal
4925 4912
4926 #endif // V8_TARGET_ARCH_X64 4913 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698