| 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 4036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4047 } | 4047 } |
| 4048 } | 4048 } |
| 4049 | 4049 |
| 4050 | 4050 |
| 4051 bool v8::Object::IsCallable() { | 4051 bool v8::Object::IsCallable() { |
| 4052 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 4052 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 4053 ON_BAILOUT(isolate, "v8::Object::IsCallable()", return false); | 4053 ON_BAILOUT(isolate, "v8::Object::IsCallable()", return false); |
| 4054 ENTER_V8(isolate); | 4054 ENTER_V8(isolate); |
| 4055 i::HandleScope scope(isolate); | 4055 i::HandleScope scope(isolate); |
| 4056 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 4056 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
| 4057 if (obj->IsJSFunction()) return true; | 4057 return obj->IsCallable(); |
| 4058 return i::Execution::GetFunctionDelegate(isolate, obj)->IsJSFunction(); | |
| 4059 } | 4058 } |
| 4060 | 4059 |
| 4061 | 4060 |
| 4062 Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Value> recv, | 4061 Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Value> recv, |
| 4063 int argc, | 4062 int argc, |
| 4064 v8::Handle<v8::Value> argv[]) { | 4063 v8::Handle<v8::Value> argv[]) { |
| 4065 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 4064 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 4066 ON_BAILOUT(isolate, "v8::Object::CallAsFunction()", | 4065 ON_BAILOUT(isolate, "v8::Object::CallAsFunction()", |
| 4067 return Local<v8::Value>()); | 4066 return Local<v8::Value>()); |
| 4068 LOG_API(isolate, "Object::CallAsFunction"); | 4067 LOG_API(isolate, "Object::CallAsFunction"); |
| (...skipping 3712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7781 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7780 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7782 Address callback_address = | 7781 Address callback_address = |
| 7783 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7782 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7784 VMState<EXTERNAL> state(isolate); | 7783 VMState<EXTERNAL> state(isolate); |
| 7785 ExternalCallbackScope call_scope(isolate, callback_address); | 7784 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7786 callback(info); | 7785 callback(info); |
| 7787 } | 7786 } |
| 7788 | 7787 |
| 7789 | 7788 |
| 7790 } } // namespace v8::internal | 7789 } } // namespace v8::internal |
| OLD | NEW |