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

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

Issue 27802002: Disconnects code objects from infrequently used unoptimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 (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"
11 #include "vm/compiler.h"
11 #include "vm/dart_entry.h" 12 #include "vm/dart_entry.h"
12 #include "vm/deopt_instructions.h" 13 #include "vm/deopt_instructions.h"
13 #include "vm/il_printer.h" 14 #include "vm/il_printer.h"
14 #include "vm/locations.h" 15 #include "vm/locations.h"
15 #include "vm/object_store.h" 16 #include "vm/object_store.h"
16 #include "vm/parser.h" 17 #include "vm/parser.h"
17 #include "vm/stack_frame.h" 18 #include "vm/stack_frame.h"
18 #include "vm/stub_code.h" 19 #include "vm/stub_code.h"
19 #include "vm/symbols.h" 20 #include "vm/symbols.h"
20 21
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 __ cmp(R4, ShifterOperand(R0)); 1362 __ cmp(R4, ShifterOperand(R0));
1362 __ b(&update, NE); 1363 __ b(&update, NE);
1363 1364
1364 __ Bind(&call_target_function); 1365 __ Bind(&call_target_function);
1365 // Call the target found in the cache. For a class id match, this is a 1366 // Call the target found in the cache. For a class id match, this is a
1366 // proper target for the given name and arguments descriptor. If the 1367 // proper target for the given name and arguments descriptor. If the
1367 // illegal class id was found, the target is a cache miss handler that can 1368 // illegal class id was found, the target is a cache miss handler that can
1368 // be invoked as a normal Dart function. 1369 // be invoked as a normal Dart function.
1369 __ add(IP, R2, ShifterOperand(R3, LSL, 2)); 1370 __ add(IP, R2, ShifterOperand(R3, LSL, 2));
1370 __ ldr(R0, FieldAddress(IP, base + kWordSize)); 1371 __ ldr(R0, FieldAddress(IP, base + kWordSize));
1371 __ ldr(R0, FieldAddress(R0, Function::code_offset())); 1372 __ ldr(R1, FieldAddress(R0, Function::code_offset()));
1372 __ ldr(R0, FieldAddress(R0, Code::instructions_offset())); 1373 if (FLAG_collect_code) {
1374 // If we are collecting code, the code object may be null.
1375 Label is_compiled;
1376 __ CompareImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
1377 __ b(&is_compiled, NE);
1378 __ EnterStubFrame();
srdjan 2013/10/23 15:58:13 I am not sure that we can do EnterStubFrame in com
zra 2013/10/23 17:39:37 Can the megamorphic call be a call to unoptimized
zra 2013/10/23 23:27:52 Moved call to a stub.
1379 // Preserve arg desc. and IC data object.
1380 __ PushList((1 << R4) | (1 << R5));
1381 __ Push(R0); // Pass function.
1382 __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
1383 __ Pop(R0); // Discard argument.
1384 __ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data.
1385 __ LeaveStubFrame();
1386 // R0: target function.
1387 __ ldr(R1, FieldAddress(R0, Function::code_offset()));
1388 __ Bind(&is_compiled);
1389 }
1390 __ ldr(R0, FieldAddress(R1, Code::instructions_offset()));
1373 __ LoadObject(R5, ic_data); 1391 __ LoadObject(R5, ic_data);
1374 __ LoadObject(R4, arguments_descriptor); 1392 __ LoadObject(R4, arguments_descriptor);
1375 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); 1393 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
1376 __ blx(R0); 1394 __ blx(R0);
1377 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); 1395 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos);
1378 RecordSafepoint(locs); 1396 RecordSafepoint(locs);
1379 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); 1397 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
1380 __ Drop(argument_count); 1398 __ Drop(argument_count);
1381 } 1399 }
1382 1400
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 DRegister dreg = EvenDRegisterOf(reg); 1929 DRegister dreg = EvenDRegisterOf(reg);
1912 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1930 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1913 } 1931 }
1914 1932
1915 1933
1916 #undef __ 1934 #undef __
1917 1935
1918 } // namespace dart 1936 } // namespace dart
1919 1937
1920 #endif // defined TARGET_ARCH_ARM 1938 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698