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

Issue 11441021: Pass handles not raw objects into methods. (Closed)

Created:
8 years ago by srdjan
Modified:
8 years ago
CC:
reviews_dartlang.org, Kevin Millikin (Google)
Visibility:
Public.

Description

Pass handles not raw objects into methods. Committed: https://code.google.com/p/dart/source/detail?r=15748

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -17 lines) Patch
M runtime/vm/code_generator.cc View 1 5 chunks +11 lines, -8 lines 1 comment Download
M runtime/vm/dart_entry.h View 3 chunks +5 lines, -2 lines 0 comments Download
M runtime/vm/dart_entry.cc View 2 chunks +8 lines, -6 lines 2 comments Download
M runtime/vm/debugger.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
srdjan
8 years ago (2012-12-05 19:06:02 UTC) #1
siva
lgtm https://codereview.chromium.org/11441021/diff/1/runtime/vm/dart_entry.cc File runtime/vm/dart_entry.cc (right): https://codereview.chromium.org/11441021/diff/1/runtime/vm/dart_entry.cc#newcode141 runtime/vm/dart_entry.cc:141: kNameOffset); const String& result = String::CheckedHandle(array_At(...)); return result.raw(); ...
8 years ago (2012-12-05 19:18:47 UTC) #2
srdjan
https://codereview.chromium.org/11441021/diff/1/runtime/vm/dart_entry.cc File runtime/vm/dart_entry.cc (right): https://codereview.chromium.org/11441021/diff/1/runtime/vm/dart_entry.cc#newcode141 runtime/vm/dart_entry.cc:141: kNameOffset); On 2012/12/05 19:18:48, siva wrote: > const String& ...
8 years ago (2012-12-05 19:30:07 UTC) #3
Florian Schneider
dbc: https://codereview.chromium.org/11441021/diff/2002/runtime/vm/dart_entry.cc File runtime/vm/dart_entry.cc (right): https://codereview.chromium.org/11441021/diff/2002/runtime/vm/dart_entry.cc#newcode138 runtime/vm/dart_entry.cc:138: String& result = String::Handle(); Allocating a handle just ...
8 years ago (2012-12-06 09:48:16 UTC) #4
Kevin Millikin (Google)
https://codereview.chromium.org/11441021/diff/2002/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): https://codereview.chromium.org/11441021/diff/2002/runtime/vm/code_generator.cc#newcode843 runtime/vm/code_generator.cc:843: ArgumentsDescriptor arg_descriptor(arg_desc_array); I was trying to avoid this API, ...
8 years ago (2012-12-06 10:36:28 UTC) #5
Kevin Millikin (Google)
8 years ago (2012-12-06 10:44:02 UTC) #6
Message was sent while issue was closed.
DBC.

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

https://codereview.chromium.org/11441021/diff/2002/runtime/vm/dart_entry.cc#n...
runtime/vm/dart_entry.cc:138: String& result = String::Handle();
On 2012/12/06 09:48:16, Florian Schneider wrote:
> Allocating a handle just for casting seems an expensive way to cast to String.
> Why not not return RawObject* as before? The caller will almost always
allocate
> a handle itself and can do the cast as well.

The only caller just does pointer equality to RawString*, which works if this is
RawObject*.  In fact, this method can be replaced by:

bool ArgumentsDescriptor::MatchNameAt(intptr_t index,
                                      const String& other) const {
  return (array_.At(...) == other.raw());
}

Powered by Google App Engine
This is Rietveld 408576698