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

Side by Side Diff: vm/object.cc

Issue 10908185: Do not allocate a buffer of 64KB by default when writing a message out. Start (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/datastream.h ('k') | vm/snapshot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 5262 matching lines...) Expand 10 before | Expand all | Expand 10 after
5273 ExternalUint8Array::New(data, len, data, DataFinalizer, Heap::kOld)); 5273 ExternalUint8Array::New(data, len, data, DataFinalizer, Heap::kOld));
5274 const TokenStream& result = TokenStream::Handle(TokenStream::New()); 5274 const TokenStream& result = TokenStream::Handle(TokenStream::New());
5275 result.SetStream(stream); 5275 result.SetStream(stream);
5276 return result.raw(); 5276 return result.raw();
5277 } 5277 }
5278 5278
5279 5279
5280 // Helper class for creation of compressed token stream data. 5280 // Helper class for creation of compressed token stream data.
5281 class CompressedTokenStreamData : public ValueObject { 5281 class CompressedTokenStreamData : public ValueObject {
5282 public: 5282 public:
5283 static const intptr_t kIncrementSize = 16 * KB;
5283 CompressedTokenStreamData() : 5284 CompressedTokenStreamData() :
5284 buffer_(NULL), 5285 buffer_(NULL),
5285 stream_(&buffer_, Reallocate), 5286 stream_(&buffer_, Reallocate, kIncrementSize),
5286 token_objects_(GrowableObjectArray::Handle( 5287 token_objects_(GrowableObjectArray::Handle(
5287 GrowableObjectArray::New(kInitialTokenCount, Heap::kOld))), 5288 GrowableObjectArray::New(kInitialTokenCount, Heap::kOld))),
5288 token_obj_(Object::Handle()), 5289 token_obj_(Object::Handle()),
5289 literal_token_(LiteralToken::Handle()), 5290 literal_token_(LiteralToken::Handle()),
5290 literal_str_(String::Handle()) { 5291 literal_str_(String::Handle()) {
5291 const String& empty_literal = String::Handle(); 5292 const String& empty_literal = String::Handle();
5292 token_objects_.Add(empty_literal); 5293 token_objects_.Add(empty_literal);
5293 } 5294 }
5294 ~CompressedTokenStreamData() { 5295 ~CompressedTokenStreamData() {
5295 } 5296 }
(...skipping 6199 matching lines...) Expand 10 before | Expand all | Expand 10 after
11495 } 11496 }
11496 return result.raw(); 11497 return result.raw();
11497 } 11498 }
11498 11499
11499 11500
11500 const char* WeakProperty::ToCString() const { 11501 const char* WeakProperty::ToCString() const {
11501 return "_WeakProperty"; 11502 return "_WeakProperty";
11502 } 11503 }
11503 11504
11504 } // namespace dart 11505 } // namespace dart
OLDNEW
« no previous file with comments | « vm/datastream.h ('k') | vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698