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

Unified Diff: src/parser.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
« src/objects.cc ('K') | « src/objects-inl.h ('k') | src/property.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 9c55ad7e719265dc535a6d5b3c7990c7a027994b..f5887125e26aaa4fc8bf41b617c8a3221679f0ae 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3996,9 +3996,13 @@ void Parser::BuildObjectLiteralConstantProperties(
Handle<Object> key = property->key()->handle();
Handle<Object> value = GetBoilerplateValue(property->value());
- // Ensure objects with doubles are always treated as nested objects.
+ // Ensure objects that may, at any point in time, contain fields with double
+ // representation are always treated as nested objects. This is true for
+ // computed fields (value is undefined), and smi and double literals
+ // (value->IsNumber()).
// TODO(verwaest): Remove once we can store them inline.
- if (FLAG_track_double_fields && value->IsNumber()) {
+ if (FLAG_track_double_fields &&
+ (value->IsNumber() || value->IsUndefined())) {
danno 2013/06/06 13:07:32 As discussed, super scary.
Toon Verwaest 2013/06/06 13:22:26 Done.
*may_store_doubles = true;
}
« src/objects.cc ('K') | « src/objects-inl.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698