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

Unified Diff: runtime/vm/object.cc

Issue 133813008: Avoid printing the full token stream and doing line/column position calculations when extracting th… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: unmark standalone and content shell as slow Created 6 years, 10 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index a30bfda37c4e168764fc736d51e143019eab9fed..8ab806e2e83c791543400ffd1794c6cffff51479 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6661,9 +6661,13 @@ void TokenStream::SetPrivateKey(const String& value) const {
StorePointer(&raw_ptr()->private_key_, value.raw());
}
-
RawString* TokenStream::GenerateSource() const {
- Iterator iterator(*this, 0, Iterator::kAllTokens);
+ return GenerateSource(0, kMaxElements);
+}
+
+RawString* TokenStream::GenerateSource(intptr_t start_pos,
+ intptr_t end_pos) const {
+ Iterator iterator(*this, start_pos, Iterator::kAllTokens);
const ExternalTypedData& data = ExternalTypedData::Handle(GetStream());
const GrowableObjectArray& literals =
GrowableObjectArray::Handle(GrowableObjectArray::New(data.Length()));
@@ -6678,7 +6682,7 @@ RawString* TokenStream::GenerateSource() const {
// Current indentation level.
int indent = 0;
- while (curr != Token::kEOS) {
+ while ((curr != Token::kEOS) && (iterator.CurrentPosition() < end_pos)) {
// Remember current values for this token.
obj = iterator.CurrentToken();
literal = iterator.MakeLiteralToken(obj);
« runtime/lib/mirrors.cc ('K') | « runtime/vm/object.h ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698