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

Side by Side Diff: runtime/vm/stub_code_arm.cc

Issue 2279563002: AOT: Single target stub. (Closed)
Patch Set: add offset assertions Created 4 years, 3 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
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 __ bx(R1); 2116 __ bx(R1);
2117 2117
2118 __ Bind(&miss); 2118 __ Bind(&miss);
2119 __ LoadIsolate(R2); 2119 __ LoadIsolate(R2);
2120 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); 2120 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset()));
2121 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); 2121 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset()));
2122 __ bx(R1); 2122 __ bx(R1);
2123 } 2123 }
2124 2124
2125 2125
2126 // Called from switchable IC calls.
2127 // R0: receiver
2128 // R9: SingleTargetCache
2129 // Passed to target:
2130 // CODE_REG: target Code object
2131 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
2132 __ NoMonomorphicCheckedEntry();
2133
2134 Label miss;
2135
2136 __ LoadClassIdMayBeSmi(R1, R0);
2137 __ ldrh(R2, FieldAddress(R9, SingleTargetCache::lower_limit_offset()));
2138 __ ldrh(R3, FieldAddress(R9, SingleTargetCache::upper_limit_offset()));
2139
2140 __ cmp(R1, Operand(R2));
2141 __ b(&miss, LT);
2142 __ cmp(R1, Operand(R3));
2143 __ b(&miss, GT);
2144
2145 __ ldr(R1, FieldAddress(R9, SingleTargetCache::entry_point_offset()));
2146 __ ldr(CODE_REG, FieldAddress(R9, SingleTargetCache::target_offset()));
2147 __ bx(R1);
2148
2149 __ Bind(&miss);
2150 __ EnterStubFrame();
2151 __ Push(R0); // Preserve receiver.
2152
2153 __ PushObject(Object::null_object()); // Result.
2154 __ Push(R0); // Arg0: Receiver
2155 __ CallRuntime(kSingleTargetMissRuntimeEntry, 1);
2156 __ Drop(1);
2157 __ Pop(R9); // result = IC
2158
2159 __ Pop(R0); // Restore receiver.
2160 __ LeaveStubFrame();
2161
2162 __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset()));
2163 __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
2164 __ bx(R1);
2165 }
2166
2167
2126 // Called from the monomorphic checked entry. 2168 // Called from the monomorphic checked entry.
2127 // R0: receiver 2169 // R0: receiver
2128 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { 2170 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
2129 __ EnterStubFrame(); 2171 __ EnterStubFrame();
2130 __ Push(R0); // Preserve receiver. 2172 __ Push(R0); // Preserve receiver.
2131 2173
2132 __ PushObject(Object::null_object()); // Result. 2174 __ PushObject(Object::null_object()); // Result.
2133 __ Push(R0); // Arg0: Receiver 2175 __ Push(R0); // Arg0: Receiver
2134 __ CallRuntime(kMonomorphicMissRuntimeEntry, 1); 2176 __ CallRuntime(kMonomorphicMissRuntimeEntry, 1);
2135 __ Drop(1); 2177 __ Drop(1);
2136 __ Pop(R9); // result = IC 2178 __ Pop(R9); // result = IC
2137 2179
2138 __ Pop(R0); // Restore receiver. 2180 __ Pop(R0); // Restore receiver.
2139 __ LeaveStubFrame(); 2181 __ LeaveStubFrame();
2140 2182
2141 __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); 2183 __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset()));
2142 __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); 2184 __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
2143 __ bx(R1); 2185 __ bx(R1);
2144 } 2186 }
2145 2187
2146 2188
2147 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { 2189 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
2148 __ bkpt(0); 2190 __ bkpt(0);
2149 } 2191 }
2150 2192
2151 } // namespace dart 2193 } // namespace dart
2152 2194
2153 #endif // defined TARGET_ARCH_ARM 2195 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698