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

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

Issue 288213002: Refactor MacroAssembler::Prologue. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 7 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/arm/macro-assembler-arm.h ('k') | src/arm64/full-codegen-arm64.cc » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #include "v8.h" 7 #include "v8.h"
8 8
9 #if V8_TARGET_ARCH_ARM 9 #if V8_TARGET_ARCH_ARM
10 10
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 void MacroAssembler::LoadConstantPoolPointerRegister() { 895 void MacroAssembler::LoadConstantPoolPointerRegister() {
896 if (FLAG_enable_ool_constant_pool) { 896 if (FLAG_enable_ool_constant_pool) {
897 int constant_pool_offset = Code::kConstantPoolOffset - Code::kHeaderSize - 897 int constant_pool_offset = Code::kConstantPoolOffset - Code::kHeaderSize -
898 pc_offset() - Instruction::kPCReadOffset; 898 pc_offset() - Instruction::kPCReadOffset;
899 ASSERT(ImmediateFitsAddrMode2Instruction(constant_pool_offset)); 899 ASSERT(ImmediateFitsAddrMode2Instruction(constant_pool_offset));
900 ldr(pp, MemOperand(pc, constant_pool_offset)); 900 ldr(pp, MemOperand(pc, constant_pool_offset));
901 } 901 }
902 } 902 }
903 903
904 904
905 void MacroAssembler::Prologue(CompilationInfo* info) { 905 void MacroAssembler::StubPrologue() {
906 if (info->IsStub()) { 906 PushFixedFrame();
907 PushFixedFrame(); 907 Push(Smi::FromInt(StackFrame::STUB));
908 Push(Smi::FromInt(StackFrame::STUB)); 908 // Adjust FP to point to saved FP.
909 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
910 if (FLAG_enable_ool_constant_pool) {
911 LoadConstantPoolPointerRegister();
912 set_constant_pool_available(true);
913 }
914 }
915
916
917 void MacroAssembler::Prologue(bool code_pre_aging) {
918 PredictableCodeSizeScope predictible_code_size_scope(
919 this, kNoCodeAgeSequenceLength);
920 // The following three instructions must remain together and unmodified
921 // for code aging to work properly.
922 if (code_pre_aging) {
923 // Pre-age the code.
924 Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
925 add(r0, pc, Operand(-8));
926 ldr(pc, MemOperand(pc, -4));
927 emit_code_stub_address(stub);
928 } else {
929 PushFixedFrame(r1);
930 nop(ip.code());
909 // Adjust FP to point to saved FP. 931 // Adjust FP to point to saved FP.
910 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 932 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
911 } else {
912 PredictableCodeSizeScope predictible_code_size_scope(
913 this, kNoCodeAgeSequenceLength);
914 // The following three instructions must remain together and unmodified
915 // for code aging to work properly.
916 if (info->IsCodePreAgingActive()) {
917 // Pre-age the code.
918 Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
919 add(r0, pc, Operand(-8));
920 ldr(pc, MemOperand(pc, -4));
921 emit_code_stub_address(stub);
922 } else {
923 PushFixedFrame(r1);
924 nop(ip.code());
925 // Adjust FP to point to saved FP.
926 add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
927 }
928 } 933 }
929 if (FLAG_enable_ool_constant_pool) { 934 if (FLAG_enable_ool_constant_pool) {
930 LoadConstantPoolPointerRegister(); 935 LoadConstantPoolPointerRegister();
931 set_constant_pool_available(true); 936 set_constant_pool_available(true);
932 } 937 }
933 } 938 }
934 939
935 940
936 void MacroAssembler::EnterFrame(StackFrame::Type type, 941 void MacroAssembler::EnterFrame(StackFrame::Type type,
937 bool load_constant_pool) { 942 bool load_constant_pool) {
(...skipping 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after
4058 sub(result, result, Operand(dividend)); 4063 sub(result, result, Operand(dividend));
4059 } 4064 }
4060 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); 4065 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift()));
4061 add(result, result, Operand(dividend, LSR, 31)); 4066 add(result, result, Operand(dividend, LSR, 31));
4062 } 4067 }
4063 4068
4064 4069
4065 } } // namespace v8::internal 4070 } } // namespace v8::internal
4066 4071
4067 #endif // V8_TARGET_ARCH_ARM 4072 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698