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

Unified Diff: src/runtime.cc

Issue 14850006: Use mutable heapnumbers to store doubles in fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ported to ARM and x64 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
« no previous file with comments | « src/property.h ('k') | src/string-stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 0f49613aa2998018e73af015513551c72221df7c..c082e7336c78a903601cd34066445d3b254824ac 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4361,7 +4361,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_KeyedGetProperty) {
KeyedLookupCache* keyed_lookup_cache = isolate->keyed_lookup_cache();
int offset = keyed_lookup_cache->Lookup(receiver_map, key);
if (offset != -1) {
- Object* value = receiver->FastPropertyAt(offset);
+ // Doubles are not cached, so raw read the value.
+ Object* value = receiver->RawFastPropertyAt(offset);
return value->IsTheHole()
? isolate->heap()->undefined_value()
: value;
@@ -4372,8 +4373,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_KeyedGetProperty) {
receiver->LocalLookup(key, &result);
if (result.IsField()) {
int offset = result.GetFieldIndex().field_index();
- keyed_lookup_cache->Update(receiver_map, key, offset);
- return receiver->FastPropertyAt(offset);
+ // Do not track double fields in the keyed lookup cache. Reading
+ // double values requires boxing.
+ if (!FLAG_track_double_fields ||
+ !result.representation().IsDouble()) {
+ keyed_lookup_cache->Update(receiver_map, key, offset);
+ }
+ return receiver->FastPropertyAt(result.representation(), offset);
}
} else {
// Attempt dictionary lookup.
@@ -4549,6 +4555,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) {
return lookup.holder()->GetNormalizedProperty(&lookup);
case FIELD:
return lookup.holder()->FastPropertyAt(
+ lookup.representation(),
lookup.GetFieldIndex().field_index());
case CONSTANT_FUNCTION:
return lookup.GetConstantFunction();
@@ -10065,14 +10072,18 @@ static MaybeObject* DebugLookupResultValue(Heap* heap,
return heap->undefined_value();
}
return value;
- case FIELD:
- value =
+ case FIELD: {
+ Object* value;
+ MaybeObject* maybe_value =
JSObject::cast(result->holder())->FastPropertyAt(
+ result->representation(),
result->GetFieldIndex().field_index());
+ if (!maybe_value->To(&value)) return maybe_value;
if (value->IsTheHole()) {
return heap->undefined_value();
}
return value;
+ }
case CONSTANT_FUNCTION:
return result->GetConstantFunction();
case CALLBACKS: {
« no previous file with comments | « src/property.h ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698