Chromium Code Reviews| 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 881 void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) { | 881 void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) { |
| 882 if (dst.code() < 16) { | 882 if (dst.code() < 16) { |
| 883 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); | 883 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(dst.code()); |
| 884 vmov(loc.low(), src); | 884 vmov(loc.low(), src); |
| 885 } else { | 885 } else { |
| 886 vmov(dst, VmovIndexLo, src); | 886 vmov(dst, VmovIndexLo, src); |
| 887 } | 887 } |
| 888 } | 888 } |
| 889 | 889 |
| 890 | 890 |
| 891 void MacroAssembler::LoadConstantPoolPointerRegister() { | |
| 892 if (FLAG_enable_ool_constant_pool) { | |
| 893 int constant_pool_offset = | |
| 894 Code::kConstantPoolOffset - Code::kHeaderSize - pc_offset() - 8; | |
|
Rodolph Perfetta (ARM)
2014/03/11 13:28:34
8 -> kPCReadOffset
rmcilroy
2014/03/11 16:36:34
Done.
| |
| 895 ASSERT(ImmediateFitsAddrMode2Instruction(constant_pool_offset)); | |
| 896 ldr(pp, MemOperand(pc, constant_pool_offset)); | |
| 897 } | |
| 898 } | |
| 899 | |
| 900 | |
| 891 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { | 901 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { |
| 892 if (frame_mode == BUILD_STUB_FRAME) { | 902 if (frame_mode == BUILD_STUB_FRAME) { |
| 893 PushFixedFrame(); | 903 PushFixedFrame(); |
| 894 Push(Smi::FromInt(StackFrame::STUB)); | 904 Push(Smi::FromInt(StackFrame::STUB)); |
| 895 // Adjust FP to point to saved FP. | 905 // Adjust FP to point to saved FP. |
| 896 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 906 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 897 } else { | 907 } else { |
| 898 PredictableCodeSizeScope predictible_code_size_scope( | 908 PredictableCodeSizeScope predictible_code_size_scope( |
| 899 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | 909 this, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
| 900 // The following three instructions must remain together and unmodified | 910 // The following three instructions must remain together and unmodified |
| 901 // for code aging to work properly. | 911 // for code aging to work properly. |
| 902 if (isolate()->IsCodePreAgingActive()) { | 912 if (isolate()->IsCodePreAgingActive()) { |
| 903 // Pre-age the code. | 913 // Pre-age the code. |
| 904 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); | 914 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
| 905 add(r0, pc, Operand(-8)); | 915 add(r0, pc, Operand(-8)); |
| 906 ldr(pc, MemOperand(pc, -4)); | 916 ldr(pc, MemOperand(pc, -4)); |
| 907 emit_code_stub_address(stub); | 917 emit_code_stub_address(stub); |
| 908 } else { | 918 } else { |
| 909 PushFixedFrame(r1); | 919 PushFixedFrame(r1); |
| 910 nop(ip.code()); | 920 nop(ip.code()); |
| 911 // Adjust FP to point to saved FP. | 921 // Adjust FP to point to saved FP. |
| 912 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 922 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 913 } | 923 } |
| 914 } | 924 } |
| 925 if (FLAG_enable_ool_constant_pool) { | |
| 926 LoadConstantPoolPointerRegister(); | |
| 927 set_constant_pool_available(true); | |
| 928 } | |
| 915 } | 929 } |
| 916 | 930 |
| 917 | 931 |
| 918 void MacroAssembler::LoadConstantPoolPointerRegister() { | 932 void MacroAssembler::EnterFrame(StackFrame::Type type, |
| 919 if (FLAG_enable_ool_constant_pool) { | 933 bool load_constant_pool) { |
| 920 int constant_pool_offset = | |
| 921 Code::kConstantPoolOffset - Code::kHeaderSize - pc_offset() - 8; | |
| 922 ASSERT(ImmediateFitsAddrMode2Instruction(constant_pool_offset)); | |
| 923 ldr(pp, MemOperand(pc, constant_pool_offset)); | |
| 924 } | |
| 925 } | |
| 926 | |
| 927 | |
| 928 void MacroAssembler::EnterFrame(StackFrame::Type type) { | |
| 929 // r0-r3: preserved | 934 // r0-r3: preserved |
| 930 PushFixedFrame(); | 935 PushFixedFrame(); |
| 936 if (FLAG_enable_ool_constant_pool && load_constant_pool) { | |
| 937 LoadConstantPoolPointerRegister(); | |
| 938 } | |
| 931 mov(ip, Operand(Smi::FromInt(type))); | 939 mov(ip, Operand(Smi::FromInt(type))); |
| 932 push(ip); | 940 push(ip); |
| 933 mov(ip, Operand(CodeObject())); | 941 mov(ip, Operand(CodeObject())); |
| 934 push(ip); | 942 push(ip); |
| 935 // Adjust FP to point to saved FP. | 943 // Adjust FP to point to saved FP. |
| 936 add(fp, sp, | 944 add(fp, sp, |
| 937 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); | 945 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize)); |
| 938 } | 946 } |
| 939 | 947 |
| 940 | 948 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 968 Push(lr, fp); | 976 Push(lr, fp); |
| 969 mov(fp, Operand(sp)); // Set up new frame pointer. | 977 mov(fp, Operand(sp)); // Set up new frame pointer. |
| 970 // Reserve room for saved entry sp and code object. | 978 // Reserve room for saved entry sp and code object. |
| 971 sub(sp, sp, Operand(ExitFrameConstants::kFrameSize)); | 979 sub(sp, sp, Operand(ExitFrameConstants::kFrameSize)); |
| 972 if (emit_debug_code()) { | 980 if (emit_debug_code()) { |
| 973 mov(ip, Operand::Zero()); | 981 mov(ip, Operand::Zero()); |
| 974 str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset)); | 982 str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset)); |
| 975 } | 983 } |
| 976 if (FLAG_enable_ool_constant_pool) { | 984 if (FLAG_enable_ool_constant_pool) { |
| 977 str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); | 985 str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); |
| 986 LoadConstantPoolPointerRegister(); | |
| 978 } | 987 } |
| 979 mov(ip, Operand(CodeObject())); | 988 mov(ip, Operand(CodeObject())); |
| 980 str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); | 989 str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); |
| 981 | 990 |
| 982 // Save the frame pointer and the context in top. | 991 // Save the frame pointer and the context in top. |
| 983 mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 992 mov(ip, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
| 984 str(fp, MemOperand(ip)); | 993 str(fp, MemOperand(ip)); |
| 985 mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); | 994 mov(ip, Operand(ExternalReference(Isolate::kContextAddress, isolate()))); |
| 986 str(cp, MemOperand(ip)); | 995 str(cp, MemOperand(ip)); |
| 987 | 996 |
| (...skipping 3040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4028 void CodePatcher::EmitCondition(Condition cond) { | 4037 void CodePatcher::EmitCondition(Condition cond) { |
| 4029 Instr instr = Assembler::instr_at(masm_.pc_); | 4038 Instr instr = Assembler::instr_at(masm_.pc_); |
| 4030 instr = (instr & ~kCondMask) | cond; | 4039 instr = (instr & ~kCondMask) | cond; |
| 4031 masm_.emit(instr); | 4040 masm_.emit(instr); |
| 4032 } | 4041 } |
| 4033 | 4042 |
| 4034 | 4043 |
| 4035 } } // namespace v8::internal | 4044 } } // namespace v8::internal |
| 4036 | 4045 |
| 4037 #endif // V8_TARGET_ARCH_ARM | 4046 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |