| OLD | NEW |
| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 static Handle<ByteArray> NewByteArray(int length, | 151 static Handle<ByteArray> NewByteArray(int length, |
| 152 PretenureFlag pretenure = NOT_TENURED); | 152 PretenureFlag pretenure = NOT_TENURED); |
| 153 | 153 |
| 154 static Handle<Map> NewMap(InstanceType type, int instance_size); | 154 static Handle<Map> NewMap(InstanceType type, int instance_size); |
| 155 | 155 |
| 156 static Handle<JSObject> NewFunctionPrototype(Handle<JSFunction> function); | 156 static Handle<JSObject> NewFunctionPrototype(Handle<JSFunction> function); |
| 157 | 157 |
| 158 static Handle<Map> CopyMap(Handle<Map> map); | 158 static Handle<Map> CopyMap(Handle<Map> map); |
| 159 | 159 |
| 160 // Copy the map adding more inobject properties if possible without |
| 161 // overflowing the instance size. |
| 162 static Handle<Map> CopyMap(Handle<Map> map, int extra_inobject_props); |
| 163 |
| 160 static Handle<Map> CopyMapDropTransitions(Handle<Map> map); | 164 static Handle<Map> CopyMapDropTransitions(Handle<Map> map); |
| 161 | 165 |
| 162 static Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array); | 166 static Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array); |
| 163 | 167 |
| 164 // Numbers (eg, literals) are pretenured by the parser. | 168 // Numbers (eg, literals) are pretenured by the parser. |
| 165 static Handle<Object> NewNumber(double value, | 169 static Handle<Object> NewNumber(double value, |
| 166 PretenureFlag pretenure = NOT_TENURED); | 170 PretenureFlag pretenure = NOT_TENURED); |
| 167 | 171 |
| 168 static Handle<Object> NewNumberFromInt(int value); | 172 static Handle<Object> NewNumberFromInt(int value); |
| 169 | 173 |
| 170 // These objects are used by the api to create env-independent data | 174 // These objects are used by the api to create env-independent data |
| 171 // structures in the heap. | 175 // structures in the heap. |
| 172 static Handle<JSObject> NewNeanderObject(); | 176 static Handle<JSObject> NewNeanderObject(); |
| 173 | 177 |
| 174 static Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length); | 178 static Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length); |
| 175 | 179 |
| 176 // JS objects are pretenured when allocated by the bootstrapper and | 180 // JS objects are pretenured when allocated by the bootstrapper and |
| 177 // runtime. | 181 // runtime. |
| 178 static Handle<JSObject> NewJSObject(Handle<JSFunction> constructor, | 182 static Handle<JSObject> NewJSObject(Handle<JSFunction> constructor, |
| 179 PretenureFlag pretenure = NOT_TENURED); | 183 PretenureFlag pretenure = NOT_TENURED); |
| 180 | 184 |
| 181 // JS objects are pretenured when allocated by the bootstrapper and | 185 // JS objects are pretenured when allocated by the bootstrapper and |
| 182 // runtime. | 186 // runtime. |
| 183 static Handle<JSObject> NewJSObjectFromMap(Handle<Map> map); | 187 static Handle<JSObject> NewJSObjectFromMap(Handle<Map> map); |
| 184 | 188 |
| 185 // Allocate a JS object representing an object literal. The object is | |
| 186 // pretenured (allocated directly in the old generation). | |
| 187 static Handle<JSObject> NewObjectLiteral(int expected_number_of_properties); | |
| 188 | |
| 189 // Allocate a JS array representing an array literal. The array is | 189 // Allocate a JS array representing an array literal. The array is |
| 190 // pretenured (allocated directly in the old generation). | 190 // pretenured (allocated directly in the old generation). |
| 191 static Handle<JSArray> NewArrayLiteral(int length); | 191 static Handle<JSArray> NewArrayLiteral(int length); |
| 192 | 192 |
| 193 // JS arrays are pretenured when allocated by the parser. | 193 // JS arrays are pretenured when allocated by the parser. |
| 194 static Handle<JSArray> NewJSArray(int init_length, | 194 static Handle<JSArray> NewJSArray(int init_length, |
| 195 PretenureFlag pretenure = NOT_TENURED); | 195 PretenureFlag pretenure = NOT_TENURED); |
| 196 | 196 |
| 197 static Handle<JSArray> NewJSArrayWithElements( | 197 static Handle<JSArray> NewJSArrayWithElements( |
| 198 Handle<FixedArray> elements, | 198 Handle<FixedArray> elements, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // Update the map cache in the global context with (keys, map) | 348 // Update the map cache in the global context with (keys, map) |
| 349 static Handle<MapCache> AddToMapCache(Handle<Context> context, | 349 static Handle<MapCache> AddToMapCache(Handle<Context> context, |
| 350 Handle<FixedArray> keys, | 350 Handle<FixedArray> keys, |
| 351 Handle<Map> map); | 351 Handle<Map> map); |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 | 354 |
| 355 } } // namespace v8::internal | 355 } } // namespace v8::internal |
| 356 | 356 |
| 357 #endif // V8_FACTORY_H_ | 357 #endif // V8_FACTORY_H_ |
| OLD | NEW |