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

Unified Diff: vm/object.h

Issue 8963001: Add Double::NewCanonical and Mint::NewCanonical so that it is possible to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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
« no previous file with comments | « no previous file | vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.h
===================================================================
--- vm/object.h (revision 2470)
+++ vm/object.h (working copy)
@@ -570,6 +570,8 @@
RawLibraryPrefix* LookupLibraryPrefix(const String& name) const;
+ void InsertCanonicalConstant(intptr_t index, const Instance& constant) const;
+
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawClass));
}
@@ -608,6 +610,8 @@
}
void set_allocation_stub(const Code& value) const;
+ RawArray* constants() const;
+
void Finalize() const;
// Allocate a class used for VM internal objects.
@@ -647,7 +651,6 @@
void set_class_state(int8_t state) const;
void set_constants(const Array& value) const;
- RawArray* constants() const;
void set_canonical_types(const Array& value) const;
RawArray* canonical_types() const;
@@ -2355,6 +2358,7 @@
virtual int CompareWith(const Integer& other) const;
static RawMint* New(int64_t value, Heap::Space space = Heap::kNew);
+ static RawMint* NewCanonical(int64_t value);
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawMint));
@@ -2433,10 +2437,21 @@
return raw_ptr()->value_;
}
+ bool EqualsToDouble(double value) const;
+ virtual bool Equals(const Instance& other) const;
+
static RawDouble* New(double d, Heap::Space space = Heap::kNew);
static RawDouble* New(const String& str, Heap::Space space = Heap::kNew);
+ // Returns a canonical double object allocated in the old gen space.
+ static RawDouble* NewCanonical(double d);
+
+ // Returns a canonical double object (allocated in the old gen space) or
+ // Double::null() if str points to a string that does not convert to a
+ // double value.
+ static RawDouble* NewCanonical(const String& str);
+
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawDouble));
}
« no previous file with comments | « no previous file | vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698