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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 | 285 |
286 Handle<Context> Factory::NewGlobalContext() { | 286 Handle<Context> Factory::NewGlobalContext() { |
287 CALL_HEAP_FUNCTION( | 287 CALL_HEAP_FUNCTION( |
288 isolate(), | 288 isolate(), |
289 isolate()->heap()->AllocateGlobalContext(), | 289 isolate()->heap()->AllocateGlobalContext(), |
290 Context); | 290 Context); |
291 } | 291 } |
292 | 292 |
293 | 293 |
| 294 Handle<Context> Factory::NewModuleContext(Handle<Context> previous, |
| 295 Handle<ScopeInfo> scope_info) { |
| 296 CALL_HEAP_FUNCTION( |
| 297 isolate(), |
| 298 isolate()->heap()->AllocateModuleContext(*previous, *scope_info), |
| 299 Context); |
| 300 } |
| 301 |
| 302 |
294 Handle<Context> Factory::NewFunctionContext(int length, | 303 Handle<Context> Factory::NewFunctionContext(int length, |
295 Handle<JSFunction> function) { | 304 Handle<JSFunction> function) { |
296 CALL_HEAP_FUNCTION( | 305 CALL_HEAP_FUNCTION( |
297 isolate(), | 306 isolate(), |
298 isolate()->heap()->AllocateFunctionContext(length, *function), | 307 isolate()->heap()->AllocateFunctionContext(length, *function), |
299 Context); | 308 Context); |
300 } | 309 } |
301 | 310 |
302 | 311 |
303 Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function, | 312 Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function, |
(...skipping 13 matching lines...) Expand all Loading... |
317 Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, | 326 Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, |
318 Handle<Context> previous, | 327 Handle<Context> previous, |
319 Handle<JSObject> extension) { | 328 Handle<JSObject> extension) { |
320 CALL_HEAP_FUNCTION( | 329 CALL_HEAP_FUNCTION( |
321 isolate(), | 330 isolate(), |
322 isolate()->heap()->AllocateWithContext(*function, *previous, *extension), | 331 isolate()->heap()->AllocateWithContext(*function, *previous, *extension), |
323 Context); | 332 Context); |
324 } | 333 } |
325 | 334 |
326 | 335 |
327 Handle<Context> Factory::NewBlockContext( | 336 Handle<Context> Factory::NewBlockContext(Handle<JSFunction> function, |
328 Handle<JSFunction> function, | 337 Handle<Context> previous, |
329 Handle<Context> previous, | 338 Handle<ScopeInfo> scope_info) { |
330 Handle<ScopeInfo> scope_info) { | |
331 CALL_HEAP_FUNCTION( | 339 CALL_HEAP_FUNCTION( |
332 isolate(), | 340 isolate(), |
333 isolate()->heap()->AllocateBlockContext(*function, | 341 isolate()->heap()->AllocateBlockContext(*function, |
334 *previous, | 342 *previous, |
335 *scope_info), | 343 *scope_info), |
336 Context); | 344 Context); |
337 } | 345 } |
338 | 346 |
339 | 347 |
340 Handle<Struct> Factory::NewStruct(InstanceType type) { | 348 Handle<Struct> Factory::NewStruct(InstanceType type) { |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 922 |
915 | 923 |
916 Handle<JSObject> Factory::NewJSObject(Handle<JSFunction> constructor, | 924 Handle<JSObject> Factory::NewJSObject(Handle<JSFunction> constructor, |
917 PretenureFlag pretenure) { | 925 PretenureFlag pretenure) { |
918 CALL_HEAP_FUNCTION( | 926 CALL_HEAP_FUNCTION( |
919 isolate(), | 927 isolate(), |
920 isolate()->heap()->AllocateJSObject(*constructor, pretenure), JSObject); | 928 isolate()->heap()->AllocateJSObject(*constructor, pretenure), JSObject); |
921 } | 929 } |
922 | 930 |
923 | 931 |
| 932 Handle<JSModule> Factory::NewJSModule() { |
| 933 CALL_HEAP_FUNCTION( |
| 934 isolate(), |
| 935 isolate()->heap()->AllocateJSModule(), JSModule); |
| 936 } |
| 937 |
| 938 |
924 Handle<GlobalObject> Factory::NewGlobalObject( | 939 Handle<GlobalObject> Factory::NewGlobalObject( |
925 Handle<JSFunction> constructor) { | 940 Handle<JSFunction> constructor) { |
926 CALL_HEAP_FUNCTION(isolate(), | 941 CALL_HEAP_FUNCTION(isolate(), |
927 isolate()->heap()->AllocateGlobalObject(*constructor), | 942 isolate()->heap()->AllocateGlobalObject(*constructor), |
928 GlobalObject); | 943 GlobalObject); |
929 } | 944 } |
930 | 945 |
931 | 946 |
932 | 947 |
933 Handle<JSObject> Factory::NewJSObjectFromMap(Handle<Map> map) { | 948 Handle<JSObject> Factory::NewJSObjectFromMap(Handle<Map> map) { |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 | 1433 |
1419 | 1434 |
1420 Handle<Object> Factory::ToBoolean(bool value) { | 1435 Handle<Object> Factory::ToBoolean(bool value) { |
1421 return Handle<Object>(value | 1436 return Handle<Object>(value |
1422 ? isolate()->heap()->true_value() | 1437 ? isolate()->heap()->true_value() |
1423 : isolate()->heap()->false_value()); | 1438 : isolate()->heap()->false_value()); |
1424 } | 1439 } |
1425 | 1440 |
1426 | 1441 |
1427 } } // namespace v8::internal | 1442 } } // namespace v8::internal |
OLD | NEW |