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

Side by Side Diff: src/objects.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 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 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 1073
1074 inline bool FitsRepresentation(Representation representation) { 1074 inline bool FitsRepresentation(Representation representation) {
1075 if (FLAG_track_fields && representation.IsSmi()) { 1075 if (FLAG_track_fields && representation.IsSmi()) {
1076 return IsSmi(); 1076 return IsSmi();
1077 } else if (FLAG_track_double_fields && representation.IsDouble()) { 1077 } else if (FLAG_track_double_fields && representation.IsDouble()) {
1078 return IsNumber(); 1078 return IsNumber();
1079 } 1079 }
1080 return true; 1080 return true;
1081 } 1081 }
1082 1082
1083 inline MaybeObject* StorageFor(Heap* heap, Representation representation);
1084
1083 // Returns true if the object is of the correct type to be used as a 1085 // Returns true if the object is of the correct type to be used as a
1084 // implementation of a JSObject's elements. 1086 // implementation of a JSObject's elements.
1085 inline bool HasValidElements(); 1087 inline bool HasValidElements();
1086 1088
1087 inline bool HasSpecificClassOf(String* name); 1089 inline bool HasSpecificClassOf(String* name);
1088 1090
1089 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9. 1091 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9.
1090 bool BooleanValue(); // ECMA-262 9.2. 1092 bool BooleanValue(); // ECMA-262 9.2.
1091 1093
1092 // Convert to a JSObject if needed. 1094 // Convert to a JSObject if needed.
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 int GetLocalElementKeys(FixedArray* storage, PropertyAttributes filter); 2130 int GetLocalElementKeys(FixedArray* storage, PropertyAttributes filter);
2129 // Count and fill in the enumerable elements into storage. 2131 // Count and fill in the enumerable elements into storage.
2130 // (storage->length() == NumberOfEnumElements()). 2132 // (storage->length() == NumberOfEnumElements()).
2131 // If storage is NULL, will count the elements without adding 2133 // If storage is NULL, will count the elements without adding
2132 // them to any storage. 2134 // them to any storage.
2133 // Returns the number of enumerable elements. 2135 // Returns the number of enumerable elements.
2134 int GetEnumElementKeys(FixedArray* storage); 2136 int GetEnumElementKeys(FixedArray* storage);
2135 2137
2136 // Add a property to a fast-case object using a map transition to 2138 // Add a property to a fast-case object using a map transition to
2137 // new_map. 2139 // new_map.
2138 MUST_USE_RESULT MaybeObject* AddFastPropertyUsingMap(Map* new_map, 2140 MUST_USE_RESULT MaybeObject* AddFastPropertyUsingMap(
2139 Name* name, 2141 Map* new_map,
2140 Object* value, 2142 Name* name,
2141 int field_index); 2143 Object* value,
2144 int field_index,
2145 Representation representation);
2142 2146
2143 // Add a constant function property to a fast-case object. 2147 // Add a constant function property to a fast-case object.
2144 // This leaves a CONSTANT_TRANSITION in the old map, and 2148 // This leaves a CONSTANT_TRANSITION in the old map, and
2145 // if it is called on a second object with this map, a 2149 // if it is called on a second object with this map, a
2146 // normal property is added instead, with a map transition. 2150 // normal property is added instead, with a map transition.
2147 // This avoids the creation of many maps with the same constant 2151 // This avoids the creation of many maps with the same constant
2148 // function, all orphaned. 2152 // function, all orphaned.
2149 MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty( 2153 MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty(
2150 Name* name, 2154 Name* name,
2151 JSFunction* function, 2155 JSFunction* function,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 // Transform slow named properties to fast variants. 2245 // Transform slow named properties to fast variants.
2242 // Returns failure if allocation failed. 2246 // Returns failure if allocation failed.
2243 static void TransformToFastProperties(Handle<JSObject> object, 2247 static void TransformToFastProperties(Handle<JSObject> object,
2244 int unused_property_fields); 2248 int unused_property_fields);
2245 2249
2246 MUST_USE_RESULT MaybeObject* TransformToFastProperties( 2250 MUST_USE_RESULT MaybeObject* TransformToFastProperties(
2247 int unused_property_fields); 2251 int unused_property_fields);
2248 2252
2249 // Access fast-case object properties at index. 2253 // Access fast-case object properties at index.
2250 inline Object* FastPropertyAt(int index); 2254 inline Object* FastPropertyAt(int index);
2251 inline Object* FastPropertyAtPut(int index, Object* value); 2255 inline void FastPropertyAtPut(int index, Object* value);
2252 2256
2253 // Access to in object properties. 2257 // Access to in object properties.
2254 inline int GetInObjectPropertyOffset(int index); 2258 inline int GetInObjectPropertyOffset(int index);
2255 inline Object* InObjectPropertyAt(int index); 2259 inline Object* InObjectPropertyAt(int index);
2256 inline Object* InObjectPropertyAtPut(int index, 2260 inline Object* InObjectPropertyAtPut(int index,
2257 Object* value, 2261 Object* value,
2258 WriteBarrierMode mode 2262 WriteBarrierMode mode
2259 = UPDATE_WRITE_BARRIER); 2263 = UPDATE_WRITE_BARRIER);
2260 2264
2261 // Initializes the body after properties slot, properties slot is 2265 // Initializes the body after properties slot, properties slot is
(...skipping 2930 matching lines...) Expand 10 before | Expand all | Expand 10 after
5192 5196
5193 void DeprecateTransitionTree(); 5197 void DeprecateTransitionTree();
5194 void DeprecateTarget(Name* key, DescriptorArray* new_descriptors); 5198 void DeprecateTarget(Name* key, DescriptorArray* new_descriptors);
5195 5199
5196 Map* FindRootMap(); 5200 Map* FindRootMap();
5197 Map* FindUpdatedMap(int verbatim, int length, DescriptorArray* descriptors); 5201 Map* FindUpdatedMap(int verbatim, int length, DescriptorArray* descriptors);
5198 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); 5202 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors);
5199 5203
5200 int NumberOfFields(); 5204 int NumberOfFields();
5201 5205
5202 bool InstancesNeedRewriting(int target_number_of_fields, 5206 bool InstancesNeedRewriting(Map* target,
5207 int target_number_of_fields,
5203 int target_inobject, 5208 int target_inobject,
5204 int target_unused); 5209 int target_unused);
5205 static Handle<Map> GeneralizeRepresentation( 5210 static Handle<Map> GeneralizeRepresentation(
5206 Handle<Map> map, 5211 Handle<Map> map,
5207 int modify_index, 5212 int modify_index,
5208 Representation new_representation); 5213 Representation new_representation);
5209 MUST_USE_RESULT MaybeObject* GeneralizeRepresentation( 5214 MUST_USE_RESULT MaybeObject* GeneralizeRepresentation(
5210 int modify_index, 5215 int modify_index,
5211 Representation representation); 5216 Representation representation);
5212 MUST_USE_RESULT MaybeObject* CopyGeneralizeAllRepresentations(); 5217 MUST_USE_RESULT MaybeObject* CopyGeneralizeAllRepresentations();
(...skipping 4337 matching lines...) Expand 10 before | Expand all | Expand 10 after
9550 } else { 9555 } else {
9551 value &= ~(1 << bit_position); 9556 value &= ~(1 << bit_position);
9552 } 9557 }
9553 return value; 9558 return value;
9554 } 9559 }
9555 }; 9560 };
9556 9561
9557 } } // namespace v8::internal 9562 } } // namespace v8::internal
9558 9563
9559 #endif // V8_OBJECTS_H_ 9564 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698