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

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

Issue 203523011: Introduce a lazy-compile stub for functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 6 years, 8 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler_ia32.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" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 __ b(&update, NE); 1273 __ b(&update, NE);
1274 1274
1275 __ Bind(&call_target_function); 1275 __ Bind(&call_target_function);
1276 // Call the target found in the cache. For a class id match, this is a 1276 // Call the target found in the cache. For a class id match, this is a
1277 // proper target for the given name and arguments descriptor. If the 1277 // proper target for the given name and arguments descriptor. If the
1278 // illegal class id was found, the target is a cache miss handler that can 1278 // illegal class id was found, the target is a cache miss handler that can
1279 // be invoked as a normal Dart function. 1279 // be invoked as a normal Dart function.
1280 __ add(IP, R2, ShifterOperand(R3, LSL, 2)); 1280 __ add(IP, R2, ShifterOperand(R3, LSL, 2));
1281 __ ldr(R0, FieldAddress(IP, base + kWordSize)); 1281 __ ldr(R0, FieldAddress(IP, base + kWordSize));
1282 __ ldr(R1, FieldAddress(R0, Function::code_offset())); 1282 __ ldr(R1, FieldAddress(R0, Function::code_offset()));
1283 if (FLAG_collect_code) { 1283 __ ldr(R1, FieldAddress(R1, Code::instructions_offset()));
1284 // If we are collecting code, the code object may be null.
1285 Label is_compiled;
1286 __ CompareImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
1287 __ b(&is_compiled, NE);
1288 __ BranchLinkPatchable(&StubCode::CompileFunctionRuntimeCallLabel());
1289 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1290 Isolate::kNoDeoptId,
1291 token_pos);
1292 RecordSafepoint(locs);
1293 // R0: target function.
1294 __ ldr(R1, FieldAddress(R0, Function::code_offset()));
1295 __ Bind(&is_compiled);
1296 }
1297 __ ldr(R0, FieldAddress(R1, Code::instructions_offset()));
1298 __ LoadObject(R5, ic_data); 1284 __ LoadObject(R5, ic_data);
1299 __ LoadObject(R4, arguments_descriptor); 1285 __ LoadObject(R4, arguments_descriptor);
1300 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); 1286 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag);
1301 __ blx(R0); 1287 __ blx(R1);
1302 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); 1288 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos);
1303 RecordSafepoint(locs); 1289 RecordSafepoint(locs);
1304 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); 1290 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
1305 __ Drop(argument_count); 1291 __ Drop(argument_count);
1306 } 1292 }
1307 1293
1308 1294
1309 void FlowGraphCompiler::EmitUnoptimizedStaticCall( 1295 void FlowGraphCompiler::EmitUnoptimizedStaticCall(
1310 const Function& target_function, 1296 const Function& target_function,
1311 const Array& arguments_descriptor, 1297 const Array& arguments_descriptor,
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 DRegister dreg = EvenDRegisterOf(reg); 1787 DRegister dreg = EvenDRegisterOf(reg);
1802 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1788 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1803 } 1789 }
1804 1790
1805 1791
1806 #undef __ 1792 #undef __
1807 1793
1808 } // namespace dart 1794 } // namespace dart
1809 1795
1810 #endif // defined TARGET_ARCH_ARM 1796 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698