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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 23756002: Allow inlining of methods that have an intrinsic translation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 26851)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1408,29 +1408,6 @@
}
-void FlowGraphOptimizer::InlineGrowableArrayCapacityGetter(
- InstanceCallInstr* call) {
- AddReceiverCheck(call);
-
- // TODO(srdjan): type of load should be GrowableObjectArrayType.
- LoadFieldInstr* data_load = new LoadFieldInstr(
- new Value(call->ArgumentAt(0)),
- Array::data_offset(),
- Type::ZoneHandle(Type::DynamicType()));
- data_load->set_result_cid(kArrayCid);
- InsertBefore(call, data_load, NULL, Definition::kValue);
-
- LoadFieldInstr* length_load = new LoadFieldInstr(
- new Value(data_load),
- Array::length_offset(),
- Type::ZoneHandle(Type::SmiType()));
- length_load->set_result_cid(kSmiCid);
- length_load->set_recognized_kind(MethodRecognizer::kObjectArrayLength);
-
- ReplaceCall(call, length_load);
-}
-
-
static LoadFieldInstr* BuildLoadStringLength(Definition* str) {
// Treat length loads as mutable (i.e. affected by side effects) to avoid
// hoisting them since we can't hoist the preceding class-check. This
@@ -1447,28 +1424,6 @@
}
-void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) {
- AddReceiverCheck(call);
-
- LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0));
- InsertBefore(call, load, NULL, Definition::kValue);
-
- ConstantInstr* zero = flow_graph()->GetConstant(Smi::Handle(Smi::New(0)));
- StrictCompareInstr* compare =
- new StrictCompareInstr(call->token_pos(),
- Token::kEQ_STRICT,
- new Value(load),
- new Value(zero));
- ReplaceCall(call, compare);
-}
-
-
-void FlowGraphOptimizer::InlineObjectCid(InstanceCallInstr* call) {
- LoadClassIdInstr* load = new LoadClassIdInstr(new Value(call->ArgumentAt(0)));
- ReplaceCall(call, load);
-}
-
-
bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call,
MethodRecognizer::Kind getter) {
if (!ShouldInlineSimd()) {
@@ -1649,20 +1604,6 @@
// VM objects length getter.
switch (recognized_kind) {
- case MethodRecognizer::kObjectCid: {
- InlineObjectCid(call);
- return true;
- }
- case MethodRecognizer::kGrowableArrayCapacity:
- InlineGrowableArrayCapacityGetter(call);
- return true;
- case MethodRecognizer::kStringBaseIsEmpty:
- if (!ic_data.HasOneTarget()) {
- // Target is not only StringBase_get_isEmpty.
- return false;
- }
- InlineStringIsEmptyGetter(call);
- return true;
case MethodRecognizer::kFloat32x4ShuffleX:
case MethodRecognizer::kFloat32x4ShuffleY:
case MethodRecognizer::kFloat32x4ShuffleZ:
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698