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

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

Issue 473673004: Avoid UTF-8 decoding in num.toString. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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/bootstrap_natives.h ('k') | runtime/vm/object.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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 static intptr_t tags_offset() { return OFFSET_OF(RawObject, tags_); } 255 static intptr_t tags_offset() { return OFFSET_OF(RawObject, tags_); }
256 256
257 // Class testers. 257 // Class testers.
258 #define DEFINE_CLASS_TESTER(clazz) \ 258 #define DEFINE_CLASS_TESTER(clazz) \
259 virtual bool Is##clazz() const { return false; } 259 virtual bool Is##clazz() const { return false; }
260 CLASS_LIST_FOR_HANDLES(DEFINE_CLASS_TESTER); 260 CLASS_LIST_FOR_HANDLES(DEFINE_CLASS_TESTER);
261 #undef DEFINE_CLASS_TESTER 261 #undef DEFINE_CLASS_TESTER
262 262
263 bool IsNull() const { return raw_ == null_; } 263 bool IsNull() const { return raw_ == null_; }
264 264
265 // Matches Object.toString on instances (except String::ToCString, bug 20583).
265 virtual const char* ToCString() const { 266 virtual const char* ToCString() const {
266 if (IsNull()) { 267 if (IsNull()) {
267 return "null"; 268 return "null";
268 } else { 269 } else {
269 return "Object"; 270 return "Object";
270 } 271 }
271 } 272 }
272 273
273 void PrintJSON(JSONStream* stream, bool ref = true) const; 274 void PrintJSON(JSONStream* stream, bool ref = true) const;
274 275
(...skipping 4722 matching lines...) Expand 10 before | Expand all | Expand 10 after
4997 4998
4998 static RawMixinAppType* New(); 4999 static RawMixinAppType* New();
4999 5000
5000 FINAL_HEAP_OBJECT_IMPLEMENTATION(MixinAppType, AbstractType); 5001 FINAL_HEAP_OBJECT_IMPLEMENTATION(MixinAppType, AbstractType);
5001 friend class Class; 5002 friend class Class;
5002 }; 5003 };
5003 5004
5004 5005
5005 class Number : public Instance { 5006 class Number : public Instance {
5006 public: 5007 public:
5007 // TODO(iposva): Fill in a useful Number interface. 5008 // TODO(iposva): Add more useful Number methods.
5009 RawString* ToString(Heap::Space space) const;
5008 5010
5009 private: 5011 private:
5010 OBJECT_IMPLEMENTATION(Number, Instance); 5012 OBJECT_IMPLEMENTATION(Number, Instance);
5011 friend class Class; 5013 friend class Class;
5012 }; 5014 };
5013 5015
5014 5016
5015 class Integer : public Number { 5017 class Integer : public Number {
5016 public: 5018 public:
5017 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew); 5019 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew);
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after
7319 7321
7320 7322
7321 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7323 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7322 intptr_t index) { 7324 intptr_t index) {
7323 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7325 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7324 } 7326 }
7325 7327
7326 } // namespace dart 7328 } // namespace dart
7327 7329
7328 #endif // VM_OBJECT_H_ 7330 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698