| 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 3455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3466 v8::Local<Name> key, | 3466 v8::Local<Name> key, |
| 3467 v8::Local<Value> value) { | 3467 v8::Local<Value> value) { |
| 3468 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", | 3468 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", |
| 3469 bool); | 3469 bool); |
| 3470 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); | 3470 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); |
| 3471 i::Handle<i::Name> key_obj = Utils::OpenHandle(*key); | 3471 i::Handle<i::Name> key_obj = Utils::OpenHandle(*key); |
| 3472 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3472 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 3473 | 3473 |
| 3474 i::LookupIterator it = i::LookupIterator::PropertyOrElement( | 3474 i::LookupIterator it = i::LookupIterator::PropertyOrElement( |
| 3475 isolate, self, key_obj, i::LookupIterator::OWN); | 3475 isolate, self, key_obj, i::LookupIterator::OWN); |
| 3476 Maybe<bool> result = i::JSReceiver::CreateDataProperty(&it, value_obj); | 3476 Maybe<bool> result = |
| 3477 i::JSReceiver::CreateDataProperty(&it, value_obj, i::Object::DONT_THROW); |
| 3477 has_pending_exception = result.IsNothing(); | 3478 has_pending_exception = result.IsNothing(); |
| 3478 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 3479 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 3479 return result; | 3480 return result; |
| 3480 } | 3481 } |
| 3481 | 3482 |
| 3482 | 3483 |
| 3483 Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context> context, | 3484 Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context> context, |
| 3484 uint32_t index, | 3485 uint32_t index, |
| 3485 v8::Local<Value> value) { | 3486 v8::Local<Value> value) { |
| 3486 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", | 3487 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", |
| 3487 bool); | 3488 bool); |
| 3488 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); | 3489 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); |
| 3489 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3490 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 3490 | 3491 |
| 3491 i::LookupIterator it(isolate, self, index, i::LookupIterator::OWN); | 3492 i::LookupIterator it(isolate, self, index, i::LookupIterator::OWN); |
| 3492 Maybe<bool> result = i::JSReceiver::CreateDataProperty(&it, value_obj); | 3493 Maybe<bool> result = |
| 3494 i::JSReceiver::CreateDataProperty(&it, value_obj, i::Object::DONT_THROW); |
| 3493 has_pending_exception = result.IsNothing(); | 3495 has_pending_exception = result.IsNothing(); |
| 3494 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 3496 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 3495 return result; | 3497 return result; |
| 3496 } | 3498 } |
| 3497 | 3499 |
| 3498 | 3500 |
| 3499 Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context, | 3501 Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context, |
| 3500 v8::Local<Name> key, | 3502 v8::Local<Name> key, |
| 3501 v8::Local<Value> value, | 3503 v8::Local<Value> value, |
| 3502 v8::PropertyAttribute attributes) { | 3504 v8::PropertyAttribute attributes) { |
| (...skipping 4991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8494 Address callback_address = | 8496 Address callback_address = |
| 8495 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8497 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8496 VMState<EXTERNAL> state(isolate); | 8498 VMState<EXTERNAL> state(isolate); |
| 8497 ExternalCallbackScope call_scope(isolate, callback_address); | 8499 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8498 callback(info); | 8500 callback(info); |
| 8499 } | 8501 } |
| 8500 | 8502 |
| 8501 | 8503 |
| 8502 } // namespace internal | 8504 } // namespace internal |
| 8503 } // namespace v8 | 8505 } // namespace v8 |
| OLD | NEW |