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

Issue 10951026: Fix algorithm to know whether we should emit an is check on a class: all interfaces/implemented cla… (Closed)

Created:
8 years, 3 months ago by ngeoffray
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix algorithm to know whether we should emit an is check on a class: all interfaces/implemented classes must look at their extends clause. Committed: https://code.google.com/p/dart/source/detail?r=12548

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -24 lines) Patch
M lib/compiler/implementation/js_backend/emitter.dart View 1 2 2 chunks +34 lines, -21 lines 0 comments Download
A + tests/language/is_interfaces2_test.dart View 1 2 1 chunk +15 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ngeoffray
8 years, 3 months ago (2012-09-19 09:37:28 UTC) #1
Lasse Reichstein Nielsen
LGTM. https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/js_backend/emitter.dart File lib/compiler/implementation/js_backend/emitter.dart (right): https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/js_backend/emitter.dart#newcode699 lib/compiler/implementation/js_backend/emitter.dart:699: void generateTypeTests(ClassElement cls, Is this generating type-test support ...
8 years, 3 months ago (2012-09-19 09:52:10 UTC) #2
ngeoffray
8 years, 3 months ago (2012-09-19 10:14:39 UTC) #3
Thanks Lasse.

https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/j...
File lib/compiler/implementation/js_backend/emitter.dart (right):

https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/j...
lib/compiler/implementation/js_backend/emitter.dart:699: void
generateTypeTests(ClassElement cls,
On 2012/09/19 09:52:10, Lasse Reichstein Nielsen wrote:
> Is this generating type-test support on cls, or for testing against cls?

Type-test support. I changed the method name.

https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/j...
lib/compiler/implementation/js_backend/emitter.dart:706:
generateInterfacesIsTests(
On 2012/09/19 09:52:10, Lasse Reichstein Nielsen wrote:
> Why is it called "IsTests" in the called function's name, but "TypeTests" in
> this function's name? Is it the same thing?

Renamed everything to IsTest instead of TypeTest.

https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/j...
lib/compiler/implementation/js_backend/emitter.dart:711: void
generateInterfacesIsTests(ClassElement cls,
On 2012/09/19 09:52:10, Lasse Reichstein Nielsen wrote:
> Please document what the function does.
> And the function above too.
> I can't see if what is does is correct without knowing what it should do, and
> the name is not sufficient here.

Done.

https://codereview.chromium.org/10951026/diff/1/lib/compiler/implementation/j...
lib/compiler/implementation/js_backend/emitter.dart:727: // We need to also emit
On 2012/09/19 09:52:10, Lasse Reichstein Nielsen wrote:
> Fix linebreaking. Put quotes around "is-checks" or something similar to make
it
> stand out from the normal words.

Done.

https://codereview.chromium.org/10951026/diff/1/tests/language/is_interfaces2...
File tests/language/is_interfaces2_test.dart (right):

https://codereview.chromium.org/10951026/diff/1/tests/language/is_interfaces2...
tests/language/is_interfaces2_test.dart:17: int inscrutable(int x) => x == 0 ? 0
: x | inscrutable(x & (x - 1));
On 2012/09/19 09:52:10, Lasse Reichstein Nielsen wrote:
> Please add parentheses!

But you should not scrutinize it! :) Done

Powered by Google App Engine
This is Rietveld 408576698