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

Unified Diff: src/objects-inl.h

Issue 14850006: Use mutable heapnumbers to store doubles in fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index b988d3bf2bfea9a8a990a1f5f6d1fb616224164a..b45e40be719dd045f86941579dbea3587fdd2d7d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -286,6 +286,14 @@ bool Object::HasValidElements() {
return IsFixedArray() || IsFixedDoubleArray() || IsExternalArray();
}
+
+MaybeObject* Object::StorageFor(Heap* heap, Representation representation) {
danno 2013/05/07 13:04:47 AllocateNewStorageFor
Toon Verwaest 2013/05/07 15:08:52 Done.
+ if (!FLAG_track_double_fields) return this;
+ if (!representation.IsDouble()) return this;
+ return heap->AllocateHeapNumber(Number());
+}
+
+
StringShape::StringShape(String* str)
: type_(str->map()->instance_type()) {
set_valid();
@@ -1718,7 +1726,7 @@ Object* JSObject::FastPropertyAt(int index) {
}
-Object* JSObject::FastPropertyAtPut(int index, Object* value) {
+void JSObject::FastPropertyAtPut(int index, Object* value) {
// Adjust for the number of properties stored in the object.
index -= map()->inobject_properties();
if (index < 0) {
@@ -1729,7 +1737,6 @@ Object* JSObject::FastPropertyAtPut(int index, Object* value) {
ASSERT(index < properties()->length());
properties()->set(index, value);
}
- return value;
}

Powered by Google App Engine
This is Rietveld 408576698