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

Side by Side Diff: src/parser.cc

Issue 14721009: Track computed literal properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after
3991 } 3991 }
3992 3992
3993 // Add CONSTANT and COMPUTED properties to boilerplate. Use undefined 3993 // Add CONSTANT and COMPUTED properties to boilerplate. Use undefined
3994 // value for COMPUTED properties, the real value is filled in at 3994 // value for COMPUTED properties, the real value is filled in at
3995 // runtime. The enumeration order is maintained. 3995 // runtime. The enumeration order is maintained.
3996 Handle<Object> key = property->key()->handle(); 3996 Handle<Object> key = property->key()->handle();
3997 Handle<Object> value = GetBoilerplateValue(property->value()); 3997 Handle<Object> value = GetBoilerplateValue(property->value());
3998 3998
3999 // Ensure objects with doubles are always treated as nested objects. 3999 // Ensure objects with doubles are always treated as nested objects.
4000 // TODO(verwaest): Remove once we can store them inline. 4000 // TODO(verwaest): Remove once we can store them inline.
4001 if (FLAG_track_double_fields && value->IsNumber()) { 4001 if (FLAG_track_double_fields &&
4002 (value->IsNumber() || value->IsUndefined())) {
danno 2013/06/06 07:54:19 Might want to extend the comment above, i.e. doubl
Toon Verwaest 2013/06/06 10:31:41 Done.
4002 *may_store_doubles = true; 4003 *may_store_doubles = true;
4003 } 4004 }
4004 4005
4005 is_simple_acc = is_simple_acc && !value->IsUndefined(); 4006 is_simple_acc = is_simple_acc && !value->IsUndefined();
4006 4007
4007 // Keep track of the number of elements in the object literal and 4008 // Keep track of the number of elements in the object literal and
4008 // the largest element index. If the largest element index is 4009 // the largest element index. If the largest element index is
4009 // much larger than the number of elements, creating an object 4010 // much larger than the number of elements, creating an object
4010 // literal with fast elements will be a waste of space. 4011 // literal with fast elements will be a waste of space.
4011 uint32_t element_index = 0; 4012 uint32_t element_index = 0;
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after
6028 ASSERT(info()->isolate()->has_pending_exception()); 6029 ASSERT(info()->isolate()->has_pending_exception());
6029 } else { 6030 } else {
6030 result = ParseProgram(); 6031 result = ParseProgram();
6031 } 6032 }
6032 } 6033 }
6033 info()->SetFunction(result); 6034 info()->SetFunction(result);
6034 return (result != NULL); 6035 return (result != NULL);
6035 } 6036 }
6036 6037
6037 } } // namespace v8::internal 6038 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698