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

Issue 17315008: Optimizing noSuchMethod invocation with no arguments. (Closed)

Created:
7 years, 6 months ago by Florian Schneider
Modified:
7 years, 6 months ago
Reviewers:
srdjan, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Optimizing noSuchMethod invocation with no arguments. On each call that triggers a noSuchMethod invocation we attach a custom dispatch function that allocates the invocation object and invokes noSuchMethod. This dispatcher is compiled and optimized like a normal Dart function. Similar to method-extractors, these implicit dispatchers do not show up as normal functions. As a first step this CL only handles invocations of getters and methods with no like o.foo or o.foo(). This CL gives a >25x speedup of such noSuchMethod invocations. Calls with multiple arguments still go through the slow path. R=srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=24266

Patch Set 1 #

Total comments: 6

Patch Set 2 : addressed comments #

Total comments: 5

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -31 lines) Patch
M runtime/vm/class_finalizer.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/code_generator.cc View 1 4 chunks +67 lines, -7 lines 0 comments Download
M runtime/vm/debugger.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 3 chunks +10 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 3 chunks +10 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler_mips.cc View 3 chunks +10 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 3 chunks +10 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/mirrors_api_impl.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/object.h View 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/parser.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 2 chunks +43 lines, -0 lines 0 comments Download
M runtime/vm/raw_object.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/resolver.cc View 1 chunk +1 line, -1 line 0 comments Download
A tests/language/no_such_method_dispatcher_test.dart View 1 2 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Florian Schneider
7 years, 6 months ago (2013-06-19 17:42:04 UTC) #1
srdjan
Some quick initial comments. What about stacktrace? Is the artificial function hidden? https://codereview.chromium.org/17315008/diff/1/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc ...
7 years, 6 months ago (2013-06-19 18:10:56 UTC) #2
Florian Schneider
Done. Marked the dispatcher functions invisible to hide it in stack traces. https://codereview.chromium.org/17315008/diff/1/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc ...
7 years, 6 months ago (2013-06-20 09:23:33 UTC) #3
srdjan
lgtm https://codereview.chromium.org/17315008/diff/13001/runtime/vm/flow_graph_optimizer.cc File runtime/vm/flow_graph_optimizer.cc (right): https://codereview.chromium.org/17315008/diff/13001/runtime/vm/flow_graph_optimizer.cc#newcode1507 runtime/vm/flow_graph_optimizer.cc:1507: return false; Optional: merge the two conditions into ...
7 years, 6 months ago (2013-06-20 16:34:16 UTC) #4
Ivan Posva
https://codereview.chromium.org/17315008/diff/13001/runtime/vm/resolver.cc File runtime/vm/resolver.cc (right): https://codereview.chromium.org/17315008/diff/13001/runtime/vm/resolver.cc#newcode141 runtime/vm/resolver.cc:141: if (!function.IsNull() && !function.IsNoSuchMethodDispatcher()) { Please add a language ...
7 years, 6 months ago (2013-06-20 17:21:08 UTC) #5
Florian Schneider
https://codereview.chromium.org/17315008/diff/13001/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/17315008/diff/13001/runtime/vm/parser.cc#newcode1143 runtime/vm/parser.cc:1143: On 2013/06/20 16:34:17, srdjan wrote: > ASSERT that func ...
7 years, 6 months ago (2013-06-21 06:46:26 UTC) #6
Florian Schneider
Committed patchset #3 manually as r24266 (presubmit successful).
7 years, 6 months ago (2013-06-21 07:32:06 UTC) #7
srdjan
7 years, 6 months ago (2013-06-24 16:23:15 UTC) #8
Message was sent while issue was closed.
LGTM

Powered by Google App Engine
This is Rietveld 408576698