OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 | 2939 |
2940 | 2940 |
2941 void v8::Function::CheckCast(Value* that) { | 2941 void v8::Function::CheckCast(Value* that) { |
2942 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2942 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2943 Utils::ApiCheck(obj->IsJSFunction(), | 2943 Utils::ApiCheck(obj->IsJSFunction(), |
2944 "v8::Function::Cast()", | 2944 "v8::Function::Cast()", |
2945 "Could not convert to function"); | 2945 "Could not convert to function"); |
2946 } | 2946 } |
2947 | 2947 |
2948 | 2948 |
| 2949 void v8::Boolean::CheckCast(v8::Value* that) { |
| 2950 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
| 2951 Utils::ApiCheck(obj->IsBoolean(), |
| 2952 "v8::Boolean::Cast()", |
| 2953 "Could not convert to boolean"); |
| 2954 } |
| 2955 |
| 2956 |
2949 void v8::Name::CheckCast(v8::Value* that) { | 2957 void v8::Name::CheckCast(v8::Value* that) { |
2950 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2958 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2951 Utils::ApiCheck(obj->IsName(), | 2959 Utils::ApiCheck(obj->IsName(), |
2952 "v8::Name::Cast()", | 2960 "v8::Name::Cast()", |
2953 "Could not convert to name"); | 2961 "Could not convert to name"); |
2954 } | 2962 } |
2955 | 2963 |
2956 | 2964 |
2957 void v8::String::CheckCast(v8::Value* that) { | 2965 void v8::String::CheckCast(v8::Value* that) { |
2958 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2966 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
(...skipping 5046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8005 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8013 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
8006 Address callback_address = | 8014 Address callback_address = |
8007 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8015 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8008 VMState<EXTERNAL> state(isolate); | 8016 VMState<EXTERNAL> state(isolate); |
8009 ExternalCallbackScope call_scope(isolate, callback_address); | 8017 ExternalCallbackScope call_scope(isolate, callback_address); |
8010 callback(info); | 8018 callback(info); |
8011 } | 8019 } |
8012 | 8020 |
8013 | 8021 |
8014 } } // namespace v8::internal | 8022 } } // namespace v8::internal |
OLD | NEW |