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

Issue 10807069: Split TypeGuard and BailoutTarget. (Closed)

Created:
8 years, 5 months ago by floitsch
Modified:
8 years, 4 months ago
Reviewers:
ricow1, ngeoffray
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Split TypeGuard and BailoutTarget. By splitting the guard and the bailout-target we can merge more targets. Take for instance the following code: x = a[i]; t = x << 4; We can merge the bailout-targets for both guards to jump before the 'x'. This means that we will do more work (when we bail out), but it will reduce the code-size. It also allows us to do the following optimization: x = a[i]; // knowing that 'a' is a JS array. if (x < 10) ... => if (typeof i != 'number') bailout-to-1; x = a[i]; if (typeof x != 'number') bailout-to-1; if (x < 10) ... Note that we don't do an integer check on 'i', and that we don't do an out-of-bounds check. Indeed, if i is out-of-bounds (or not an integer) then we will get 'undefined' back which is not a number. Since the bailout-target is before the array-access we will execute it again in bailout-code and correctly throw an exception there. Committed: https://code.google.com/p/dart/source/detail?r=9813

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address comments. #

Patch Set 3 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -111 lines) Patch
M lib/compiler/implementation/ssa/bailout.dart View 1 8 chunks +42 lines, -53 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 19 chunks +55 lines, -42 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 7 chunks +29 lines, -10 lines 0 comments Download
M lib/compiler/implementation/ssa/tracer.dart View 1 2 chunks +21 lines, -6 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
floitsch
8 years, 5 months ago (2012-07-23 11:34:37 UTC) #1
ricow1
LGTM with a few comments https://chromiumcodereview.appspot.com/10807069/diff/1/lib/compiler/implementation/ssa/bailout.dart File lib/compiler/implementation/ssa/bailout.dart (right): https://chromiumcodereview.appspot.com/10807069/diff/1/lib/compiler/implementation/ssa/bailout.dart#newcode354 lib/compiler/implementation/ssa/bailout.dart:354: assert(guard.inputs.length == 2); Why ...
8 years, 5 months ago (2012-07-23 12:52:26 UTC) #2
floitsch
https://chromiumcodereview.appspot.com/10807069/diff/1/lib/compiler/implementation/ssa/bailout.dart File lib/compiler/implementation/ssa/bailout.dart (right): https://chromiumcodereview.appspot.com/10807069/diff/1/lib/compiler/implementation/ssa/bailout.dart#newcode354 lib/compiler/implementation/ssa/bailout.dart:354: assert(guard.inputs.length == 2); On 2012/07/23 12:52:26, ricow1 wrote: > ...
8 years, 5 months ago (2012-07-23 13:27:48 UTC) #3
ricow1
LGTM
8 years, 5 months ago (2012-07-23 13:35:12 UTC) #4
ngeoffray
Just for the record: why making the split?
8 years, 4 months ago (2012-08-16 12:34:46 UTC) #5
floitsch
On 2012/08/16 12:34:46, ngeoffray wrote: > Just for the record: why making the split? Updated ...
8 years, 4 months ago (2012-08-16 14:19:07 UTC) #6
ngeoffray
8 years, 4 months ago (2012-08-16 14:26:00 UTC) #7
On 2012/08/16 14:19:07, floitsch wrote:
> On 2012/08/16 12:34:46, ngeoffray wrote:
> > Just for the record: why making the split?
> 
> Updated the description.

Thanks!

Powered by Google App Engine
This is Rietveld 408576698