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

Unified Diff: src/runtime.cc

Issue 14721009: Track computed literal properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 6 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/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index c47e35d3aeabb4be51a4a0d42c1824f875fad45c..75ace335b63a88222c2fa2ca5bfe6ddf64044705 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -255,12 +255,15 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
for (int index = 0; index < length; index +=2) {
Handle<Object> key(constant_properties->get(index+0), isolate);
Handle<Object> value(constant_properties->get(index+1), isolate);
+ Object::ValueType value_type = Object::REAL_VALUE;
if (value->IsFixedArray()) {
// The value contains the constant_properties of a
// simple object or array literal.
Handle<FixedArray> array = Handle<FixedArray>::cast(value);
value = CreateLiteralBoilerplate(isolate, literals, array);
if (value.is_null()) return value;
+ } else if (FLAG_track_computed_fields && value->IsUndefined()) {
+ value_type = Object::PLACEHOLDER_VALUE;
}
Handle<Object> result;
uint32_t element_index = 0;
@@ -273,7 +276,7 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
Handle<String> name(String::cast(*key));
ASSERT(!name->AsArrayIndex(&element_index));
result = JSObject::SetLocalPropertyIgnoreAttributes(
- boilerplate, name, value, NONE);
+ boilerplate, name, value, NONE, value_type);
}
} else if (key->ToArrayIndex(&element_index)) {
// Array index (uint32).
@@ -289,7 +292,7 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
Handle<String> name =
isolate->factory()->NewStringFromAscii(CStrVector(str));
result = JSObject::SetLocalPropertyIgnoreAttributes(
- boilerplate, name, value, NONE);
+ boilerplate, name, value, NONE, value_type);
}
// If setting the property on the boilerplate throws an
// exception, the exception is converted to an empty handle in
« src/parser.cc ('K') | « src/property-details.h ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698