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 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 LOG_API(isolate, "ToInteger"); | 2886 LOG_API(isolate, "ToInteger"); |
2887 ENTER_V8(isolate); | 2887 ENTER_V8(isolate); |
2888 EXCEPTION_PREAMBLE(isolate); | 2888 EXCEPTION_PREAMBLE(isolate); |
2889 num = i::Execution::ToInteger(obj, &has_pending_exception); | 2889 num = i::Execution::ToInteger(obj, &has_pending_exception); |
2890 EXCEPTION_BAILOUT_CHECK(isolate, Local<Integer>()); | 2890 EXCEPTION_BAILOUT_CHECK(isolate, Local<Integer>()); |
2891 } | 2891 } |
2892 return ToApiHandle<Integer>(num); | 2892 return ToApiHandle<Integer>(num); |
2893 } | 2893 } |
2894 | 2894 |
2895 | 2895 |
2896 #ifdef V8_ENABLE_CHECKS | |
2897 void i::Internals::CheckInitialized(v8::Isolate* external_isolate) { | |
2898 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); | |
2899 ApiCheck(isolate != NULL && isolate->IsInitialized() && !i::V8::IsDead(), | |
2900 "v8::internal::Internals::CheckInitialized()", | |
2901 "Isolate is not initialized or V8 has died"); | |
2902 } | |
2903 #endif | |
2904 | |
2905 | |
2906 void External::CheckCast(v8::Value* that) { | 2896 void External::CheckCast(v8::Value* that) { |
2907 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return; | 2897 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return; |
2908 ApiCheck(Utils::OpenHandle(that)->IsExternal(), | 2898 ApiCheck(Utils::OpenHandle(that)->IsExternal(), |
2909 "v8::External::Cast()", | 2899 "v8::External::Cast()", |
2910 "Could not convert to external"); | 2900 "Could not convert to external"); |
2911 } | 2901 } |
2912 | 2902 |
2913 | 2903 |
2914 void v8::Object::CheckCast(Value* that) { | 2904 void v8::Object::CheckCast(Value* that) { |
2915 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return; | 2905 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return; |
(...skipping 5010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7926 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7916 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7927 Address callback_address = | 7917 Address callback_address = |
7928 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7918 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7929 VMState<EXTERNAL> state(isolate); | 7919 VMState<EXTERNAL> state(isolate); |
7930 ExternalCallbackScope call_scope(isolate, callback_address); | 7920 ExternalCallbackScope call_scope(isolate, callback_address); |
7931 return callback(info); | 7921 return callback(info); |
7932 } | 7922 } |
7933 | 7923 |
7934 | 7924 |
7935 } } // namespace v8::internal | 7925 } } // namespace v8::internal |
OLD | NEW |