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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2015113002: DBC: Collect type feedback for fastpath smi ops (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add comment Created 4 years, 6 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/constants_dbc.h ('k') | runtime/vm/object_dbc_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 4704219e55303d585104b9f0a3d9b964f0f0a7c6..1763877650fd9f87dc487a408f86553d6a3872df 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3038,6 +3038,34 @@ static const StubEntry* TwoArgsSmiOpInlineCacheEntry(Token::Kind kind) {
default: return NULL;
}
}
+#else
+static void TryFastPathSmiOp(
+ FlowGraphCompiler* compiler, ICData* call_ic_data, const String& name) {
+ if (!FLAG_two_args_smi_icd) {
+ return;
+ }
+ if (name.raw() == Symbols::Plus().raw()) {
+ __ AddTOS();
+ } else if (name.raw() == Symbols::Minus().raw()) {
+ __ SubTOS();
+ } else if (name.raw() == Symbols::EqualOperator().raw()) {
+ __ EqualTOS();
+ } else if (name.raw() == Symbols::LAngleBracket().raw()) {
+ __ LessThanTOS();
+ } else if (name.raw() == Symbols::RAngleBracket().raw()) {
+ __ GreaterThanTOS();
+ } else if (name.raw() == Symbols::BitAnd().raw()) {
+ __ BitAndTOS();
+ } else if (name.raw() == Symbols::BitOr().raw()) {
+ __ BitOrTOS();
+ } else if (name.raw() == Symbols::Star().raw()) {
+ __ MulTOS();
+ } else {
+ return;
+ }
+ bool is_smi_two_args_op = call_ic_data->AddSmiSmiCheckForFastSmiStubs();
+ ASSERT(is_smi_two_args_op);
+}
#endif
@@ -3110,28 +3138,14 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
}
#else
- call_ic_data = &ICData::ZoneHandle(call_ic_data->Original());
+ ICData* ic_data = &ICData::ZoneHandle(call_ic_data->Original());
// Emit smi fast path instruction. If fast-path succeeds it skips the next
// instruction otherwise it falls through.
- if (function_name().raw() == Symbols::Plus().raw()) {
- __ AddTOS();
- } else if (function_name().raw() == Symbols::EqualOperator().raw()) {
- __ EqualTOS();
- } else if (function_name().raw() == Symbols::LAngleBracket().raw()) {
- __ LessThanTOS();
- } else if (function_name().raw() == Symbols::RAngleBracket().raw()) {
- __ GreaterThanTOS();
- } else if (function_name().raw() == Symbols::BitAnd().raw()) {
- __ BitAndTOS();
- } else if (function_name().raw() == Symbols::BitOr().raw()) {
- __ BitOrTOS();
- } else if (function_name().raw() == Symbols::Star().raw()) {
- __ MulTOS();
- }
+ TryFastPathSmiOp(compiler, ic_data, function_name());
const intptr_t call_ic_data_kidx = __ AddConstant(*call_ic_data);
- switch (call_ic_data->NumArgsTested()) {
+ switch (ic_data->NumArgsTested()) {
case 1:
if (compiler->is_optimizing()) {
__ InstanceCall1Opt(ArgumentCount(), call_ic_data_kidx);
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/object_dbc_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698