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 3186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 bool v8::Object::SetPrototype(Handle<Value> value) { | 3197 bool v8::Object::SetPrototype(Handle<Value> value) { |
3198 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3198 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3199 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false); | 3199 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false); |
3200 ENTER_V8(isolate); | 3200 ENTER_V8(isolate); |
3201 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3201 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3202 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3202 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
3203 // We do not allow exceptions thrown while setting the prototype | 3203 // We do not allow exceptions thrown while setting the prototype |
3204 // to propagate outside. | 3204 // to propagate outside. |
3205 TryCatch try_catch; | 3205 TryCatch try_catch; |
3206 EXCEPTION_PREAMBLE(isolate); | 3206 EXCEPTION_PREAMBLE(isolate); |
3207 i::MaybeHandle<i::Object> result = i::JSObject::SetPrototype( | 3207 i::MaybeHandle<i::Object> result = |
3208 self, value_obj); | 3208 i::JSObject::SetPrototype(self, value_obj, false); |
3209 has_pending_exception = result.is_null(); | 3209 has_pending_exception = result.is_null(); |
3210 EXCEPTION_BAILOUT_CHECK(isolate, false); | 3210 EXCEPTION_BAILOUT_CHECK(isolate, false); |
3211 return true; | 3211 return true; |
3212 } | 3212 } |
3213 | 3213 |
3214 | 3214 |
3215 Local<Object> v8::Object::FindInstanceInPrototypeChain( | 3215 Local<Object> v8::Object::FindInstanceInPrototypeChain( |
3216 v8::Handle<FunctionTemplate> tmpl) { | 3216 v8::Handle<FunctionTemplate> tmpl) { |
3217 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3217 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3218 ON_BAILOUT(isolate, | 3218 ON_BAILOUT(isolate, |
(...skipping 4415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7634 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7634 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7635 Address callback_address = | 7635 Address callback_address = |
7636 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7636 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7637 VMState<EXTERNAL> state(isolate); | 7637 VMState<EXTERNAL> state(isolate); |
7638 ExternalCallbackScope call_scope(isolate, callback_address); | 7638 ExternalCallbackScope call_scope(isolate, callback_address); |
7639 callback(info); | 7639 callback(info); |
7640 } | 7640 } |
7641 | 7641 |
7642 | 7642 |
7643 } } // namespace v8::internal | 7643 } } // namespace v8::internal |
OLD | NEW |