OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3071 void Context::DetachGlobal() { | 3071 void Context::DetachGlobal() { |
3072 if (IsDeadCheck("v8::Context::DetachGlobal()")) return; | 3072 if (IsDeadCheck("v8::Context::DetachGlobal()")) return; |
3073 ENTER_V8; | 3073 ENTER_V8; |
3074 i::Object** ctx = reinterpret_cast<i::Object**>(this); | 3074 i::Object** ctx = reinterpret_cast<i::Object**>(this); |
3075 i::Handle<i::Context> context = | 3075 i::Handle<i::Context> context = |
3076 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); | 3076 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); |
3077 i::Bootstrapper::DetachGlobal(context); | 3077 i::Bootstrapper::DetachGlobal(context); |
3078 } | 3078 } |
3079 | 3079 |
3080 | 3080 |
| 3081 void Context::ReattachGlobal(Handle<Object> global_object) { |
| 3082 if (IsDeadCheck("v8::Context::ReattachGlobal()")) return; |
| 3083 ENTER_V8; |
| 3084 i::Object** ctx = reinterpret_cast<i::Object**>(this); |
| 3085 i::Handle<i::Context> context = |
| 3086 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); |
| 3087 i::Bootstrapper::ReattachGlobal(context, Utils::OpenHandle(*global_object)); |
| 3088 } |
| 3089 |
| 3090 |
3081 Local<v8::Object> ObjectTemplate::NewInstance() { | 3091 Local<v8::Object> ObjectTemplate::NewInstance() { |
3082 ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); | 3092 ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); |
3083 LOG_API("ObjectTemplate::NewInstance"); | 3093 LOG_API("ObjectTemplate::NewInstance"); |
3084 ENTER_V8; | 3094 ENTER_V8; |
3085 EXCEPTION_PREAMBLE(); | 3095 EXCEPTION_PREAMBLE(); |
3086 i::Handle<i::Object> obj = | 3096 i::Handle<i::Object> obj = |
3087 i::Execution::InstantiateObject(Utils::OpenHandle(this), | 3097 i::Execution::InstantiateObject(Utils::OpenHandle(this), |
3088 &has_pending_exception); | 3098 &has_pending_exception); |
3089 EXCEPTION_BAILOUT_CHECK(Local<v8::Object>()); | 3099 EXCEPTION_BAILOUT_CHECK(Local<v8::Object>()); |
3090 return Utils::ToLocal(i::Handle<i::JSObject>::cast(obj)); | 3100 return Utils::ToLocal(i::Handle<i::JSObject>::cast(obj)); |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4051 | 4061 |
4052 | 4062 |
4053 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 4063 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
4054 HandleScopeImplementer* thread_local = | 4064 HandleScopeImplementer* thread_local = |
4055 reinterpret_cast<HandleScopeImplementer*>(storage); | 4065 reinterpret_cast<HandleScopeImplementer*>(storage); |
4056 thread_local->IterateThis(v); | 4066 thread_local->IterateThis(v); |
4057 return storage + ArchiveSpacePerThread(); | 4067 return storage + ArchiveSpacePerThread(); |
4058 } | 4068 } |
4059 | 4069 |
4060 } } // namespace v8::internal | 4070 } } // namespace v8::internal |
OLD | NEW |