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 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 LOG_API(isolate, "ToInteger"); | 2896 LOG_API(isolate, "ToInteger"); |
2897 ENTER_V8(isolate); | 2897 ENTER_V8(isolate); |
2898 EXCEPTION_PREAMBLE(isolate); | 2898 EXCEPTION_PREAMBLE(isolate); |
2899 num = i::Execution::ToInteger(obj, &has_pending_exception); | 2899 num = i::Execution::ToInteger(obj, &has_pending_exception); |
2900 EXCEPTION_BAILOUT_CHECK(isolate, Local<Integer>()); | 2900 EXCEPTION_BAILOUT_CHECK(isolate, Local<Integer>()); |
2901 } | 2901 } |
2902 return ToApiHandle<Integer>(num); | 2902 return ToApiHandle<Integer>(num); |
2903 } | 2903 } |
2904 | 2904 |
2905 | 2905 |
| 2906 #ifdef V8_ENABLE_CHECKS |
| 2907 void i::Internals::CheckInitialized(v8::Isolate* external_isolate) { |
| 2908 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); |
| 2909 ApiCheck(isolate != NULL && isolate->IsInitialized() && !i::V8::IsDead(), |
| 2910 "v8::internal::Internals::CheckInitialized()", |
| 2911 "Isolate is not initialized or V8 has died"); |
| 2912 } |
| 2913 #endif |
| 2914 |
| 2915 |
2906 void External::CheckCast(v8::Value* that) { | 2916 void External::CheckCast(v8::Value* that) { |
2907 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return; | 2917 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return; |
2908 ApiCheck(Utils::OpenHandle(that)->IsExternal(), | 2918 ApiCheck(Utils::OpenHandle(that)->IsExternal(), |
2909 "v8::External::Cast()", | 2919 "v8::External::Cast()", |
2910 "Could not convert to external"); | 2920 "Could not convert to external"); |
2911 } | 2921 } |
2912 | 2922 |
2913 | 2923 |
2914 void v8::Object::CheckCast(Value* that) { | 2924 void v8::Object::CheckCast(Value* that) { |
2915 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return; | 2925 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return; |
(...skipping 5042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7958 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7968 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7959 Address callback_address = | 7969 Address callback_address = |
7960 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7970 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7961 VMState<EXTERNAL> state(isolate); | 7971 VMState<EXTERNAL> state(isolate); |
7962 ExternalCallbackScope call_scope(isolate, callback_address); | 7972 ExternalCallbackScope call_scope(isolate, callback_address); |
7963 return callback(info); | 7973 return callback(info); |
7964 } | 7974 } |
7965 | 7975 |
7966 | 7976 |
7967 } } // namespace v8::internal | 7977 } } // namespace v8::internal |
OLD | NEW |