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

Issue 11968022: Lookup functions by name that contains the private key, except for dart_api which allows ignoring t… (Closed)

Created:
7 years, 11 months ago by srdjan
Modified:
7 years, 11 months ago
Reviewers:
siva, Ivan Posva
CC:
reviews_dartlang.org, Ivan Posva
Visibility:
Public.

Description

Lookup functions by name that contains the private key, except for dart_api which allows ignoring the private key. Committed: https://code.google.com/p/dart/source/detail?r=17178

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Total comments: 13

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -46 lines) Patch
M runtime/lib/isolate.cc View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 6 9 chunks +15 lines, -11 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 4 5 6 4 chunks +12 lines, -4 lines 0 comments Download
M runtime/vm/dart_entry.cc View 1 2 3 4 5 6 5 chunks +19 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 2 3 4 5 6 5 chunks +19 lines, -11 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 6 5 chunks +70 lines, -2 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 5 6 12 chunks +24 lines, -11 lines 0 comments Download
M runtime/vm/symbols.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
srdjan
7 years, 11 months ago (2013-01-16 22:24:01 UTC) #1
siva
lgtm https://codereview.chromium.org/11968022/diff/2002/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/11968022/diff/2002/runtime/vm/object.cc#newcode5763 runtime/vm/object.cc:5763: // TODO(srdjan): Improve speed by assuming OnebyteStrings. could ...
7 years, 11 months ago (2013-01-16 23:57:24 UTC) #2
Ivan Posva
https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_api_impl.cc#newcode1109 runtime/vm/dart_api_impl.cc:1109: String::Handle(core_lib.PrivateName(Symbols::_get_or_create())); Using the core_lib private key does not seem ...
7 years, 11 months ago (2013-01-17 00:25:14 UTC) #3
srdjan
7 years, 11 months ago (2013-01-17 00:31:11 UTC) #4
https://codereview.chromium.org/11968022/diff/2002/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/11968022/diff/2002/runtime/vm/object.cc#newco...
runtime/vm/object.cc:5763: // TODO(srdjan): Improve speed by assuming
OnebyteStrings.
On 2013/01/16 23:57:24, siva wrote:
> could also be ExternalOneByteString?

Removed comment.

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_api_impl.cc
File runtime/vm/dart_api_impl.cc (right):

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_api_impl.c...
runtime/vm/dart_api_impl.cc:1109:
String::Handle(core_lib.PrivateName(Symbols::_get_or_create()));
On 2013/01/16 23:57:24, siva wrote:
> Can we add a TODO here that private names in the symbol table need to be
stored
> with the private key.
> 
> That will avoid the use of the function Library::PrivateName() which does not
> seem to be set up for qualified names (see comment in that file).

Done.

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_api_impl.c...
runtime/vm/dart_api_impl.cc:1109:
String::Handle(core_lib.PrivateName(Symbols::_get_or_create()));
On 2013/01/17 00:25:14, Ivan Posva wrote:
> Using the core_lib private key does not seem appropriate here. Is this being
> tested?

There are no tests apparently . Fixed, thanks for spotting it.

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_entry.cc
File runtime/vm/dart_entry.cc (right):

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/dart_entry.cc#n...
runtime/vm/dart_entry.cc:152:
core_lib.LookupClassAllowPrivate(Symbols::InvocationMirror()));
On 2013/01/17 00:25:14, Ivan Posva wrote:
> Why are we allowing private here?

Changed to use private key.

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/object.cc#newco...
runtime/vm/object.cc:5742: static bool ShouldBePrivate(const String& name) {
On 2013/01/16 23:57:24, siva wrote:
> I find the name ShouldBePrivate pretty weird.
> It seems to be doing the functionality of
> IsPrivate(const String& name);

Reverting this code to original, adding an IsPrivate method that does the same
(used in an ASSERT of Library::PrivateName)

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/object.cc#newco...
runtime/vm/object.cc:5750: // TODO(srdjan): Improve speed by assuming
OnebyteStrings.
On 2013/01/16 23:57:24, siva wrote:
> assuming OneByteStrings or ExternalOneByteStrings

Done.

https://codereview.chromium.org/11968022/diff/4013/runtime/vm/object.cc#newco...
runtime/vm/object.cc:5757: }
On 2013/01/16 23:57:24, siva wrote:
> As discussed offline, this additional check here probably only makes sense for
> Library::PrivateName().

Done.

Powered by Google App Engine
This is Rietveld 408576698