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

Issue 19693011: Fix some bugs regarding native fields. (Closed)

Created:
7 years, 5 months ago by ahe
Modified:
7 years, 5 months ago
Reviewers:
ngeoffray, sra1
CC:
reviews_dartlang.org, Johnni Winther, karlklose
Visibility:
Public.

Description

Fix some bugs regarding native fields. BUG=http://dartbug.com/11894, http://dartbug.com/11525 R=ngeoffray@google.com Committed: https://code.google.com/p/dart/source/detail?r=25272

Patch Set 1 #

Total comments: 14

Patch Set 2 : Remove debug code and add a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -108 lines) Patch
M dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart View 1 chunk +2 lines, -3 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/compiler.dart View 2 chunks +5 lines, -1 line 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 8 chunks +156 lines, -104 lines 0 comments Download
A dart/tests/compiler/dart2js_native/rti_only_native_test.dart View 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
ahe
7 years, 5 months ago (2013-07-19 19:42:49 UTC) #1
sra1
https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compiler/implementation/compiler.dart File dart/sdk/lib/_internal/compiler/implementation/compiler.dart (right): https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compiler/implementation/compiler.dart#newcode960 dart/sdk/lib/_internal/compiler/implementation/compiler.dart:960: assembledCode = null; // Signals failure. Where is the ...
7 years, 5 months ago (2013-07-19 22:07:57 UTC) #2
ahe
I'll add some more comments to the code before submitting. https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compiler/implementation/compiler.dart File dart/sdk/lib/_internal/compiler/implementation/compiler.dart (right): https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compiler/implementation/compiler.dart#newcode960 ...
7 years, 5 months ago (2013-07-20 12:16:52 UTC) #3
ngeoffray
LGTM https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart File dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right): https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart#newcode1705 dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:1705: visitClassFields(classElement, emitStatics, MAke the following anonymous function a ...
7 years, 5 months ago (2013-07-22 12:04:03 UTC) #4
ahe
Committed patchset #2 manually as r25272 (presubmit successful).
7 years, 5 months ago (2013-07-22 12:31:28 UTC) #5
ahe
7 years, 5 months ago (2013-07-22 12:32:05 UTC) #6
Message was sent while issue was closed.
Thank you, Stephen and Nicolas.

Stephen, if you have additional comments, I'll address them in a follow-up CL.

https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compil...
File dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
(right):

https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compil...
dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:1705:
visitClassFields(classElement, emitStatics,
On 2013/07/22 12:04:03, ngeoffray wrote:
> MAke the following anonymous function a function in the emitter?

I thought of that, but it would require more parameters.  At least the following
local variables are captured: classIsNative, fieldMetadata, and hasMetadata.

https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compil...
dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:1748: if
(member.isInstanceMember()) {
On 2013/07/20 12:16:52, ahe wrote:
> On 2013/07/19 22:07:57, sra1 wrote:
> > When is this false?
> 
> For static fields.
> 
> > My understanding is that member must be a field.
> > If member can be static, what is the meaning of generating a getter or
setter
> > that uses 'this'?
> 
> This creates a "compact field specification" for static fields, and is used by
> mirrors to tell which static fields exist. We don't actually create getters
and
> setters for static fields, so the mirror system need some information, and I
> felt it made sense to reuse the existing mechanism for instance fields.

This is documented in CL 19676002.

https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compil...
dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:1774: if
(code == 0) {
On 2013/07/20 12:16:52, ahe wrote:
> On 2013/07/19 22:07:57, sra1 wrote:
> > This function is getting a bit long.
> > Maybe break out the computation of 'code'?
> 
> Good idea.

I'll do that in another CL to reduce conflicts with CL 19676002.

https://codereview.chromium.org/19693011/diff/1/dart/sdk/lib/_internal/compil...
dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:3161:
throw 'fisk';
On 2013/07/22 12:04:03, ngeoffray wrote:
> fisk -> fish. Or you could just get rid of this code :-)

This is debug code I overlooked.

Powered by Google App Engine
This is Rietveld 408576698