| 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 |
| 2896 void External::CheckCast(v8::Value* that) { | 2906 void External::CheckCast(v8::Value* that) { |
| 2897 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return; | 2907 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return; |
| 2898 ApiCheck(Utils::OpenHandle(that)->IsExternal(), | 2908 ApiCheck(Utils::OpenHandle(that)->IsExternal(), |
| 2899 "v8::External::Cast()", | 2909 "v8::External::Cast()", |
| 2900 "Could not convert to external"); | 2910 "Could not convert to external"); |
| 2901 } | 2911 } |
| 2902 | 2912 |
| 2903 | 2913 |
| 2904 void v8::Object::CheckCast(Value* that) { | 2914 void v8::Object::CheckCast(Value* that) { |
| 2905 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return; | 2915 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return; |
| (...skipping 5003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7909 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7919 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7910 Address callback_address = | 7920 Address callback_address = |
| 7911 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7921 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7912 VMState<EXTERNAL> state(isolate); | 7922 VMState<EXTERNAL> state(isolate); |
| 7913 ExternalCallbackScope call_scope(isolate, callback_address); | 7923 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7914 return callback(info); | 7924 return callback(info); |
| 7915 } | 7925 } |
| 7916 | 7926 |
| 7917 | 7927 |
| 7918 } } // namespace v8::internal | 7928 } } // namespace v8::internal |
| OLD | NEW |