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

Side by Side Diff: vm/object.cc

Issue 10933021: - Do not limit the compiler message buffer, by allocating the message (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/object.h ('k') | vm/parser.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 9482 matching lines...) Expand 10 before | Expand all | Expand 10 after
9493 } 9493 }
9494 ASSERT(str.IsFourByteString()); 9494 ASSERT(str.IsFourByteString());
9495 const FourByteString& fourstr = FourByteString::Cast(str); 9495 const FourByteString& fourstr = FourByteString::Cast(str);
9496 return fourstr.EscapeSpecialCharacters(raw_str); 9496 return fourstr.EscapeSpecialCharacters(raw_str);
9497 } 9497 }
9498 9498
9499 9499
9500 RawString* String::NewFormatted(const char* format, ...) { 9500 RawString* String::NewFormatted(const char* format, ...) {
9501 va_list args; 9501 va_list args;
9502 va_start(args, format); 9502 va_start(args, format);
9503 intptr_t len = OS::VSNPrint(NULL, 0, format, args); 9503 RawString* result = NewFormattedV(format, args);
9504 NoGCScope no_gc;
9504 va_end(args); 9505 va_end(args);
9506 return result;
9507 }
9508
9509
9510 RawString* String::NewFormattedV(const char* format, va_list args) {
9511 va_list args_copy;
9512 va_copy(args_copy, args);
hausner 2012/09/11 16:11:14 I am not familiar with va_copy. Is va_start no lon
Ivan Posva 2012/09/11 16:14:39 va_copy creates a copy of the passed in va_list ar
9513 intptr_t len = OS::VSNPrint(NULL, 0, format, args_copy);
9514 va_end(args_copy);
9505 9515
9506 Zone* zone = Isolate::Current()->current_zone(); 9516 Zone* zone = Isolate::Current()->current_zone();
9507 char* buffer = zone->Alloc<char>(len + 1); 9517 char* buffer = zone->Alloc<char>(len + 1);
9508 va_list args2; 9518 OS::VSNPrint(buffer, (len + 1), format, args);
9509 va_start(args2, format);
9510 OS::VSNPrint(buffer, (len + 1), format, args2);
9511 va_end(args2);
9512 9519
9513 return String::New(buffer); 9520 return String::New(buffer);
9514 } 9521 }
9515 9522
9516 9523
9517 RawString* String::Concat(const String& str1, 9524 RawString* String::Concat(const String& str1,
9518 const String& str2, 9525 const String& str2,
9519 Heap::Space space) { 9526 Heap::Space space) {
9520 ASSERT(!str1.IsNull() && !str2.IsNull()); 9527 ASSERT(!str1.IsNull() && !str2.IsNull());
9521 intptr_t char_size = Utils::Maximum(str1.CharSize(), str2.CharSize()); 9528 intptr_t char_size = Utils::Maximum(str1.CharSize(), str2.CharSize());
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after
11496 } 11503 }
11497 return result.raw(); 11504 return result.raw();
11498 } 11505 }
11499 11506
11500 11507
11501 const char* WeakProperty::ToCString() const { 11508 const char* WeakProperty::ToCString() const {
11502 return "_WeakProperty"; 11509 return "_WeakProperty";
11503 } 11510 }
11504 11511
11505 } // namespace dart 11512 } // namespace dart
OLDNEW
« no previous file with comments | « vm/object.h ('k') | vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698