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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 22839003: Polymorphic inlining for some recognized methods in the optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed modulo performance regression 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') | runtime/vm/intermediate_language.h » ('j') | 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 26420)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1390,23 +1390,6 @@
}
-void FlowGraphOptimizer::InlineArrayLengthGetter(InstanceCallInstr* call,
- intptr_t length_offset,
- bool is_immutable,
- MethodRecognizer::Kind kind) {
- AddReceiverCheck(call);
-
- LoadFieldInstr* load = new LoadFieldInstr(
- new Value(call->ArgumentAt(0)),
- length_offset,
- Type::ZoneHandle(Type::SmiType()),
- is_immutable);
- load->set_result_cid(kSmiCid);
- load->set_recognized_kind(kind);
- ReplaceCall(call, load);
-}
-
-
void FlowGraphOptimizer::InlineGrowableArrayCapacityGetter(
InstanceCallInstr* call) {
AddReceiverCheck(call);
@@ -1446,13 +1429,6 @@
}
-void FlowGraphOptimizer::InlineStringLengthGetter(InstanceCallInstr* call) {
- AddReceiverCheck(call);
- LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0));
- ReplaceCall(call, load);
-}
-
-
void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) {
AddReceiverCheck(call);
@@ -1475,25 +1451,6 @@
}
-static intptr_t OffsetForLengthGetter(MethodRecognizer::Kind kind) {
- switch (kind) {
- case MethodRecognizer::kObjectArrayLength:
- case MethodRecognizer::kImmutableArrayLength:
- return Array::length_offset();
- case MethodRecognizer::kTypedDataLength:
- // .length is defined in _TypedList which is the base class for internal
- // and external typed data.
- ASSERT(TypedData::length_offset() == ExternalTypedData::length_offset());
- return TypedData::length_offset();
- case MethodRecognizer::kGrowableArrayLength:
- return GrowableObjectArray::length_offset();
- default:
- UNREACHABLE();
- return 0;
- }
-}
-
-
bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call,
MethodRecognizer::Kind getter) {
if (!ShouldInlineSimd()) {
@@ -1678,34 +1635,9 @@
InlineObjectCid(call);
return true;
}
- case MethodRecognizer::kObjectArrayLength:
- case MethodRecognizer::kImmutableArrayLength:
- case MethodRecognizer::kTypedDataLength:
- case MethodRecognizer::kGrowableArrayLength: {
- if (!ic_data.HasOneTarget()) {
- // TODO(srdjan): Implement for mutiple targets.
- return false;
- }
- const bool is_immutable =
- (recognized_kind == MethodRecognizer::kObjectArrayLength) ||
- (recognized_kind == MethodRecognizer::kImmutableArrayLength) ||
- (recognized_kind == MethodRecognizer::kTypedDataLength);
- InlineArrayLengthGetter(call,
- OffsetForLengthGetter(recognized_kind),
- is_immutable,
- recognized_kind);
- return true;
- }
case MethodRecognizer::kGrowableArrayCapacity:
InlineGrowableArrayCapacityGetter(call);
return true;
- case MethodRecognizer::kStringBaseLength:
- if (!ic_data.HasOneTarget()) {
- // Target is not only StringBase_get_length.
- return false;
- }
- InlineStringLengthGetter(call);
- return true;
case MethodRecognizer::kStringBaseIsEmpty:
if (!ic_data.HasOneTarget()) {
// Target is not only StringBase_get_isEmpty.
@@ -1735,7 +1667,7 @@
return InlineUint32x4Getter(call, recognized_kind);
}
default:
- ASSERT(recognized_kind == MethodRecognizer::kUnknown);
+ break;
}
return false;
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698