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

Issue 1944483002: Redo how Type objects are exposed from DDC. (Closed)

Created:
4 years, 7 months ago by Bob Nystrom
Modified:
4 years, 7 months ago
Reviewers:
vsm, Jennifer Messerly
CC:
dev-compiler+reviews_dartlang.org
Base URL:
https://github.com/dart-lang/dev_compiler.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Redo how Type objects are exposed from DDC. - Instead of using the raw runtime type that DDC uses for its type checks, use a WrappedType that correctly implements Type's interface. - Compile class literals to wrap the type in a WrappedType. - Make Object.runtimeType() do the same thing. Fixes #488. Fixes #511. R=jmesserly@google.com Committed: https://github.com/dart-lang/dev_compiler/commit/d8cce189dcdfa51491830c8d11b2f9baa4853bb9

Patch Set 1 #

Total comments: 17

Patch Set 2 : Make it better! #

Total comments: 6

Patch Set 3 : More tweaks. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+299 lines, -172 lines) Patch
M lib/runtime/dart_library.js View 1 chunk +0 lines, -9 lines 0 comments Download
M lib/runtime/dart_sdk.js View 1 41 chunks +81 lines, -60 lines 0 comments Download
M lib/src/compiler/code_generator.dart View 1 2 4 chunks +27 lines, -2 lines 0 comments Download
M test/browser/runtime_tests.js View 1 11 chunks +25 lines, -33 lines 0 comments Download
M test/codegen/expect/misc.js View 1 2 chunks +4 lines, -4 lines 0 comments Download
A test/codegen/language/type_literal_test.dart View 1 chunk +52 lines, -0 lines 0 comments Download
M tool/input_sdk/lib/js/dart2js/js_dart2js.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tool/input_sdk/patch/core_patch.dart View 1 chunk +1 line, -1 line 0 comments Download
M tool/input_sdk/private/ddc_runtime/operations.dart View 1 5 chunks +5 lines, -5 lines 0 comments Download
M tool/input_sdk/private/ddc_runtime/rtti.dart View 1 5 chunks +37 lines, -22 lines 0 comments Download
M tool/input_sdk/private/ddc_runtime/types.dart View 1 5 chunks +49 lines, -22 lines 0 comments Download
M tool/input_sdk/private/debugger.dart View 1 5 chunks +10 lines, -10 lines 0 comments Download
M tool/input_sdk/private/js_helper.dart View 1 chunk +1 line, -1 line 0 comments Download
M tool/input_sdk/private/js_rti.dart View 1 chunk +1 line, -1 line 0 comments Download
A tool/patch_sdk.sh View 1 chunk +4 lines, -0 lines 0 comments Download
M tool/sdk_expected_errors.txt View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (2 generated)
Bob Nystrom
4 years, 7 months ago (2016-05-02 22:17:49 UTC) #2
Bob Nystrom
https://codereview.chromium.org/1944483002/diff/1/lib/src/compiler/code_generator.dart File lib/src/compiler/code_generator.dart (right): https://codereview.chromium.org/1944483002/diff/1/lib/src/compiler/code_generator.dart#newcode122 lib/src/compiler/code_generator.dart:122: bool _compilingSdkLibrary = false; This is kind of nasty, ...
4 years, 7 months ago (2016-05-02 22:19:09 UTC) #3
Jennifer Messerly
Wow this is really nice! Like the wrapType idea. A few small comments but this ...
4 years, 7 months ago (2016-05-02 23:04:20 UTC) #4
Bob Nystrom
Thanks for the review! https://codereview.chromium.org/1944483002/diff/1/lib/src/compiler/code_generator.dart File lib/src/compiler/code_generator.dart (right): https://codereview.chromium.org/1944483002/diff/1/lib/src/compiler/code_generator.dart#newcode344 lib/src/compiler/code_generator.dart:344: _compilingSdkLibrary = unit.element.source.uri.scheme == "dart"; ...
4 years, 7 months ago (2016-05-03 20:50:47 UTC) #5
Jennifer Messerly
a few tiny nits otherwise LGTM!!! https://codereview.chromium.org/1944483002/diff/20001/lib/src/compiler/code_generator.dart File lib/src/compiler/code_generator.dart (right): https://codereview.chromium.org/1944483002/diff/20001/lib/src/compiler/code_generator.dart#newcode2022 lib/src/compiler/code_generator.dart:2022: // A type ...
4 years, 7 months ago (2016-05-03 20:59:54 UTC) #6
Bob Nystrom
Committed patchset #3 (id:40001) manually as d8cce189dcdfa51491830c8d11b2f9baa4853bb9 (presubmit successful).
4 years, 7 months ago (2016-05-03 21:24:13 UTC) #8
Bob Nystrom
4 years, 7 months ago (2016-05-03 21:24:32 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1944483002/diff/20001/lib/src/compiler/code_g...
File lib/src/compiler/code_generator.dart (right):

https://codereview.chromium.org/1944483002/diff/20001/lib/src/compiler/code_g...
lib/src/compiler/code_generator.dart:2022: // A type literal expression in use.
Wrap the runtime type in a "Type" object.
On 2016/05/03 20:59:54, John Messerly wrote:
> long line.

Oops. Meant to delete that comment (I moved it outside of the if()). Fixed.

https://codereview.chromium.org/1944483002/diff/20001/lib/src/compiler/code_g...
lib/src/compiler/code_generator.dart:2496: // HTML library where an argument to
JS() is itself a JS() call. If those
On 2016/05/03 20:59:54, John Messerly wrote:
> haha, wow. The crazy stuff you find sometimes :)

Acknowledged.

https://codereview.chromium.org/1944483002/diff/20001/lib/src/compiler/code_g...
lib/src/compiler/code_generator.dart:2499: try {
On 2016/05/03 20:59:54, John Messerly wrote:
> nit: try/finally is not needed. We will never try and reuse this visitor
> instance if something goes wrong and throws (that means an internal compiler
> error). So handling an exception is not required.

Done.

Powered by Google App Engine
This is Rietveld 408576698