| 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 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3629 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3629 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3630 ON_BAILOUT(isolate, | 3630 ON_BAILOUT(isolate, |
| 3631 "v8::Object::GetRealNamedPropertyInPrototypeChain()", | 3631 "v8::Object::GetRealNamedPropertyInPrototypeChain()", |
| 3632 return Local<Value>()); | 3632 return Local<Value>()); |
| 3633 ENTER_V8(isolate); | 3633 ENTER_V8(isolate); |
| 3634 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); | 3634 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); |
| 3635 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3635 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
| 3636 i::PrototypeIterator iter(isolate, self_obj); | 3636 i::PrototypeIterator iter(isolate, self_obj); |
| 3637 if (iter.IsAtEnd()) return Local<Value>(); | 3637 if (iter.IsAtEnd()) return Local<Value>(); |
| 3638 i::LookupIterator it(i::PrototypeIterator::GetCurrent(iter), key_obj, | 3638 i::LookupIterator it(i::PrototypeIterator::GetCurrent(iter), key_obj, |
| 3639 i::LookupIterator::CHECK_DERIVED_PROPERTY); | 3639 i::LookupIterator::PROTOTYPE_CHAIN_PROPERTY); |
| 3640 return GetPropertyByLookup(&it); | 3640 return GetPropertyByLookup(&it); |
| 3641 } | 3641 } |
| 3642 | 3642 |
| 3643 | 3643 |
| 3644 Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) { | 3644 Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) { |
| 3645 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3645 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3646 ON_BAILOUT(isolate, "v8::Object::GetRealNamedProperty()", | 3646 ON_BAILOUT(isolate, "v8::Object::GetRealNamedProperty()", |
| 3647 return Local<Value>()); | 3647 return Local<Value>()); |
| 3648 ENTER_V8(isolate); | 3648 ENTER_V8(isolate); |
| 3649 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); | 3649 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); |
| 3650 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3650 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
| 3651 i::LookupIterator it(self_obj, key_obj, | 3651 i::LookupIterator it(self_obj, key_obj, |
| 3652 i::LookupIterator::CHECK_DERIVED_PROPERTY); | 3652 i::LookupIterator::PROTOTYPE_CHAIN_PROPERTY); |
| 3653 return GetPropertyByLookup(&it); | 3653 return GetPropertyByLookup(&it); |
| 3654 } | 3654 } |
| 3655 | 3655 |
| 3656 | 3656 |
| 3657 // Turns on access checks by copying the map and setting the check flag. | 3657 // Turns on access checks by copying the map and setting the check flag. |
| 3658 // Because the object gets a new map, existing inline cache caching | 3658 // Because the object gets a new map, existing inline cache caching |
| 3659 // the old map of this object will fail. | 3659 // the old map of this object will fail. |
| 3660 void v8::Object::TurnOnAccessCheck() { | 3660 void v8::Object::TurnOnAccessCheck() { |
| 3661 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3661 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 3662 ON_BAILOUT(isolate, "v8::Object::TurnOnAccessCheck()", return); | 3662 ON_BAILOUT(isolate, "v8::Object::TurnOnAccessCheck()", return); |
| (...skipping 4040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7703 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7703 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7704 Address callback_address = | 7704 Address callback_address = |
| 7705 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7705 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7706 VMState<EXTERNAL> state(isolate); | 7706 VMState<EXTERNAL> state(isolate); |
| 7707 ExternalCallbackScope call_scope(isolate, callback_address); | 7707 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7708 callback(info); | 7708 callback(info); |
| 7709 } | 7709 } |
| 7710 | 7710 |
| 7711 | 7711 |
| 7712 } } // namespace v8::internal | 7712 } } // namespace v8::internal |
| OLD | NEW |