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