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

Side by Side Diff: src/factory.h

Issue 4078: - Added a map cache for literal objects. This will... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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
« no previous file with comments | « src/contexts.h ('k') | src/factory.cc » ('j') | src/factory.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // structures in the heap. 160 // structures in the heap.
161 static Handle<JSObject> NewNeanderObject(); 161 static Handle<JSObject> NewNeanderObject();
162 162
163 static Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length); 163 static Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length);
164 164
165 // JS objects are pretenured when allocated by the bootstrapper and 165 // JS objects are pretenured when allocated by the bootstrapper and
166 // runtime. 166 // runtime.
167 static Handle<JSObject> NewJSObject(Handle<JSFunction> constructor, 167 static Handle<JSObject> NewJSObject(Handle<JSFunction> constructor,
168 PretenureFlag pretenure = NOT_TENURED); 168 PretenureFlag pretenure = NOT_TENURED);
169 169
170 // JS objects are pretenured when allocated by the bootstrapper and
171 // runtime.
172 static Handle<JSObject> NewJSObjectFromMap(Handle<Map> map);
173
170 // Allocate a JS object representing an object literal. The object is 174 // Allocate a JS object representing an object literal. The object is
171 // pretenured (allocated directly in the old generation). 175 // pretenured (allocated directly in the old generation).
172 static Handle<JSObject> NewObjectLiteral(int expected_number_of_properties); 176 static Handle<JSObject> NewObjectLiteral(int expected_number_of_properties);
173 177
174 // Allocate a JS array representing an array literal. The array is 178 // Allocate a JS array representing an array literal. The array is
175 // pretenured (allocated directly in the old generation). 179 // pretenured (allocated directly in the old generation).
176 static Handle<JSArray> NewArrayLiteral(int length); 180 static Handle<JSArray> NewArrayLiteral(int length);
177 181
178 // JS arrays are pretenured when allocated by the parser. 182 // JS arrays are pretenured when allocated by the parser.
179 static Handle<JSArray> NewJSArray(int init_length, 183 static Handle<JSArray> NewJSArray(int init_length,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 #undef SYMBOL_ACCESSOR 288 #undef SYMBOL_ACCESSOR
285 289
286 static Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name); 290 static Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name);
287 291
288 static Handle<Dictionary> DictionaryAtNumberPut(Handle<Dictionary>, 292 static Handle<Dictionary> DictionaryAtNumberPut(Handle<Dictionary>,
289 uint32_t key, 293 uint32_t key,
290 Handle<Object> value); 294 Handle<Object> value);
291 295
292 static Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); 296 static Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared);
293 297
298
299 // Return a map using the map cache in the global context.
300 // The key the an ordered set of property names.
301 static Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context,
302 Handle<FixedArray> keys);
303
294 private: 304 private:
295 static Handle<JSFunction> NewFunctionHelper(Handle<String> name, 305 static Handle<JSFunction> NewFunctionHelper(Handle<String> name,
296 Handle<Object> prototype); 306 Handle<Object> prototype);
297 307
298 static Handle<DescriptorArray> CopyAppendCallbackDescriptors( 308 static Handle<DescriptorArray> CopyAppendCallbackDescriptors(
299 Handle<DescriptorArray> array, 309 Handle<DescriptorArray> array,
300 Handle<Object> descriptors); 310 Handle<Object> descriptors);
301 311
302 static Handle<JSFunction> BaseNewFunctionFromBoilerplate( 312 static Handle<JSFunction> BaseNewFunctionFromBoilerplate(
303 Handle<JSFunction> boilerplate, 313 Handle<JSFunction> boilerplate,
304 Handle<Map> function_map); 314 Handle<Map> function_map);
315
316 // Create a new map cache.
317 static Handle<MapCache> NewMapCache(int at_least_space_for);
318
319 // Update the map cache in the global context with (keys, map)
320 static Handle<MapCache> AddToMapCache(Handle<Context> context,
321 Handle<FixedArray> keys,
322 Handle<Map> map);
305 }; 323 };
306 324
307 325
308 } } // namespace v8::internal 326 } } // namespace v8::internal
309 327
310 #endif // V8_FACTORY_H_ 328 #endif // V8_FACTORY_H_
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/factory.cc » ('j') | src/factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698