OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 CALL_HEAP_FUNCTION( | 296 CALL_HEAP_FUNCTION( |
297 isolate(), | 297 isolate(), |
298 isolate()->heap()->AllocateWithContext(*function, *previous, *extension), | 298 isolate()->heap()->AllocateWithContext(*function, *previous, *extension), |
299 Context); | 299 Context); |
300 } | 300 } |
301 | 301 |
302 | 302 |
303 Handle<Context> Factory::NewBlockContext( | 303 Handle<Context> Factory::NewBlockContext( |
304 Handle<JSFunction> function, | 304 Handle<JSFunction> function, |
305 Handle<Context> previous, | 305 Handle<Context> previous, |
306 Handle<SerializedScopeInfo> scope_info) { | 306 Handle<ScopeInfo> scope_info) { |
307 CALL_HEAP_FUNCTION( | 307 CALL_HEAP_FUNCTION( |
308 isolate(), | 308 isolate(), |
309 isolate()->heap()->AllocateBlockContext(*function, | 309 isolate()->heap()->AllocateBlockContext(*function, |
310 *previous, | 310 *previous, |
311 *scope_info), | 311 *scope_info), |
312 Context); | 312 Context); |
313 } | 313 } |
314 | 314 |
315 | 315 |
316 Handle<Struct> Factory::NewStruct(InstanceType type) { | 316 Handle<Struct> Factory::NewStruct(InstanceType type) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, | 759 Handle<JSFunction> function = NewFunctionWithoutPrototype(name, |
760 kNonStrictMode); | 760 kNonStrictMode); |
761 function->shared()->set_code(*code); | 761 function->shared()->set_code(*code); |
762 function->set_code(*code); | 762 function->set_code(*code); |
763 ASSERT(!function->has_initial_map()); | 763 ASSERT(!function->has_initial_map()); |
764 ASSERT(!function->has_prototype()); | 764 ASSERT(!function->has_prototype()); |
765 return function; | 765 return function; |
766 } | 766 } |
767 | 767 |
768 | 768 |
769 Handle<SerializedScopeInfo> Factory::NewSerializedScopeInfo(int length) { | 769 Handle<ScopeInfo> Factory::NewScopeInfo(int length) { |
770 CALL_HEAP_FUNCTION( | 770 CALL_HEAP_FUNCTION( |
771 isolate(), | 771 isolate(), |
772 isolate()->heap()->AllocateSerializedScopeInfo(length), | 772 isolate()->heap()->AllocateScopeInfo(length), |
773 SerializedScopeInfo); | 773 ScopeInfo); |
774 } | 774 } |
775 | 775 |
776 | 776 |
777 Handle<Code> Factory::NewCode(const CodeDesc& desc, | 777 Handle<Code> Factory::NewCode(const CodeDesc& desc, |
778 Code::Flags flags, | 778 Code::Flags flags, |
779 Handle<Object> self_ref, | 779 Handle<Object> self_ref, |
780 bool immovable) { | 780 bool immovable) { |
781 CALL_HEAP_FUNCTION(isolate(), | 781 CALL_HEAP_FUNCTION(isolate(), |
782 isolate()->heap()->CreateCode( | 782 isolate()->heap()->CreateCode( |
783 desc, flags, self_ref, immovable), | 783 desc, flags, self_ref, immovable), |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 CALL_HEAP_FUNCTION_VOID( | 978 CALL_HEAP_FUNCTION_VOID( |
979 isolate(), | 979 isolate(), |
980 object->SetIdentityHash(hash, ALLOW_CREATION)); | 980 object->SetIdentityHash(hash, ALLOW_CREATION)); |
981 } | 981 } |
982 | 982 |
983 | 983 |
984 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 984 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
985 Handle<String> name, | 985 Handle<String> name, |
986 int number_of_literals, | 986 int number_of_literals, |
987 Handle<Code> code, | 987 Handle<Code> code, |
988 Handle<SerializedScopeInfo> scope_info) { | 988 Handle<ScopeInfo> scope_info) { |
989 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); | 989 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); |
990 shared->set_code(*code); | 990 shared->set_code(*code); |
991 shared->set_scope_info(*scope_info); | 991 shared->set_scope_info(*scope_info); |
992 int literals_array_size = number_of_literals; | 992 int literals_array_size = number_of_literals; |
993 // If the function contains object, regexp or array literals, | 993 // If the function contains object, regexp or array literals, |
994 // allocate extra space for a literals array prefix containing the | 994 // allocate extra space for a literals array prefix containing the |
995 // context. | 995 // context. |
996 if (number_of_literals > 0) { | 996 if (number_of_literals > 0) { |
997 literals_array_size += JSFunction::kLiteralsPrefixSize; | 997 literals_array_size += JSFunction::kLiteralsPrefixSize; |
998 } | 998 } |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 | 1358 |
1359 | 1359 |
1360 Handle<Object> Factory::ToBoolean(bool value) { | 1360 Handle<Object> Factory::ToBoolean(bool value) { |
1361 return Handle<Object>(value | 1361 return Handle<Object>(value |
1362 ? isolate()->heap()->true_value() | 1362 ? isolate()->heap()->true_value() |
1363 : isolate()->heap()->false_value()); | 1363 : isolate()->heap()->false_value()); |
1364 } | 1364 } |
1365 | 1365 |
1366 | 1366 |
1367 } } // namespace v8::internal | 1367 } } // namespace v8::internal |
OLD | NEW |