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

Issue 781203005: Allow Symbols in switch and maps (Closed)

Created:
6 years ago by hausner
Modified:
6 years ago
Reviewers:
regis
CC:
reviews_dartlang.org, vm-dev_dartlang.org, floitsch
Visibility:
Public.

Description

Allow Symbols in switch and maps Allow Symbol literals (and const Symbol instances) as switch expression and as key values in const Maps. This implements the most recent Spec changes. R=regis@google.com Committed: https://code.google.com/p/dart/source/detail?r=42230

Patch Set 1 #

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -9 lines) Patch
M runtime/vm/object.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/object_store.h View 1 3 chunks +7 lines, -1 line 0 comments Download
M runtime/vm/object_store.cc View 1 3 chunks +6 lines, -1 line 2 comments Download
M runtime/vm/parser.cc View 3 chunks +7 lines, -5 lines 0 comments Download
M tests/language/language_dart2js.status View 1 chunk +1 line, -0 lines 0 comments Download
M tests/language/symbol_literal_test.dart View 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
hausner
6 years ago (2014-12-09 20:37:47 UTC) #2
regis
LGTM with one question. https://codereview.chromium.org/781203005/diff/20001/runtime/vm/object_store.cc File runtime/vm/object_store.cc (right): https://codereview.chromium.org/781203005/diff/20001/runtime/vm/object_store.cc#newcode193 runtime/vm/object_store.cc:193: set_symbol_class(cls); There are many other ...
6 years ago (2014-12-09 21:58:56 UTC) #3
hausner
Thank you https://codereview.chromium.org/781203005/diff/20001/runtime/vm/object_store.cc File runtime/vm/object_store.cc (right): https://codereview.chromium.org/781203005/diff/20001/runtime/vm/object_store.cc#newcode193 runtime/vm/object_store.cc:193: set_symbol_class(cls); On 2014/12/09 21:58:55, regis wrote: > ...
6 years ago (2014-12-10 00:23:27 UTC) #4
hausner
Committed patchset #2 (id:20001) manually as r42230 (presubmit successful).
6 years ago (2014-12-10 00:24:13 UTC) #5
regis
6 years ago (2014-12-10 00:29:44 UTC) #6
Message was sent while issue was closed.
On 2014/12/10 00:23:27, hausner wrote:
> Thank you
> 
>
https://codereview.chromium.org/781203005/diff/20001/runtime/vm/object_store.cc
> File runtime/vm/object_store.cc (right):
> 
>
https://codereview.chromium.org/781203005/diff/20001/runtime/vm/object_store....
> runtime/vm/object_store.cc:193: set_symbol_class(cls);
> On 2014/12/09 21:58:55, regis wrote:
> > There are many other "known objects" that are looked up and stored in the
> object
> > store, e.g. class ClassID. Is class Symbol special?
> > 
> > Doing it here is fine with me, but why not handle all such objects in the
same
> > location?
> 
> The only reason I'm aware of to do it here is that the objects initialized
here
> are not allocated programmatically by the VM, since they don't have a
> corresponding C++ class. I introduced this for objects from the async library,
> but now there's also class Symbol from the internal core library.
> 
> We could change this code so the objects are allocated on demand only when the
> VM accesses them. I would do this as a separate change.

Yes, I think class ClassID is another example without any C++ class. That's why
I asked. Not a big deal.

Powered by Google App Engine
This is Rietveld 408576698