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

Issue 23627009: Remove inlining restriction of calls to the == operator. (Closed)

Created:
7 years, 3 months ago by Florian Schneider
Modified:
7 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Remove inlining restriction of calls to the == operator. This CL is the first step in enabling full inlining of == calls. Previously, calls to any function with the name "==" were not considered for inlining because super-calls were not handled correctly. Instead of implementing == semantics for super calls in the back-end, the parser now expands super calls to == into let t1 = left, t2 = right { (t1 === null || t2 === null) ? t1 === t2 : static_call(super.==, t1, t2) } This change removes a bit of platform-specific assembly. Normal instance calls to == are still translated as before. Expanding those at the AST level would incur a too high cost in terms of (unoptimized) code size, and also would be an obstruction for optimizations of equality. The plan is to expand those only at optimization time if there is an inlineable instance call to ==. R=kmillikin@google.com Committed: https://code.google.com/p/dart/source/detail?r=27248

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -118 lines) Patch
M runtime/vm/flow_graph_compiler.h View 1 chunk +0 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 chunk +0 lines, -25 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 chunk +0 lines, -28 lines 0 comments Download
M runtime/vm/flow_graph_compiler_mips.cc View 1 chunk +0 lines, -26 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 chunk +0 lines, -28 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M runtime/vm/object.cc View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/vm/parser.cc View 1 chunk +49 lines, -1 line 2 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
7 years, 3 months ago (2013-09-06 12:02:10 UTC) #1
Kevin Millikin (Google)
LGTM, with a suggestion to try out. https://codereview.chromium.org/23627009/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/23627009/diff/1/runtime/vm/parser.cc#newcode1908 runtime/vm/parser.cc:1908: // Expand ...
7 years, 3 months ago (2013-09-06 12:41:09 UTC) #2
Florian Schneider
Committed patchset #1 manually as r27248 (presubmit successful).
7 years, 3 months ago (2013-09-06 13:56:18 UTC) #3
Florian Schneider
7 years, 3 months ago (2013-09-06 13:56:26 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/23627009/diff/1/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

https://codereview.chromium.org/23627009/diff/1/runtime/vm/parser.cc#newcode1908
runtime/vm/parser.cc:1908: // Expand super.== call to match correct == semantics
into:
On 2013/09/06 12:41:09, kmillikin wrote:
> Is it better to expand this as:
> let t1 = left, t2 = right {
>   (t1 === null)
>       ? (t2 === null)  // or (t1 === t2)
>       : (t2 !== null) && static_call(...)
> }
> 
> The AST seems to be the same size and the optimizing compiler should optimizer
> your version, but mine might be more direct for unoptimized code.

I'll leave it as is for now.

Powered by Google App Engine
This is Rietveld 408576698