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

Side by Side Diff: runtime/vm/object.cc

Issue 11040062: Renamed Zone->StackZone, BaseZone->Zone, in preparation for changing isolate->get_zone() to return … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review changes Created 8 years, 2 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 | « runtime/vm/native_entry.h ('k') | runtime/vm/raw_object_snapshot.cc » ('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 9654 matching lines...) Expand 10 before | Expand all | Expand 10 after
9665 NoGCScope no_gc; 9665 NoGCScope no_gc;
9666 result ^= raw; 9666 result ^= raw;
9667 result.raw_ptr()->allocated_length_ = length; // Chunk length allocated. 9667 result.raw_ptr()->allocated_length_ = length; // Chunk length allocated.
9668 result.raw_ptr()->signed_length_ = length; // Chunk length in use. 9668 result.raw_ptr()->signed_length_ = length; // Chunk length in use.
9669 } 9669 }
9670 return result.raw(); 9670 return result.raw();
9671 } 9671 }
9672 9672
9673 9673
9674 static uword BigintAllocator(intptr_t size) { 9674 static uword BigintAllocator(intptr_t size) {
9675 Zone* zone = Isolate::Current()->current_zone(); 9675 StackZone* zone = Isolate::Current()->current_zone();
9676 return zone->AllocUnsafe(size); 9676 return zone->AllocUnsafe(size);
9677 } 9677 }
9678 9678
9679 9679
9680 const char* Bigint::ToCString() const { 9680 const char* Bigint::ToCString() const {
9681 return BigintOperations::ToDecimalCString(*this, &BigintAllocator); 9681 return BigintOperations::ToDecimalCString(*this, &BigintAllocator);
9682 } 9682 }
9683 9683
9684 9684
9685 class StringHasher : ValueObject { 9685 class StringHasher : ValueObject {
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
10177 return result; 10177 return result;
10178 } 10178 }
10179 10179
10180 10180
10181 RawString* String::NewFormattedV(const char* format, va_list args) { 10181 RawString* String::NewFormattedV(const char* format, va_list args) {
10182 va_list args_copy; 10182 va_list args_copy;
10183 va_copy(args_copy, args); 10183 va_copy(args_copy, args);
10184 intptr_t len = OS::VSNPrint(NULL, 0, format, args_copy); 10184 intptr_t len = OS::VSNPrint(NULL, 0, format, args_copy);
10185 va_end(args_copy); 10185 va_end(args_copy);
10186 10186
10187 Zone* zone = Isolate::Current()->current_zone(); 10187 StackZone* zone = Isolate::Current()->current_zone();
10188 char* buffer = zone->Alloc<char>(len + 1); 10188 char* buffer = zone->Alloc<char>(len + 1);
10189 OS::VSNPrint(buffer, (len + 1), format, args); 10189 OS::VSNPrint(buffer, (len + 1), format, args);
10190 10190
10191 return String::New(buffer); 10191 return String::New(buffer);
10192 } 10192 }
10193 10193
10194 10194
10195 RawString* String::Concat(const String& str1, 10195 RawString* String::Concat(const String& str1,
10196 const String& str2, 10196 const String& str2,
10197 Heap::Space space) { 10197 Heap::Space space) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
10282 } else { 10282 } else {
10283 result ^= FourByteString::New(length, space); 10283 result ^= FourByteString::New(length, space);
10284 } 10284 }
10285 String::Copy(result, 0, str, begin_index, length); 10285 String::Copy(result, 0, str, begin_index, length);
10286 return result.raw(); 10286 return result.raw();
10287 } 10287 }
10288 10288
10289 10289
10290 const char* String::ToCString() const { 10290 const char* String::ToCString() const {
10291 intptr_t len = Utf8::Length(*this); 10291 intptr_t len = Utf8::Length(*this);
10292 Zone* zone = Isolate::Current()->current_zone(); 10292 StackZone* zone = Isolate::Current()->current_zone();
10293 char* result = zone->Alloc<char>(len + 1); 10293 char* result = zone->Alloc<char>(len + 1);
10294 Utf8::Encode(*this, result, len); 10294 Utf8::Encode(*this, result, len);
10295 result[len] = 0; 10295 result[len] = 0;
10296 return result; 10296 return result;
10297 } 10297 }
10298 10298
10299 10299
10300 RawString* String::Transform(int32_t (*mapping)(int32_t ch), 10300 RawString* String::Transform(int32_t (*mapping)(int32_t ch),
10301 const String& str, 10301 const String& str,
10302 Heap::Space space) { 10302 Heap::Space space) {
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
12174 } 12174 }
12175 return result.raw(); 12175 return result.raw();
12176 } 12176 }
12177 12177
12178 12178
12179 const char* WeakProperty::ToCString() const { 12179 const char* WeakProperty::ToCString() const {
12180 return "_WeakProperty"; 12180 return "_WeakProperty";
12181 } 12181 }
12182 12182
12183 } // namespace dart 12183 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/native_entry.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698