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

Issue 8845002: Function type checking: Part Deux (Closed)

Created:
9 years ago by codefu
Modified:
9 years ago
Reviewers:
mmendez
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Function type checking: Part Deux This replaced the following CL that was falling behind head. http://codereview.chromium.org/8566022/ Summary: Add support for function runtime type checking and typedefs; re-worked to support tree-shaking at head. Static, instance, top level, and hoisted methods have RTT lookup methods to identify their types. Respective getters() and binds() have been updated or added to link the lookup methods to bounded methods. Static method getters were added as well to perform this linking for non-bound situations. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2263

Patch Set 1 #

Total comments: 15

Patch Set 2 : Nits checked #

Unified diffs Side-by-side diffs Delta from patch set Stats (+754 lines, -219 lines) Patch
M compiler/java/com/google/dart/compiler/backend/js/ClosureJsCodingConvention.java View 1 chunk +0 lines, -39 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/DartMangler.java View 1 1 chunk +7 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/DollarMangler.java View 1 2 chunks +11 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java View 1 15 chunks +102 lines, -35 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/JsNameProvider.java View 1 chunk +3 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/RuntimeTypeInjector.java View 1 11 chunks +334 lines, -5 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java View 2 chunks +5 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java View 4 chunks +57 lines, -16 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 1 chunk +3 lines, -0 lines 0 comments Download
D compiler/javatests/com/google/dart/compiler/backend/js/ClosureJsCodingConventionTest.java View 1 chunk +0 lines, -30 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/backend/js/JsBackendTests.java View 1 chunk +0 lines, -1 line 0 comments Download
M compiler/javatests/com/google/dart/compiler/common/GenerateSourceMapTest.java View 1 chunk +5 lines, -0 lines 0 comments Download
M compiler/lib/implementation/core.js View 1 2 chunks +117 lines, -53 lines 0 comments Download
M compiler/lib/implementation/rtt.js View 1 6 chunks +99 lines, -4 lines 0 comments Download
M tests/co19/co19-compiler.status View 1 chunk +7 lines, -28 lines 0 comments Download
M tests/language/language.status View 4 chunks +4 lines, -5 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
codefu
PTAL
9 years ago (2011-12-07 16:32:04 UTC) #1
mmendez
LGTM Feel free to address the comments in a follow on patch. As an FYI, ...
9 years ago (2011-12-07 20:03:00 UTC) #2
codefu
9 years ago (2011-12-07 21:44:54 UTC) #3
Cleaned up nits; running tests now.

http://codereview.chromium.org/8845002/diff/1/compiler/java/com/google/dart/c...
File
compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java
(right):

http://codereview.chromium.org/8845002/diff/1/compiler/java/com/google/dart/c...
compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java:609:
String mangledRttMethodName = mangledMethodName + "_$lookupRTT";
On 2011/12/07 20:03:00, mmendez wrote:
> Nit: you could add this logic to the mangler instance which should make
changing
> the mangling simpler.

Done.

http://codereview.chromium.org/8845002/diff/1/compiler/java/com/google/dart/c...
compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java:642:
func.setName(globalScope.declareName(getterJsNameRef.toString()));
Could this just be func.setName(getterJsNameRef.getName())?

http://codereview.chromium.org/8845002/diff/1/compiler/java/com/google/dart/c...
compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java:643:
asg = func;
On 2011/12/07 20:03:00, mmendez wrote:
> Missing call to setSourceRef?

Top levels didn't have a $getter before this change. I could move the
asg.setSourceRef() to below the if/else.

http://codereview.chromium.org/8845002/diff/1/compiler/java/com/google/dart/c...
compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java:2994:
hoistedRttName = hoistedName.toString() + "_$lookupRTT";
On 2011/12/07 20:03:00, mmendez wrote:
> Nit: See comment above about name mangling.

Done and updated in all the other locations.

http://codereview.chromium.org/8845002/diff/1/compiler/javatests/com/google/d...
File
compiler/javatests/com/google/dart/compiler/backend/js/ClosureJsCodingConventionTest.java
(left):

http://codereview.chromium.org/8845002/diff/1/compiler/javatests/com/google/d...
compiler/javatests/com/google/dart/compiler/backend/js/ClosureJsCodingConventionTest.java:16:
public class ClosureJsCodingConventionTest extends TestCase {
On 2011/12/07 20:03:00, mmendez wrote:
> Nit: it might be worth while to leave this in but simply update it to cover
the
> behaviors that we care about.

This test was failing bellow after we removed the overridden
describeFunctionBind() from ClosureJsCodeingConvention()

http://codereview.chromium.org/8845002/diff/1/compiler/lib/implementation/cor...
File compiler/lib/implementation/core.js (right):

http://codereview.chromium.org/8845002/diff/1/compiler/lib/implementation/cor...
compiler/lib/implementation/core.js:17: if (fRtt) {
On 2011/12/07 20:03:00, mmendez wrote:
> Nit: this if (fRtt) block could be moved to a common function.

Done.

http://codereview.chromium.org/8845002/diff/1/compiler/lib/implementation/rtt.js
File compiler/lib/implementation/rtt.js (right):

http://codereview.chromium.org/8845002/diff/1/compiler/lib/implementation/rtt...
compiler/lib/implementation/rtt.js:317: function getDynamic() {
On 2011/12/07 20:03:00, mmendez wrote:
> Do you still need this function to pass optimized tests?

Not anymore. John Lenz solved this by pointing out I needed to use
newQualifiedNameRef() in RuntimeTypeInjector.

http://codereview.chromium.org/8845002/diff/1/tests/language/language.status
File tests/language/language.status (right):

http://codereview.chromium.org/8845002/diff/1/tests/language/language.status#...
tests/language/language.status:88: BlackListedTest/13: Fail # Bug 5469684
On 2011/12/07 20:03:00, mmendez wrote:
> Nit: Will these now failing tests pass with your subsequent patch?

No. The blacklisted tests should all report compile time errors as it tests
implementing or extending certain internal classes/interfaces

Powered by Google App Engine
This is Rietveld 408576698