| 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 | 893 |
| 894 Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler, | 894 Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler, |
| 895 Handle<Object> prototype) { | 895 Handle<Object> prototype) { |
| 896 CALL_HEAP_FUNCTION( | 896 CALL_HEAP_FUNCTION( |
| 897 isolate(), | 897 isolate(), |
| 898 isolate()->heap()->AllocateJSProxy(*handler, *prototype), | 898 isolate()->heap()->AllocateJSProxy(*handler, *prototype), |
| 899 JSProxy); | 899 JSProxy); |
| 900 } | 900 } |
| 901 | 901 |
| 902 | 902 |
| 903 void Factory::BecomeJSObject(Handle<JSProxy> object) { | 903 void Factory::BecomeJSObject(Handle<JSReceiver> object) { |
| 904 CALL_HEAP_FUNCTION_VOID( | 904 CALL_HEAP_FUNCTION_VOID( |
| 905 isolate(), | 905 isolate(), |
| 906 isolate()->heap()->ReinitializeJSProxyAsJSObject(*object)); | 906 isolate()->heap()->ReinitializeJSReceiver( |
| 907 *object, JS_OBJECT_TYPE, JSObject::kHeaderSize)); |
| 907 } | 908 } |
| 908 | 909 |
| 909 | 910 |
| 911 void Factory::BecomeJSFunction(Handle<JSReceiver> object) { |
| 912 CALL_HEAP_FUNCTION_VOID( |
| 913 isolate(), |
| 914 isolate()->heap()->ReinitializeJSReceiver( |
| 915 *object, JS_FUNCTION_TYPE, JSFunction::kSize)); |
| 916 } |
| 917 |
| 918 |
| 910 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 919 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
| 911 Handle<String> name, | 920 Handle<String> name, |
| 912 int number_of_literals, | 921 int number_of_literals, |
| 913 Handle<Code> code, | 922 Handle<Code> code, |
| 914 Handle<SerializedScopeInfo> scope_info) { | 923 Handle<SerializedScopeInfo> scope_info) { |
| 915 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); | 924 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); |
| 916 shared->set_code(*code); | 925 shared->set_code(*code); |
| 917 shared->set_scope_info(*scope_info); | 926 shared->set_scope_info(*scope_info); |
| 918 int literals_array_size = number_of_literals; | 927 int literals_array_size = number_of_literals; |
| 919 // If the function contains object, regexp or array literals, | 928 // If the function contains object, regexp or array literals, |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 Execution::ConfigureInstance(instance, | 1271 Execution::ConfigureInstance(instance, |
| 1263 instance_template, | 1272 instance_template, |
| 1264 pending_exception); | 1273 pending_exception); |
| 1265 } else { | 1274 } else { |
| 1266 *pending_exception = false; | 1275 *pending_exception = false; |
| 1267 } | 1276 } |
| 1268 } | 1277 } |
| 1269 | 1278 |
| 1270 | 1279 |
| 1271 } } // namespace v8::internal | 1280 } } // namespace v8::internal |
| OLD | NEW |