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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 #endif | 365 #endif |
366 } | 366 } |
367 | 367 |
368 | 368 |
369 void V8::SetFatalErrorHandler(FatalErrorCallback that) { | 369 void V8::SetFatalErrorHandler(FatalErrorCallback that) { |
370 i::Isolate* isolate = EnterIsolateIfNeeded(); | 370 i::Isolate* isolate = EnterIsolateIfNeeded(); |
371 isolate->set_exception_behavior(that); | 371 isolate->set_exception_behavior(that); |
372 } | 372 } |
373 | 373 |
374 | 374 |
| 375 void V8::SetAllowCodeGenerationFromStringsCallback( |
| 376 AllowCodeGenerationFromStringsCallback callback) { |
| 377 i::Isolate* isolate = EnterIsolateIfNeeded(); |
| 378 isolate->set_allow_code_gen_callback(callback); |
| 379 } |
| 380 |
| 381 |
375 #ifdef DEBUG | 382 #ifdef DEBUG |
376 void ImplementationUtilities::ZapHandleRange(i::Object** begin, | 383 void ImplementationUtilities::ZapHandleRange(i::Object** begin, |
377 i::Object** end) { | 384 i::Object** end) { |
378 i::HandleScope::ZapRange(begin, end); | 385 i::HandleScope::ZapRange(begin, end); |
379 } | 386 } |
380 #endif | 387 #endif |
381 | 388 |
382 | 389 |
383 void V8::SetFlagsFromString(const char* str, int length) { | 390 void V8::SetFlagsFromString(const char* str, int length) { |
384 i::FlagList::SetFlagsFromString(str, length); | 391 i::FlagList::SetFlagsFromString(str, length); |
(...skipping 3526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3911 ENTER_V8(isolate); | 3918 ENTER_V8(isolate); |
3912 i::Object** ctx = reinterpret_cast<i::Object**>(this); | 3919 i::Object** ctx = reinterpret_cast<i::Object**>(this); |
3913 i::Handle<i::Context> context = | 3920 i::Handle<i::Context> context = |
3914 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); | 3921 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); |
3915 isolate->bootstrapper()->ReattachGlobal( | 3922 isolate->bootstrapper()->ReattachGlobal( |
3916 context, | 3923 context, |
3917 Utils::OpenHandle(*global_object)); | 3924 Utils::OpenHandle(*global_object)); |
3918 } | 3925 } |
3919 | 3926 |
3920 | 3927 |
| 3928 void Context::AllowCodeGenerationFromStrings(bool allow) { |
| 3929 i::Isolate* isolate = i::Isolate::Current(); |
| 3930 if (IsDeadCheck(isolate, "v8::Context::AllowCodeGenerationFromStrings()")) { |
| 3931 return; |
| 3932 } |
| 3933 ENTER_V8(isolate); |
| 3934 i::Object** ctx = reinterpret_cast<i::Object**>(this); |
| 3935 i::Handle<i::Context> context = |
| 3936 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); |
| 3937 context->set_allow_code_gen_from_strings( |
| 3938 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); |
| 3939 } |
| 3940 |
| 3941 |
3921 void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) { | 3942 void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) { |
3922 i::GlobalHandles::SetWrapperClassId(global_handle, class_id); | 3943 i::GlobalHandles::SetWrapperClassId(global_handle, class_id); |
3923 } | 3944 } |
3924 | 3945 |
3925 | 3946 |
3926 Local<v8::Object> ObjectTemplate::NewInstance() { | 3947 Local<v8::Object> ObjectTemplate::NewInstance() { |
3927 i::Isolate* isolate = i::Isolate::Current(); | 3948 i::Isolate* isolate = i::Isolate::Current(); |
3928 ON_BAILOUT(isolate, "v8::ObjectTemplate::NewInstance()", | 3949 ON_BAILOUT(isolate, "v8::ObjectTemplate::NewInstance()", |
3929 return Local<v8::Object>()); | 3950 return Local<v8::Object>()); |
3930 LOG_API(isolate, "ObjectTemplate::NewInstance"); | 3951 LOG_API(isolate, "ObjectTemplate::NewInstance"); |
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5740 | 5761 |
5741 | 5762 |
5742 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5763 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
5743 HandleScopeImplementer* scope_implementer = | 5764 HandleScopeImplementer* scope_implementer = |
5744 reinterpret_cast<HandleScopeImplementer*>(storage); | 5765 reinterpret_cast<HandleScopeImplementer*>(storage); |
5745 scope_implementer->IterateThis(v); | 5766 scope_implementer->IterateThis(v); |
5746 return storage + ArchiveSpacePerThread(); | 5767 return storage + ArchiveSpacePerThread(); |
5747 } | 5768 } |
5748 | 5769 |
5749 } } // namespace v8::internal | 5770 } } // namespace v8::internal |
OLD | NEW |