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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 10891036: Reworked previous CL (ExternalStringGetPeer speed up) to avoid the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/raw_object.h » ('j') | runtime/vm/raw_object.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 11534)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -1533,27 +1533,24 @@
RETURN_NULL_ERROR(peer);
} else {
NoGCScope no_gc_scope;
- RawObject* raw_obj = Api::UnwrapHandle(object);
+ uword raw_addr = RawObject::ToAddr(Api::UnwrapHandle(object));
switch (class_id) {
case kExternalOneByteStringCid: {
RawExternalOneByteString* raw_string =
- reinterpret_cast<RawExternalOneByteString*>(raw_obj)->ptr();
- ExternalStringData<uint8_t>* data = raw_string->external_data_;
- *peer = data->peer();
+ reinterpret_cast<RawExternalOneByteString*>(raw_addr);
+ *peer = raw_string->peer();
return Api::Success(Isolate::Current());
}
case kExternalTwoByteStringCid: {
RawExternalTwoByteString* raw_string =
- reinterpret_cast<RawExternalTwoByteString*>(raw_obj)->ptr();
- ExternalStringData<uint16_t>* data = raw_string->external_data_;
- *peer = data->peer();
+ reinterpret_cast<RawExternalTwoByteString*>(raw_addr);
+ *peer = raw_string->peer();
return Api::Success(Isolate::Current());
}
case kExternalFourByteStringCid: {
RawExternalFourByteString* raw_string =
- reinterpret_cast<RawExternalFourByteString*>(raw_obj)->ptr();
- ExternalStringData<uint32_t>* data = raw_string->external_data_;
- *peer = data->peer();
+ reinterpret_cast<RawExternalFourByteString*>(raw_addr);
+ *peer = raw_string->peer();
return Api::Success(Isolate::Current());
}
}
« no previous file with comments | « no previous file | runtime/vm/raw_object.h » ('j') | runtime/vm/raw_object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698