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

Side by Side Diff: runtime/vm/flow_graph_compiler_mips.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 1406
1406 ASSERT(kIllegalCid == 0); 1407 ASSERT(kIllegalCid == 0);
1407 __ beq(T4, ZR, &call_target_function); 1408 __ beq(T4, ZR, &call_target_function);
1408 __ bne(T4, T0, &update); 1409 __ bne(T4, T0, &update);
1409 1410
1410 __ Bind(&call_target_function); 1411 __ Bind(&call_target_function);
1411 // Call the target found in the cache. For a class id match, this is a 1412 // Call the target found in the cache. For a class id match, this is a
1412 // proper target for the given name and arguments descriptor. If the 1413 // proper target for the given name and arguments descriptor. If the
1413 // illegal class id was found, the target is a cache miss handler that can 1414 // illegal class id was found, the target is a cache miss handler that can
1414 // be invoked as a normal Dart function. 1415 // be invoked as a normal Dart function.
1415 __ sll(TMP1, T3, 2); 1416 __ sll(T1, T3, 2);
1416 __ addu(TMP1, T2, TMP1); 1417 __ addu(T1, T2, T1);
1417 __ lw(T0, FieldAddress(TMP, base + kWordSize)); 1418 __ lw(T0, FieldAddress(T1, base + kWordSize));
1418 __ lw(T0, FieldAddress(T0, Function::code_offset())); 1419 __ lw(T1, FieldAddress(T0, Function::code_offset()));
1419 __ lw(T0, FieldAddress(T0, Code::instructions_offset())); 1420 if (FLAG_collect_code) {
1421 // If we are collecting code, the code object may be null.
1422 Label is_compiled;
1423 __ BranchNotEqual(T1, reinterpret_cast<int32_t>(Object::null()),
1424 &is_compiled);
1425 __ EnterStubFrame();
1426 __ addiu(SP, SP, Immediate(-3 * kWordSize));
1427 __ sw(S5, Address(SP, 2 * kWordSize)); // Preserve IC data.
1428 __ sw(S4, Address(SP, 1 * kWordSize)); // Preserve arg desc.
1429 __ sw(T0, Address(SP, 0 * kWordSize)); // Function argument.
1430 __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
1431 __ lw(T0, Address(SP, 0 * kWordSize)); // Restore function.
1432 __ lw(S4, Address(SP, 1 * kWordSize)); // Restore arg desc.
1433 __ lw(S5, Address(SP, 2 * kWordSize)); // Restore IC data.
1434 __ addiu(SP, SP, Immediate(3 * kWordSize));
1435 __ LeaveStubFrame();
1436 __ lw(T1, FieldAddress(T0, Function::code_offset()));
1437 __ Bind(&is_compiled);
1438 }
1439 __ lw(T0, FieldAddress(T1, Code::instructions_offset()));
1420 __ LoadObject(S5, ic_data); 1440 __ LoadObject(S5, ic_data);
1421 __ LoadObject(S4, arguments_descriptor); 1441 __ LoadObject(S4, arguments_descriptor);
1422 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); 1442 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
1423 __ jalr(T0); 1443 __ jalr(T0);
1424 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); 1444 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos);
1425 RecordSafepoint(locs); 1445 RecordSafepoint(locs);
1426 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); 1446 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
1427 __ Drop(argument_count); 1447 __ Drop(argument_count);
1428 } 1448 }
1429 1449
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 __ AddImmediate(SP, kDoubleSize); 2026 __ AddImmediate(SP, kDoubleSize);
2007 } 2027 }
2008 2028
2009 2029
2010 #undef __ 2030 #undef __
2011 2031
2012 2032
2013 } // namespace dart 2033 } // namespace dart
2014 2034
2015 #endif // defined TARGET_ARCH_MIPS 2035 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698