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

Unified Diff: runtime/vm/object.cc

Issue 13093012: More cleanup in preparation for removing support for dart:scalarlist in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 20532)
+++ runtime/vm/object.cc (working copy)
@@ -4978,12 +4978,12 @@
}
-RawExternalUint8Array* TokenStream::GetStream() const {
+RawExternalTypedData* TokenStream::GetStream() const {
return raw_ptr()->stream_;
}
-void TokenStream::SetStream(const ExternalUint8Array& value) const {
+void TokenStream::SetStream(const ExternalTypedData& value) const {
StorePointer(&raw_ptr()->stream_, value.raw());
}
@@ -5007,7 +5007,7 @@
RawString* TokenStream::GenerateSource() const {
Iterator iterator(*this, 0);
- const ExternalUint8Array& data = ExternalUint8Array::Handle(GetStream());
+ const ExternalTypedData& data = ExternalTypedData::Handle(GetStream());
const GrowableObjectArray& literals =
GrowableObjectArray::Handle(GrowableObjectArray::New(data.Length()));
const String& private_key = String::Handle(PrivateKey());
@@ -5189,8 +5189,9 @@
}
uint8_t* data = reinterpret_cast<uint8_t*>(::malloc(len));
ASSERT(data != NULL);
- const ExternalUint8Array& stream = ExternalUint8Array::Handle(
- ExternalUint8Array::New(data, len, Heap::kOld));
+ const ExternalTypedData& stream = ExternalTypedData::Handle(
+ ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
+ data, len, Heap::kOld));
stream.AddFinalizer(data, DataFinalizer);
const TokenStream& result = TokenStream::Handle(TokenStream::New());
result.SetStream(stream);
@@ -5363,8 +5364,9 @@
data.AddSimpleToken(Token::kEOS); // End of stream.
// Create and setup the token stream object.
- const ExternalUint8Array& stream = ExternalUint8Array::Handle(
- ExternalUint8Array::New(data.GetStream(), data.Length(), Heap::kOld));
+ const ExternalTypedData& stream = ExternalTypedData::Handle(
+ ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
+ data.GetStream(), data.Length(), Heap::kOld));
stream.AddFinalizer(data.GetStream(), DataFinalizer);
const TokenStream& result = TokenStream::Handle(New());
result.SetPrivateKey(private_key);
@@ -5385,8 +5387,8 @@
TokenStream::Iterator::Iterator(const TokenStream& tokens, intptr_t token_pos)
: tokens_(TokenStream::Handle(tokens.raw())),
- data_(ExternalUint8Array::Handle(tokens.GetStream())),
- stream_(data_.ByteAddr(0), data_.Length()),
+ data_(ExternalTypedData::Handle(tokens.GetStream())),
+ stream_(reinterpret_cast<uint8_t*>(data_.DataAddr(0)), data_.Length()),
token_objects_(Array::Handle(tokens.TokenObjects())),
obj_(Object::Handle()),
cur_token_pos_(token_pos),
@@ -5400,7 +5402,8 @@
intptr_t token_pos) {
tokens_ = tokens.raw();
data_ = tokens.GetStream();
- stream_.SetStream(data_.ByteAddr(0), data_.Length());
+ stream_.SetStream(reinterpret_cast<uint8_t*>(data_.DataAddr(0)),
+ data_.Length());
token_objects_ = tokens.TokenObjects();
obj_ = Object::null();
cur_token_pos_ = token_pos;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698