| 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 3543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3554 MUST_USE_RESULT | 3554 MUST_USE_RESULT |
| 3555 static i::MaybeHandle<i::Object> DefineObjectProperty( | 3555 static i::MaybeHandle<i::Object> DefineObjectProperty( |
| 3556 i::Handle<i::JSObject> js_object, i::Handle<i::Object> key, | 3556 i::Handle<i::JSObject> js_object, i::Handle<i::Object> key, |
| 3557 i::Handle<i::Object> value, i::PropertyAttributes attrs) { | 3557 i::Handle<i::Object> value, i::PropertyAttributes attrs) { |
| 3558 i::Isolate* isolate = js_object->GetIsolate(); | 3558 i::Isolate* isolate = js_object->GetIsolate(); |
| 3559 bool success = false; | 3559 bool success = false; |
| 3560 i::LookupIterator it = i::LookupIterator::PropertyOrElement( | 3560 i::LookupIterator it = i::LookupIterator::PropertyOrElement( |
| 3561 isolate, js_object, key, &success, i::LookupIterator::OWN); | 3561 isolate, js_object, key, &success, i::LookupIterator::OWN); |
| 3562 if (!success) return i::MaybeHandle<i::Object>(); | 3562 if (!success) return i::MaybeHandle<i::Object>(); |
| 3563 | 3563 |
| 3564 return i::JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, attrs); | 3564 return i::JSObject::DefineOwnPropertyIgnoreAttributes( |
| 3565 &it, value, attrs, i::JSObject::FORCE_FIELD); |
| 3565 } | 3566 } |
| 3566 | 3567 |
| 3567 | 3568 |
| 3568 Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context> context, | 3569 Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context> context, |
| 3569 v8::Local<Value> key, v8::Local<Value> value, | 3570 v8::Local<Value> key, v8::Local<Value> value, |
| 3570 v8::PropertyAttribute attribs) { | 3571 v8::PropertyAttribute attribs) { |
| 3571 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::ForceSet()", bool); | 3572 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::ForceSet()", bool); |
| 3572 auto self = i::Handle<i::JSObject>::cast(Utils::OpenHandle(this)); | 3573 auto self = i::Handle<i::JSObject>::cast(Utils::OpenHandle(this)); |
| 3573 auto key_obj = Utils::OpenHandle(*key); | 3574 auto key_obj = Utils::OpenHandle(*key); |
| 3574 auto value_obj = Utils::OpenHandle(*value); | 3575 auto value_obj = Utils::OpenHandle(*value); |
| (...skipping 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8557 Address callback_address = | 8558 Address callback_address = |
| 8558 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8559 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8559 VMState<EXTERNAL> state(isolate); | 8560 VMState<EXTERNAL> state(isolate); |
| 8560 ExternalCallbackScope call_scope(isolate, callback_address); | 8561 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8561 callback(info); | 8562 callback(info); |
| 8562 } | 8563 } |
| 8563 | 8564 |
| 8564 | 8565 |
| 8565 } // namespace internal | 8566 } // namespace internal |
| 8566 } // namespace v8 | 8567 } // namespace v8 |
| OLD | NEW |