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

Issue 9844003: More type checking performance improvements and a bug fix in intrinsifier. (Closed)

Created:
8 years, 8 months ago by srdjan
Modified:
8 years, 8 months ago
Reviewers:
regis, sra1
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

More type checking performance improvements and a bug fix in intrinsifier. With "frog --leg", type checked mdoe is now "only" 5x slower (used to be 10x). Committed: https://code.google.com/p/dart/source/detail?r=5915

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -12 lines) Patch
M runtime/vm/code_generator_ia32.cc View 1 2 3 8 chunks +43 lines, -9 lines 4 comments Download
M runtime/vm/intrinsifier_ia32.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
srdjan
8 years, 8 months ago (2012-03-27 21:42:01 UTC) #1
regis
LGTM!!
8 years, 8 months ago (2012-03-27 22:04:48 UTC) #2
sra1
DBC https://chromiumcodereview.appspot.com/9844003/diff/6003/runtime/vm/code_generator_ia32.cc File runtime/vm/code_generator_ia32.cc (right): https://chromiumcodereview.appspot.com/9844003/diff/6003/runtime/vm/code_generator_ia32.cc#newcode1550 runtime/vm/code_generator_ia32.cc:1550: Label loop_done, loop; This is a test where ...
8 years, 8 months ago (2012-03-28 01:16:50 UTC) #3
srdjan
8 years, 8 months ago (2012-03-28 01:46:23 UTC) #4
https://chromiumcodereview.appspot.com/9844003/diff/6003/runtime/vm/code_gene...
File runtime/vm/code_generator_ia32.cc (right):

https://chromiumcodereview.appspot.com/9844003/diff/6003/runtime/vm/code_gene...
runtime/vm/code_generator_ia32.cc:1550: Label loop_done, loop;
On 2012/03/28 01:16:50, sra1 wrote:
> This is a test where Dart can be much faster than JS.
> This was a single test in Oberon.
> Each class descriptor contains a table of pointers to all the superclasses,
> including a self reference at the slot corresponding to the depth of the class
> (number of extends from Object).
> 
> x is C =>
>   x->class_offset->superclasses[C.extends_depth] == C.descriptor
> 
> Since C.extends_depth and C.descriptor are constants by this time, the
generated
> code can be:
> 
>   mov r2, [r1 + class_offset]
>   cmp [r2 + superclasses + C.extends_depth*4], #C.descriptor
>   jz yes
> 
> The original paper "Type-extension type test can be performed in constant
time",
> Norman H. Cohen, has a check on the inheritance depth but that can be avoided
in
> most cases (depth <= K) by always allocating at least K slots, or storing
> something after the table that cannot contain a pointer to a class descriptor.

> If a variable sized descriptor is not possible, some clever hybrid could be
> used, e.g. keep the top K slots in-line in the class descriptor, so most 'x is
> C' tests can use the fast trick and fall back on the loop (bounded by a depth
> check instead of null check) for depth > K.

Thanks. The purpose of this CL is to quickly eliminate runtime calls, which are
still the most expensive part of checked mode. A quick supertype check is on our
TODO list.

https://chromiumcodereview.appspot.com/9844003/diff/6003/runtime/vm/code_gene...
runtime/vm/code_generator_ia32.cc:1618: __ cmpl(EDI, Immediate(0));
On 2012/03/28 01:16:50, sra1 wrote:
> Should be unnecessary since SUB sets CC

Thanks. Next CL.

Powered by Google App Engine
This is Rietveld 408576698