| OLD | NEW |
| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // not make sense to have a UTF-8 factory function for external strings, | 155 // not make sense to have a UTF-8 factory function for external strings, |
| 156 // because we cannot change the underlying buffer. | 156 // because we cannot change the underlying buffer. |
| 157 Handle<String> NewExternalStringFromAscii( | 157 Handle<String> NewExternalStringFromAscii( |
| 158 const ExternalAsciiString::Resource* resource); | 158 const ExternalAsciiString::Resource* resource); |
| 159 Handle<String> NewExternalStringFromTwoByte( | 159 Handle<String> NewExternalStringFromTwoByte( |
| 160 const ExternalTwoByteString::Resource* resource); | 160 const ExternalTwoByteString::Resource* resource); |
| 161 | 161 |
| 162 // Create a global (but otherwise uninitialized) context. | 162 // Create a global (but otherwise uninitialized) context. |
| 163 Handle<Context> NewGlobalContext(); | 163 Handle<Context> NewGlobalContext(); |
| 164 | 164 |
| 165 // Create a module context. |
| 166 Handle<Context> NewModuleContext(Handle<Context> previous, |
| 167 Handle<ScopeInfo> scope_info); |
| 168 |
| 165 // Create a function context. | 169 // Create a function context. |
| 166 Handle<Context> NewFunctionContext(int length, | 170 Handle<Context> NewFunctionContext(int length, Handle<JSFunction> function); |
| 167 Handle<JSFunction> function); | |
| 168 | 171 |
| 169 // Create a catch context. | 172 // Create a catch context. |
| 170 Handle<Context> NewCatchContext(Handle<JSFunction> function, | 173 Handle<Context> NewCatchContext(Handle<JSFunction> function, |
| 171 Handle<Context> previous, | 174 Handle<Context> previous, |
| 172 Handle<String> name, | 175 Handle<String> name, |
| 173 Handle<Object> thrown_object); | 176 Handle<Object> thrown_object); |
| 174 | 177 |
| 175 // Create a 'with' context. | 178 // Create a 'with' context. |
| 176 Handle<Context> NewWithContext(Handle<JSFunction> function, | 179 Handle<Context> NewWithContext(Handle<JSFunction> function, |
| 177 Handle<Context> previous, | 180 Handle<Context> previous, |
| 178 Handle<JSObject> extension); | 181 Handle<JSObject> extension); |
| 179 | 182 |
| 180 // Create a 'block' context. | 183 // Create a block context. |
| 181 Handle<Context> NewBlockContext(Handle<JSFunction> function, | 184 Handle<Context> NewBlockContext(Handle<JSFunction> function, |
| 182 Handle<Context> previous, | 185 Handle<Context> previous, |
| 183 Handle<ScopeInfo> scope_info); | 186 Handle<ScopeInfo> scope_info); |
| 184 | 187 |
| 185 // Return the Symbol matching the passed in string. | 188 // Return the Symbol matching the passed in string. |
| 186 Handle<String> SymbolFromString(Handle<String> value); | 189 Handle<String> SymbolFromString(Handle<String> value); |
| 187 | 190 |
| 188 // Allocate a new struct. The struct is pretenured (allocated directly in | 191 // Allocate a new struct. The struct is pretenured (allocated directly in |
| 189 // the old generation). | 192 // the old generation). |
| 190 Handle<Struct> NewStruct(InstanceType type); | 193 Handle<Struct> NewStruct(InstanceType type); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 Handle<JSObject> NewJSObject(Handle<JSFunction> constructor, | 258 Handle<JSObject> NewJSObject(Handle<JSFunction> constructor, |
| 256 PretenureFlag pretenure = NOT_TENURED); | 259 PretenureFlag pretenure = NOT_TENURED); |
| 257 | 260 |
| 258 // Global objects are pretenured. | 261 // Global objects are pretenured. |
| 259 Handle<GlobalObject> NewGlobalObject(Handle<JSFunction> constructor); | 262 Handle<GlobalObject> NewGlobalObject(Handle<JSFunction> constructor); |
| 260 | 263 |
| 261 // JS objects are pretenured when allocated by the bootstrapper and | 264 // JS objects are pretenured when allocated by the bootstrapper and |
| 262 // runtime. | 265 // runtime. |
| 263 Handle<JSObject> NewJSObjectFromMap(Handle<Map> map); | 266 Handle<JSObject> NewJSObjectFromMap(Handle<Map> map); |
| 264 | 267 |
| 268 // JS modules are pretenured. |
| 269 Handle<JSModule> NewJSModule(); |
| 270 |
| 265 // JS arrays are pretenured when allocated by the parser. | 271 // JS arrays are pretenured when allocated by the parser. |
| 266 Handle<JSArray> NewJSArray(int capacity, | 272 Handle<JSArray> NewJSArray(int capacity, |
| 267 ElementsKind elements_kind = FAST_ELEMENTS, | 273 ElementsKind elements_kind = FAST_ELEMENTS, |
| 268 PretenureFlag pretenure = NOT_TENURED); | 274 PretenureFlag pretenure = NOT_TENURED); |
| 269 | 275 |
| 270 Handle<JSArray> NewJSArrayWithElements( | 276 Handle<JSArray> NewJSArrayWithElements( |
| 271 Handle<FixedArrayBase> elements, | 277 Handle<FixedArrayBase> elements, |
| 272 ElementsKind elements_kind = FAST_ELEMENTS, | 278 ElementsKind elements_kind = FAST_ELEMENTS, |
| 273 PretenureFlag pretenure = NOT_TENURED); | 279 PretenureFlag pretenure = NOT_TENURED); |
| 274 | 280 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 // Update the map cache in the global context with (keys, map) | 509 // Update the map cache in the global context with (keys, map) |
| 504 Handle<MapCache> AddToMapCache(Handle<Context> context, | 510 Handle<MapCache> AddToMapCache(Handle<Context> context, |
| 505 Handle<FixedArray> keys, | 511 Handle<FixedArray> keys, |
| 506 Handle<Map> map); | 512 Handle<Map> map); |
| 507 }; | 513 }; |
| 508 | 514 |
| 509 | 515 |
| 510 } } // namespace v8::internal | 516 } } // namespace v8::internal |
| 511 | 517 |
| 512 #endif // V8_FACTORY_H_ | 518 #endif // V8_FACTORY_H_ |
| OLD | NEW |