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 3958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3969 } | 3969 } |
3970 } | 3970 } |
3971 | 3971 |
3972 | 3972 |
3973 bool v8::Object::IsCallable() { | 3973 bool v8::Object::IsCallable() { |
3974 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3974 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3975 ON_BAILOUT(isolate, "v8::Object::IsCallable()", return false); | 3975 ON_BAILOUT(isolate, "v8::Object::IsCallable()", return false); |
3976 ENTER_V8(isolate); | 3976 ENTER_V8(isolate); |
3977 i::HandleScope scope(isolate); | 3977 i::HandleScope scope(isolate); |
3978 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 3978 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
3979 if (obj->IsJSFunction()) return true; | 3979 return obj->IsCallable(); |
3980 return i::Execution::GetFunctionDelegate(isolate, obj)->IsJSFunction(); | |
3981 } | 3980 } |
3982 | 3981 |
3983 | 3982 |
3984 Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Value> recv, | 3983 Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Value> recv, |
3985 int argc, | 3984 int argc, |
3986 v8::Handle<v8::Value> argv[]) { | 3985 v8::Handle<v8::Value> argv[]) { |
3987 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3986 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3988 ON_BAILOUT(isolate, "v8::Object::CallAsFunction()", | 3987 ON_BAILOUT(isolate, "v8::Object::CallAsFunction()", |
3989 return Local<v8::Value>()); | 3988 return Local<v8::Value>()); |
3990 LOG_API(isolate, "Object::CallAsFunction"); | 3989 LOG_API(isolate, "Object::CallAsFunction"); |
(...skipping 3633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7624 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7623 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7625 Address callback_address = | 7624 Address callback_address = |
7626 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7625 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7627 VMState<EXTERNAL> state(isolate); | 7626 VMState<EXTERNAL> state(isolate); |
7628 ExternalCallbackScope call_scope(isolate, callback_address); | 7627 ExternalCallbackScope call_scope(isolate, callback_address); |
7629 callback(info); | 7628 callback(info); |
7630 } | 7629 } |
7631 | 7630 |
7632 | 7631 |
7633 } } // namespace v8::internal | 7632 } } // namespace v8::internal |
OLD | NEW |