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 "api.h" | 5 #include "api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #include <cmath> // For isnan. | 8 #include <cmath> // For isnan. |
9 #include "../include/v8-debug.h" | 9 #include "../include/v8-debug.h" |
10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" |
(...skipping 5751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5762 i::Handle<i::JSObject> result = | 5762 i::Handle<i::JSObject> result = |
5763 isolate->factory()->CopyJSObject(paragon_handle); | 5763 isolate->factory()->CopyJSObject(paragon_handle); |
5764 has_pending_exception = result.is_null(); | 5764 has_pending_exception = result.is_null(); |
5765 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); | 5765 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); |
5766 return Utils::ToLocal(result); | 5766 return Utils::ToLocal(result); |
5767 } | 5767 } |
5768 | 5768 |
5769 | 5769 |
5770 bool Value::IsPromise() const { | 5770 bool Value::IsPromise() const { |
5771 i::Handle<i::Object> val = Utils::OpenHandle(this); | 5771 i::Handle<i::Object> val = Utils::OpenHandle(this); |
5772 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; | 5772 if (!val->IsJSObject()) return false; |
5773 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); | 5773 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); |
5774 i::Isolate* isolate = obj->GetIsolate(); | 5774 i::Isolate* isolate = obj->GetIsolate(); |
5775 LOG_API(isolate, "IsPromise"); | 5775 LOG_API(isolate, "IsPromise"); |
5776 ENTER_V8(isolate); | 5776 ENTER_V8(isolate); |
5777 EXCEPTION_PREAMBLE(isolate); | 5777 EXCEPTION_PREAMBLE(isolate); |
5778 i::Handle<i::Object> argv[] = { obj }; | 5778 i::Handle<i::Object> argv[] = { obj }; |
5779 i::Handle<i::Object> b; | 5779 i::Handle<i::Object> b; |
5780 has_pending_exception = !i::Execution::Call( | 5780 has_pending_exception = !i::Execution::Call( |
5781 isolate, | 5781 isolate, |
5782 handle( | 5782 handle( |
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7595 Address callback_address = | 7595 Address callback_address = |
7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7597 VMState<EXTERNAL> state(isolate); | 7597 VMState<EXTERNAL> state(isolate); |
7598 ExternalCallbackScope call_scope(isolate, callback_address); | 7598 ExternalCallbackScope call_scope(isolate, callback_address); |
7599 callback(info); | 7599 callback(info); |
7600 } | 7600 } |
7601 | 7601 |
7602 | 7602 |
7603 } } // namespace v8::internal | 7603 } } // namespace v8::internal |
OLD | NEW |