| OLD | NEW |
| 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 Loading... |
| 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) { | 608 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, |
| 609 CallRuntime(Runtime::FunctionForId(id), num_arguments); | 609 int num_arguments, |
| 610 SaveFPRegsMode save_doubles) { |
| 611 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles); |
| 610 } | 612 } |
| 611 | 613 |
| 612 | 614 |
| 615 |
| 616 |
| 613 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 617 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { |
| 614 const Runtime::Function* function = Runtime::FunctionForId(id); | 618 const Runtime::Function* function = Runtime::FunctionForId(id); |
| 615 Set(rax, function->nargs); | 619 Set(rax, function->nargs); |
| 616 LoadAddress(rbx, ExternalReference(function, isolate())); | 620 LoadAddress(rbx, ExternalReference(function, isolate())); |
| 617 CEntryStub ces(1, kSaveFPRegs); | 621 CEntryStub ces(1, kSaveFPRegs); |
| 618 CallStub(&ces); | 622 CallStub(&ces); |
| 619 } | 623 } |
| 620 | 624 |
| 621 | 625 |
| 622 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 626 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 623 int num_arguments) { | 627 int num_arguments, |
| 628 SaveFPRegsMode save_doubles) { |
| 624 // If the expected number of arguments of the runtime function is | 629 // If the expected number of arguments of the runtime function is |
| 625 // constant, we check that the actual number of arguments match the | 630 // constant, we check that the actual number of arguments match the |
| 626 // expectation. | 631 // expectation. |
| 627 if (f->nargs >= 0 && f->nargs != num_arguments) { | 632 if (f->nargs >= 0 && f->nargs != num_arguments) { |
| 628 IllegalOperation(num_arguments); | 633 IllegalOperation(num_arguments); |
| 629 return; | 634 return; |
| 630 } | 635 } |
| 631 | 636 |
| 632 // TODO(1236192): Most runtime routines don't need the number of | 637 // TODO(1236192): Most runtime routines don't need the number of |
| 633 // arguments passed in because it is constant. At some point we | 638 // arguments passed in because it is constant. At some point we |
| 634 // should remove this need and make the runtime routine entry code | 639 // should remove this need and make the runtime routine entry code |
| 635 // smarter. | 640 // smarter. |
| 636 Set(rax, num_arguments); | 641 Set(rax, num_arguments); |
| 637 LoadAddress(rbx, ExternalReference(f, isolate())); | 642 LoadAddress(rbx, ExternalReference(f, isolate())); |
| 638 CEntryStub ces(f->result_size); | 643 CEntryStub ces(f->result_size, save_doubles); |
| 639 CallStub(&ces); | 644 CallStub(&ces); |
| 640 } | 645 } |
| 641 | 646 |
| 642 | 647 |
| 643 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 648 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| 644 int num_arguments) { | 649 int num_arguments) { |
| 645 Set(rax, num_arguments); | 650 Set(rax, num_arguments); |
| 646 LoadAddress(rbx, ext); | 651 LoadAddress(rbx, ext); |
| 647 | 652 |
| 648 CEntryStub stub(1); | 653 CEntryStub stub(1); |
| (...skipping 4158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4807 j(greater, &no_memento_available); | 4812 j(greater, &no_memento_available); |
| 4808 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), | 4813 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), |
| 4809 Heap::kAllocationMementoMapRootIndex); | 4814 Heap::kAllocationMementoMapRootIndex); |
| 4810 bind(&no_memento_available); | 4815 bind(&no_memento_available); |
| 4811 } | 4816 } |
| 4812 | 4817 |
| 4813 | 4818 |
| 4814 } } // namespace v8::internal | 4819 } } // namespace v8::internal |
| 4815 | 4820 |
| 4816 #endif // V8_TARGET_ARCH_X64 | 4821 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |