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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); | 877 str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); |
878 | 878 |
879 // Save the frame pointer and the context in top. | 879 // Save the frame pointer and the context in top. |
880 mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 880 mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
881 str(fp, MemOperand(ip)); | 881 str(fp, MemOperand(ip)); |
882 mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); | 882 mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); |
883 str(cp, MemOperand(ip)); | 883 str(cp, MemOperand(ip)); |
884 | 884 |
885 // Optionally save all double registers. | 885 // Optionally save all double registers. |
886 if (save_doubles) { | 886 if (save_doubles) { |
| 887 CpuFeatures::Scope scope(VFP2); |
887 // Check CPU flags for number of registers, setting the Z condition flag. | 888 // Check CPU flags for number of registers, setting the Z condition flag. |
888 CheckFor32DRegs(ip); | 889 CheckFor32DRegs(ip); |
889 | 890 |
890 // Push registers d0-d15, and possibly d16-d31, on the stack. | 891 // Push registers d0-d15, and possibly d16-d31, on the stack. |
891 // If d16-d31 are not pushed, decrease the stack pointer instead. | 892 // If d16-d31 are not pushed, decrease the stack pointer instead. |
892 vstm(db_w, sp, d16, d31, ne); | 893 vstm(db_w, sp, d16, d31, ne); |
893 sub(sp, sp, Operand(16 * kDoubleSize), LeaveCC, eq); | 894 sub(sp, sp, Operand(16 * kDoubleSize), LeaveCC, eq); |
894 vstm(db_w, sp, d0, d15); | 895 vstm(db_w, sp, d0, d15); |
895 // Note that d0 will be accessible at | 896 // Note that d0 will be accessible at |
896 // fp - 2 * kPointerSize - DwVfpRegister::kNumRegisters * kDoubleSize, | 897 // fp - 2 * kPointerSize - DwVfpRegister::kMaxNumRegisters * kDoubleSize, |
897 // since the sp slot and code slot were pushed after the fp. | 898 // since the sp slot and code slot were pushed after the fp. |
898 } | 899 } |
899 | 900 |
900 // Reserve place for the return address and stack space and align the frame | 901 // Reserve place for the return address and stack space and align the frame |
901 // preparing for calling the runtime function. | 902 // preparing for calling the runtime function. |
902 const int frame_alignment = MacroAssembler::ActivationFrameAlignment(); | 903 const int frame_alignment = MacroAssembler::ActivationFrameAlignment(); |
903 sub(sp, sp, Operand((stack_space + 1) * kPointerSize)); | 904 sub(sp, sp, Operand((stack_space + 1) * kPointerSize)); |
904 if (frame_alignment > 0) { | 905 if (frame_alignment > 0) { |
905 ASSERT(IsPowerOf2(frame_alignment)); | 906 ASSERT(IsPowerOf2(frame_alignment)); |
906 and_(sp, sp, Operand(-frame_alignment)); | 907 and_(sp, sp, Operand(-frame_alignment)); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 // flag. | 942 // flag. |
942 return FLAG_sim_stack_alignment; | 943 return FLAG_sim_stack_alignment; |
943 #endif // defined(V8_HOST_ARCH_ARM) | 944 #endif // defined(V8_HOST_ARCH_ARM) |
944 } | 945 } |
945 | 946 |
946 | 947 |
947 void MacroAssembler::LeaveExitFrame(bool save_doubles, | 948 void MacroAssembler::LeaveExitFrame(bool save_doubles, |
948 Register argument_count) { | 949 Register argument_count) { |
949 // Optionally restore all double registers. | 950 // Optionally restore all double registers. |
950 if (save_doubles) { | 951 if (save_doubles) { |
| 952 CpuFeatures::Scope scope(VFP2); |
951 // Calculate the stack location of the saved doubles and restore them. | 953 // Calculate the stack location of the saved doubles and restore them. |
952 const int offset = 2 * kPointerSize; | 954 const int offset = 2 * kPointerSize; |
953 sub(r3, fp, Operand(offset + DwVfpRegister::kNumRegisters * kDoubleSize)); | 955 sub(r3, fp, |
| 956 Operand(offset + DwVfpRegister::kMaxNumRegisters * kDoubleSize)); |
954 | 957 |
955 // Check CPU flags for number of registers, setting the Z condition flag. | 958 // Check CPU flags for number of registers, setting the Z condition flag. |
956 CheckFor32DRegs(ip); | 959 CheckFor32DRegs(ip); |
957 | 960 |
958 // Pop registers d0-d15, and possibly d16-d31, from r3. | 961 // Pop registers d0-d15, and possibly d16-d31, from r3. |
959 // If d16-d31 are not popped, increase r3 instead. | 962 // If d16-d31 are not popped, increase r3 instead. |
960 vldm(ia_w, r3, d0, d15); | 963 vldm(ia_w, r3, d0, d15); |
961 vldm(ia_w, r3, d16, d31, ne); | 964 vldm(ia_w, r3, d16, d31, ne); |
962 add(r3, r3, Operand(16 * kDoubleSize), LeaveCC, eq); | 965 add(r3, r3, Operand(16 * kDoubleSize), LeaveCC, eq); |
963 } | 966 } |
(...skipping 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3896 b(ne, call_runtime); | 3899 b(ne, call_runtime); |
3897 | 3900 |
3898 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); | 3901 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
3899 cmp(r2, null_value); | 3902 cmp(r2, null_value); |
3900 b(ne, &next); | 3903 b(ne, &next); |
3901 } | 3904 } |
3902 | 3905 |
3903 | 3906 |
3904 void MacroAssembler::TestJSArrayForAllocationSiteInfo( | 3907 void MacroAssembler::TestJSArrayForAllocationSiteInfo( |
3905 Register receiver_reg, | 3908 Register receiver_reg, |
3906 Register scratch_reg, | 3909 Register scratch_reg) { |
3907 Label* allocation_info_present) { | |
3908 Label no_info_available; | 3910 Label no_info_available; |
3909 ExternalReference new_space_start = | 3911 ExternalReference new_space_start = |
3910 ExternalReference::new_space_start(isolate()); | 3912 ExternalReference::new_space_start(isolate()); |
3911 ExternalReference new_space_allocation_top = | 3913 ExternalReference new_space_allocation_top = |
3912 ExternalReference::new_space_allocation_top_address(isolate()); | 3914 ExternalReference::new_space_allocation_top_address(isolate()); |
3913 add(scratch_reg, receiver_reg, | 3915 add(scratch_reg, receiver_reg, |
3914 Operand(JSArray::kSize + AllocationSiteInfo::kSize - kHeapObjectTag)); | 3916 Operand(JSArray::kSize + AllocationSiteInfo::kSize - kHeapObjectTag)); |
3915 cmp(scratch_reg, Operand(new_space_start)); | 3917 cmp(scratch_reg, Operand(new_space_start)); |
3916 b(lt, &no_info_available); | 3918 b(lt, &no_info_available); |
3917 mov(ip, Operand(new_space_allocation_top)); | 3919 mov(ip, Operand(new_space_allocation_top)); |
3918 ldr(ip, MemOperand(ip)); | 3920 ldr(ip, MemOperand(ip)); |
3919 cmp(scratch_reg, ip); | 3921 cmp(scratch_reg, ip); |
3920 b(gt, &no_info_available); | 3922 b(gt, &no_info_available); |
3921 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationSiteInfo::kSize)); | 3923 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationSiteInfo::kSize)); |
3922 cmp(scratch_reg, | 3924 cmp(scratch_reg, |
3923 Operand(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3925 Operand(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
3924 b(eq, allocation_info_present); | |
3925 bind(&no_info_available); | 3926 bind(&no_info_available); |
3926 } | 3927 } |
3927 | 3928 |
3928 | 3929 |
3929 #ifdef DEBUG | 3930 #ifdef DEBUG |
3930 bool AreAliased(Register reg1, | 3931 bool AreAliased(Register reg1, |
3931 Register reg2, | 3932 Register reg2, |
3932 Register reg3, | 3933 Register reg3, |
3933 Register reg4, | 3934 Register reg4, |
3934 Register reg5, | 3935 Register reg5, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3985 void CodePatcher::EmitCondition(Condition cond) { | 3986 void CodePatcher::EmitCondition(Condition cond) { |
3986 Instr instr = Assembler::instr_at(masm_.pc_); | 3987 Instr instr = Assembler::instr_at(masm_.pc_); |
3987 instr = (instr & ~kCondMask) | cond; | 3988 instr = (instr & ~kCondMask) | cond; |
3988 masm_.emit(instr); | 3989 masm_.emit(instr); |
3989 } | 3990 } |
3990 | 3991 |
3991 | 3992 |
3992 } } // namespace v8::internal | 3993 } } // namespace v8::internal |
3993 | 3994 |
3994 #endif // V8_TARGET_ARCH_ARM | 3995 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |