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 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 | 2614 |
2615 | 2615 |
2616 void MacroAssembler::GetLeastBitsFromInt32(Register dst, | 2616 void MacroAssembler::GetLeastBitsFromInt32(Register dst, |
2617 Register src, | 2617 Register src, |
2618 int num_least_bits) { | 2618 int num_least_bits) { |
2619 and_(dst, src, Operand((1 << num_least_bits) - 1)); | 2619 and_(dst, src, Operand((1 << num_least_bits) - 1)); |
2620 } | 2620 } |
2621 | 2621 |
2622 | 2622 |
2623 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 2623 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
2624 int num_arguments) { | 2624 int num_arguments, |
| 2625 SaveFPRegsMode save_doubles) { |
2625 // All parameters are on the stack. r0 has the return value after call. | 2626 // All parameters are on the stack. r0 has the return value after call. |
2626 | 2627 |
2627 // If the expected number of arguments of the runtime function is | 2628 // If the expected number of arguments of the runtime function is |
2628 // constant, we check that the actual number of arguments match the | 2629 // constant, we check that the actual number of arguments match the |
2629 // expectation. | 2630 // expectation. |
2630 if (f->nargs >= 0 && f->nargs != num_arguments) { | 2631 if (f->nargs >= 0 && f->nargs != num_arguments) { |
2631 IllegalOperation(num_arguments); | 2632 IllegalOperation(num_arguments); |
2632 return; | 2633 return; |
2633 } | 2634 } |
2634 | 2635 |
2635 // TODO(1236192): Most runtime routines don't need the number of | 2636 // TODO(1236192): Most runtime routines don't need the number of |
2636 // arguments passed in because it is constant. At some point we | 2637 // arguments passed in because it is constant. At some point we |
2637 // should remove this need and make the runtime routine entry code | 2638 // should remove this need and make the runtime routine entry code |
2638 // smarter. | 2639 // smarter. |
2639 mov(r0, Operand(num_arguments)); | 2640 mov(r0, Operand(num_arguments)); |
2640 mov(r1, Operand(ExternalReference(f, isolate()))); | 2641 mov(r1, Operand(ExternalReference(f, isolate()))); |
2641 CEntryStub stub(1); | 2642 CEntryStub stub(1, save_doubles); |
2642 CallStub(&stub); | 2643 CallStub(&stub); |
2643 } | 2644 } |
2644 | 2645 |
2645 | |
2646 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { | |
2647 CallRuntime(Runtime::FunctionForId(fid), num_arguments); | |
2648 } | |
2649 | |
2650 | |
2651 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | |
2652 const Runtime::Function* function = Runtime::FunctionForId(id); | |
2653 mov(r0, Operand(function->nargs)); | |
2654 mov(r1, Operand(ExternalReference(function, isolate()))); | |
2655 CEntryStub stub(1, kSaveFPRegs); | |
2656 CallStub(&stub); | |
2657 } | |
2658 | |
2659 | 2646 |
2660 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 2647 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
2661 int num_arguments) { | 2648 int num_arguments) { |
2662 mov(r0, Operand(num_arguments)); | 2649 mov(r0, Operand(num_arguments)); |
2663 mov(r1, Operand(ext)); | 2650 mov(r1, Operand(ext)); |
2664 | 2651 |
2665 CEntryStub stub(1); | 2652 CEntryStub stub(1); |
2666 CallStub(&stub); | 2653 CallStub(&stub); |
2667 } | 2654 } |
2668 | 2655 |
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3984 void CodePatcher::EmitCondition(Condition cond) { | 3971 void CodePatcher::EmitCondition(Condition cond) { |
3985 Instr instr = Assembler::instr_at(masm_.pc_); | 3972 Instr instr = Assembler::instr_at(masm_.pc_); |
3986 instr = (instr & ~kCondMask) | cond; | 3973 instr = (instr & ~kCondMask) | cond; |
3987 masm_.emit(instr); | 3974 masm_.emit(instr); |
3988 } | 3975 } |
3989 | 3976 |
3990 | 3977 |
3991 } } // namespace v8::internal | 3978 } } // namespace v8::internal |
3992 | 3979 |
3993 #endif // V8_TARGET_ARCH_ARM | 3980 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |