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

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

Issue 119036: * Modify simulator and ARM code generator to avoid swi... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 #else 121 #else
122 // set lr for return at current pc + 8 122 // set lr for return at current pc + 8
123 mov(lr, Operand(pc), LeaveCC, cond); 123 mov(lr, Operand(pc), LeaveCC, cond);
124 mov(pc, Operand(target), LeaveCC, cond); 124 mov(pc, Operand(target), LeaveCC, cond);
125 #endif 125 #endif
126 } 126 }
127 127
128 128
129 void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode, 129 void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode,
130 Condition cond) { 130 Condition cond) {
131 #if !defined(__arm__)
132 if (rmode == RelocInfo::RUNTIME_ENTRY) {
133 mov(r2, Operand(target, rmode), LeaveCC, cond);
134 // Set lr for return at current pc + 8.
135 mov(lr, Operand(pc), LeaveCC, cond);
136 // Emit a ldr<cond> pc, [pc + offset of target in constant pool].
137 // Notify the simulator of the transition to C code.
138 swi(assembler::arm::call_rt_r2);
139 } else {
140 // set lr for return at current pc + 8
141 mov(lr, Operand(pc), LeaveCC, cond);
142 // emit a ldr<cond> pc, [pc + offset of target in constant pool]
143 mov(pc, Operand(target, rmode), LeaveCC, cond);
144 }
145 #else
146 // Set lr for return at current pc + 8. 131 // Set lr for return at current pc + 8.
147 mov(lr, Operand(pc), LeaveCC, cond); 132 mov(lr, Operand(pc), LeaveCC, cond);
148 // Emit a ldr<cond> pc, [pc + offset of target in constant pool]. 133 // Emit a ldr<cond> pc, [pc + offset of target in constant pool].
149 mov(pc, Operand(target, rmode), LeaveCC, cond); 134 mov(pc, Operand(target, rmode), LeaveCC, cond);
150 #endif // !defined(__arm__)
151 // If USE_BLX is defined, we could emit a 'mov ip, target', followed by a 135 // If USE_BLX is defined, we could emit a 'mov ip, target', followed by a
152 // 'blx ip'; however, the code would not be shorter than the above sequence 136 // 'blx ip'; however, the code would not be shorter than the above sequence
153 // and the target address of the call would be referenced by the first 137 // and the target address of the call would be referenced by the first
154 // instruction rather than the second one, which would make it harder to patch 138 // instruction rather than the second one, which would make it harder to patch
155 // (two instructions before the return address, instead of one). 139 // (two instructions before the return address, instead of one).
156 ASSERT(kTargetAddrToReturnAddrDist == sizeof(Instr)); 140 ASSERT(kTargetAddrToReturnAddrDist == sizeof(Instr));
157 } 141 }
158 142
159 143
160 void MacroAssembler::Call(byte* target, RelocInfo::Mode rmode, 144 void MacroAssembler::Call(byte* target, RelocInfo::Mode rmode,
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 #endif 934 #endif
951 mov(r0, Operand(p0)); 935 mov(r0, Operand(p0));
952 push(r0); 936 push(r0);
953 mov(r0, Operand(Smi::FromInt(p1 - p0))); 937 mov(r0, Operand(Smi::FromInt(p1 - p0)));
954 push(r0); 938 push(r0);
955 CallRuntime(Runtime::kAbort, 2); 939 CallRuntime(Runtime::kAbort, 2);
956 // will not return here 940 // will not return here
957 } 941 }
958 942
959 } } // namespace v8::internal 943 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698