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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 356 |
357 | 357 |
358 Handle<Struct> Factory::NewStruct(InstanceType type) { | 358 Handle<Struct> Factory::NewStruct(InstanceType type) { |
359 CALL_HEAP_FUNCTION( | 359 CALL_HEAP_FUNCTION( |
360 isolate(), | 360 isolate(), |
361 isolate()->heap()->AllocateStruct(type), | 361 isolate()->heap()->AllocateStruct(type), |
362 Struct); | 362 Struct); |
363 } | 363 } |
364 | 364 |
365 | 365 |
366 Handle<AccessorInfo> Factory::NewAccessorInfo() { | 366 Handle<DeclaredAccessorInfo> Factory::NewDeclaredAccessorInfo() { |
367 Handle<AccessorInfo> info = | 367 Handle<DeclaredAccessorInfo> info = |
368 Handle<AccessorInfo>::cast(NewStruct(ACCESSOR_INFO_TYPE)); | 368 Handle<DeclaredAccessorInfo>::cast( |
| 369 NewStruct(DECLARED_ACCESSOR_INFO_TYPE)); |
369 info->set_flag(0); // Must clear the flag, it was initialized as undefined. | 370 info->set_flag(0); // Must clear the flag, it was initialized as undefined. |
370 return info; | 371 return info; |
371 } | 372 } |
| 373 |
| 374 |
| 375 Handle<ExecutableAccessorInfo> Factory::NewExecutableAccessorInfo() { |
| 376 Handle<ExecutableAccessorInfo> info = |
| 377 Handle<ExecutableAccessorInfo>::cast( |
| 378 NewStruct(EXECUTABLE_ACCESSOR_INFO_TYPE)); |
| 379 info->set_flag(0); // Must clear the flag, it was initialized as undefined. |
| 380 return info; |
| 381 } |
372 | 382 |
373 | 383 |
374 Handle<Script> Factory::NewScript(Handle<String> source) { | 384 Handle<Script> Factory::NewScript(Handle<String> source) { |
375 // Generate id for this script. | 385 // Generate id for this script. |
376 int id; | 386 int id; |
377 Heap* heap = isolate()->heap(); | 387 Heap* heap = isolate()->heap(); |
378 if (heap->last_script_id()->IsUndefined()) { | 388 if (heap->last_script_id()->IsUndefined()) { |
379 // Script ids start from one. | 389 // Script ids start from one. |
380 id = 1; | 390 id = 1; |
381 } else { | 391 } else { |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 | 1457 |
1448 | 1458 |
1449 Handle<Object> Factory::ToBoolean(bool value) { | 1459 Handle<Object> Factory::ToBoolean(bool value) { |
1450 return Handle<Object>(value | 1460 return Handle<Object>(value |
1451 ? isolate()->heap()->true_value() | 1461 ? isolate()->heap()->true_value() |
1452 : isolate()->heap()->false_value()); | 1462 : isolate()->heap()->false_value()); |
1453 } | 1463 } |
1454 | 1464 |
1455 | 1465 |
1456 } } // namespace v8::internal | 1466 } } // namespace v8::internal |
OLD | NEW |