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 3542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3553 return Utils::OpenHandle(this)->IsDirty(); | 3553 return Utils::OpenHandle(this)->IsDirty(); |
3554 } | 3554 } |
3555 | 3555 |
3556 | 3556 |
3557 Local<v8::Object> v8::Object::Clone() { | 3557 Local<v8::Object> v8::Object::Clone() { |
3558 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3558 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3559 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>()); | 3559 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>()); |
3560 ENTER_V8(isolate); | 3560 ENTER_V8(isolate); |
3561 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3561 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3562 EXCEPTION_PREAMBLE(isolate); | 3562 EXCEPTION_PREAMBLE(isolate); |
3563 i::Handle<i::JSObject> result = i::JSObject::Copy(self); | 3563 i::Handle<i::JSObject> result = isolate->factory()->CopyJSObject(self); |
3564 has_pending_exception = result.is_null(); | 3564 has_pending_exception = result.is_null(); |
3565 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); | 3565 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); |
3566 return Utils::ToLocal(result); | 3566 return Utils::ToLocal(result); |
3567 } | 3567 } |
3568 | 3568 |
3569 | 3569 |
3570 static i::Context* GetCreationContext(i::JSObject* object) { | 3570 static i::Context* GetCreationContext(i::JSObject* object) { |
3571 i::Object* constructor = object->map()->constructor(); | 3571 i::Object* constructor = object->map()->constructor(); |
3572 i::JSFunction* function; | 3572 i::JSFunction* function; |
3573 if (!constructor->IsJSFunction()) { | 3573 if (!constructor->IsJSFunction()) { |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5767 return Local<Object>(); | 5767 return Local<Object>(); |
5768 } | 5768 } |
5769 i::FixedArray* elms = i::FixedArray::cast(self->elements()); | 5769 i::FixedArray* elms = i::FixedArray::cast(self->elements()); |
5770 i::Object* paragon = elms->get(index); | 5770 i::Object* paragon = elms->get(index); |
5771 if (!paragon->IsJSObject()) { | 5771 if (!paragon->IsJSObject()) { |
5772 return Local<Object>(); | 5772 return Local<Object>(); |
5773 } | 5773 } |
5774 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); | 5774 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); |
5775 EXCEPTION_PREAMBLE(isolate); | 5775 EXCEPTION_PREAMBLE(isolate); |
5776 ENTER_V8(isolate); | 5776 ENTER_V8(isolate); |
5777 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); | 5777 i::Handle<i::JSObject> result = |
| 5778 isolate->factory()->CopyJSObject(paragon_handle); |
5778 has_pending_exception = result.is_null(); | 5779 has_pending_exception = result.is_null(); |
5779 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); | 5780 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); |
5780 return Utils::ToLocal(result); | 5781 return Utils::ToLocal(result); |
5781 } | 5782 } |
5782 | 5783 |
5783 | 5784 |
5784 bool Value::IsPromise() const { | 5785 bool Value::IsPromise() const { |
5785 i::Handle<i::Object> val = Utils::OpenHandle(this); | 5786 i::Handle<i::Object> val = Utils::OpenHandle(this); |
5786 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; | 5787 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; |
5787 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); | 5788 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7581 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7582 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7582 Address callback_address = | 7583 Address callback_address = |
7583 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7584 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7584 VMState<EXTERNAL> state(isolate); | 7585 VMState<EXTERNAL> state(isolate); |
7585 ExternalCallbackScope call_scope(isolate, callback_address); | 7586 ExternalCallbackScope call_scope(isolate, callback_address); |
7586 callback(info); | 7587 callback(info); |
7587 } | 7588 } |
7588 | 7589 |
7589 | 7590 |
7590 } } // namespace v8::internal | 7591 } } // namespace v8::internal |
OLD | NEW |