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

Issue 11361225: In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The… (Closed)

Created:
8 years, 1 month ago by srdjan
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The optimized IC call increments usage counter and reoptimizes optimized function if the threshold is met. Recognize closure calls and mark them in ICData. Closure calls do not populate ICData, i.e., number of checks is always 0 (unless mixed closure calls with regular instance calls). Therefore closure IC calls do not count for reoptimization. Committed: https://code.google.com/p/dart/source/detail?r=14860

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 8

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+430 lines, -61 lines) Patch
M runtime/vm/code_generator.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 5 chunks +27 lines, -19 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 4 3 chunks +34 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.h View 1 2 3 4 3 chunks +12 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.h View 1 2 3 4 3 chunks +12 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 3 4 2 chunks +10 lines, -4 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 4 3 chunks +39 lines, -8 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 4 3 chunks +39 lines, -5 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/stub_code.h View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 4 4 chunks +93 lines, -12 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 4 4 chunks +90 lines, -11 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
srdjan
8 years, 1 month ago (2012-11-12 20:37:24 UTC) #1
Kevin Millikin (Google)
LGTM with some small comments. https://codereview.chromium.org/11361225/diff/13005/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): https://codereview.chromium.org/11361225/diff/13005/runtime/vm/code_generator.cc#newcode1492 runtime/vm/code_generator.cc:1492: reinterpret_cast<uword>(ic_data.raw()), You don't have ...
8 years, 1 month ago (2012-11-13 17:56:53 UTC) #2
srdjan
8 years, 1 month ago (2012-11-13 18:21:38 UTC) #3
Thanks!

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/code_generator.cc
File runtime/vm/code_generator.cc (right):

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/code_generator...
runtime/vm/code_generator.cc:1492: reinterpret_cast<uword>(ic_data.raw()),
On 2012/11/13 17:56:53, kmillikin wrote:
> You don't have to cast the pointer to uword and use format specifier %Px.  You
> can just leave it as a pointer and use %p.

Done.

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/flow_graph_com...
File runtime/vm/flow_graph_compiler_ia32.cc (right):

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/flow_graph_com...
runtime/vm/flow_graph_compiler_ia32.cc:1053: // Load top function since it may
not correspond to the ICData function.
On 2012/11/13 17:56:53, kmillikin wrote:
> Expand this comment to include why it can be different, with an example, so we
> can remember why we did it this way.

Done:

  // Each ICData propagated from unoptimized to optimized code contains the
  // function that corresponds to the Dart function of that IC call. Due
  // to inlining in optimized code, that function may not correspond to the
  // top-level function (parsed_function().function()) which could be
  // reoptimized and which counter needs to be incremented.
  // Pass the function explicitly.

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/intermediate_l...
File runtime/vm/intermediate_language_ia32.cc (right):

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/intermediate_l...
runtime/vm/intermediate_language_ia32.cc:64: compiler->GenerateCall(0,  // no
token position.
On 2012/11/13 17:56:53, kmillikin wrote:
> I always have to figure out why we optimize at return instead of entry.  Let's
> put a comment here (unless you can think of somewhere better) explaining the
> reasons in case we want to revisit the design later.

Done:
// Attempt optimized compilation at return instruction instead of at the entry.
// The entry needs to be patchable, no inlined objects are allowed in the area
// that will be overwritten by the patch instruction: a jump).

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/object.h
File runtime/vm/object.h (right):

https://codereview.chromium.org/11361225/diff/13005/runtime/vm/object.h#newco...
runtime/vm/object.h:2803: return raw_ptr()->is_closure_call_  == 1;
On 2012/11/13 17:56:53, kmillikin wrote:
> There's an extra space before ==.

Done.

Powered by Google App Engine
This is Rietveld 408576698