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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 isolate->eternal_handles()->Create(isolate, object, index); | 464 isolate->eternal_handles()->Create(isolate, object, index); |
465 } | 465 } |
466 | 466 |
467 | 467 |
468 Local<Value> V8::GetEternal(Isolate* v8_isolate, int index) { | 468 Local<Value> V8::GetEternal(Isolate* v8_isolate, int index) { |
469 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 469 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
470 return Utils::ToLocal(isolate->eternal_handles()->Get(index)); | 470 return Utils::ToLocal(isolate->eternal_handles()->Get(index)); |
471 } | 471 } |
472 | 472 |
473 | 473 |
| 474 void V8::CheckIsJust(bool is_just) { |
| 475 Utils::ApiCheck(is_just, "v8::FromJust", "Maybe value is Nothing."); |
| 476 } |
| 477 |
| 478 |
474 // --- H a n d l e s --- | 479 // --- H a n d l e s --- |
475 | 480 |
476 | 481 |
477 HandleScope::HandleScope(Isolate* isolate) { | 482 HandleScope::HandleScope(Isolate* isolate) { |
478 Initialize(isolate); | 483 Initialize(isolate); |
479 } | 484 } |
480 | 485 |
481 | 486 |
482 void HandleScope::Initialize(Isolate* isolate) { | 487 void HandleScope::Initialize(Isolate* isolate) { |
483 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 488 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2989 | 2994 |
2990 void v8::RegExp::CheckCast(v8::Value* that) { | 2995 void v8::RegExp::CheckCast(v8::Value* that) { |
2991 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2996 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2992 Utils::ApiCheck(obj->IsJSRegExp(), | 2997 Utils::ApiCheck(obj->IsJSRegExp(), |
2993 "v8::RegExp::Cast()", | 2998 "v8::RegExp::Cast()", |
2994 "Could not convert to regular expression"); | 2999 "Could not convert to regular expression"); |
2995 } | 3000 } |
2996 | 3001 |
2997 | 3002 |
2998 Maybe<bool> Value::BooleanValue(Local<Context> context) const { | 3003 Maybe<bool> Value::BooleanValue(Local<Context> context) const { |
2999 return maybe(Utils::OpenHandle(this)->BooleanValue()); | 3004 return Just(Utils::OpenHandle(this)->BooleanValue()); |
3000 } | 3005 } |
3001 | 3006 |
3002 | 3007 |
3003 bool Value::BooleanValue() const { | 3008 bool Value::BooleanValue() const { |
3004 return Utils::OpenHandle(this)->BooleanValue(); | 3009 return Utils::OpenHandle(this)->BooleanValue(); |
3005 } | 3010 } |
3006 | 3011 |
3007 | 3012 |
3008 Maybe<double> Value::NumberValue(Local<Context> context) const { | 3013 Maybe<double> Value::NumberValue(Local<Context> context) const { |
3009 auto obj = Utils::OpenHandle(this); | 3014 auto obj = Utils::OpenHandle(this); |
3010 if (obj->IsNumber()) return maybe(obj->Number()); | 3015 if (obj->IsNumber()) return Just(obj->Number()); |
3011 CONTEXT_SCOPE_GET_ISOLATE(context, "NumberValue"); | 3016 CONTEXT_SCOPE_GET_ISOLATE(context, "NumberValue"); |
3012 EXCEPTION_PREAMBLE(isolate); | 3017 EXCEPTION_PREAMBLE(isolate); |
3013 i::Handle<i::Object> num; | 3018 i::Handle<i::Object> num; |
3014 has_pending_exception = !i::Execution::ToNumber(isolate, obj).ToHandle(&num); | 3019 has_pending_exception = !i::Execution::ToNumber(isolate, obj).ToHandle(&num); |
3015 EXCEPTION_BAILOUT_CHECK(isolate, Maybe<double>()); | 3020 EXCEPTION_BAILOUT_CHECK(isolate, Nothing<double>()); |
3016 return maybe(num->Number()); | 3021 return Just(num->Number()); |
3017 } | 3022 } |
3018 | 3023 |
3019 | 3024 |
3020 double Value::NumberValue() const { | 3025 double Value::NumberValue() const { |
3021 auto obj = Utils::OpenHandle(this); | 3026 auto obj = Utils::OpenHandle(this); |
3022 if (obj->IsNumber()) return obj->Number(); | 3027 if (obj->IsNumber()) return obj->Number(); |
3023 return NumberValue(ContextFromHeapObject(obj)) | 3028 return NumberValue(ContextFromHeapObject(obj)) |
3024 .From(std::numeric_limits<double>::quiet_NaN()); | 3029 .FromMaybe(std::numeric_limits<double>::quiet_NaN()); |
3025 } | 3030 } |
3026 | 3031 |
3027 | 3032 |
3028 Maybe<int64_t> Value::IntegerValue(Local<Context> context) const { | 3033 Maybe<int64_t> Value::IntegerValue(Local<Context> context) const { |
3029 auto obj = Utils::OpenHandle(this); | 3034 auto obj = Utils::OpenHandle(this); |
3030 i::Handle<i::Object> num; | 3035 i::Handle<i::Object> num; |
3031 if (obj->IsNumber()) { | 3036 if (obj->IsNumber()) { |
3032 num = obj; | 3037 num = obj; |
3033 } else { | 3038 } else { |
3034 CONTEXT_SCOPE_GET_ISOLATE(context, "IntegerValue"); | 3039 CONTEXT_SCOPE_GET_ISOLATE(context, "IntegerValue"); |
3035 EXCEPTION_PREAMBLE(isolate); | 3040 EXCEPTION_PREAMBLE(isolate); |
3036 has_pending_exception = | 3041 has_pending_exception = |
3037 !i::Execution::ToInteger(isolate, obj).ToHandle(&num); | 3042 !i::Execution::ToInteger(isolate, obj).ToHandle(&num); |
3038 EXCEPTION_BAILOUT_CHECK(isolate, Maybe<int64_t>()); | 3043 EXCEPTION_BAILOUT_CHECK(isolate, Nothing<int64_t>()); |
3039 } | 3044 } |
3040 if (num->IsSmi()) { | 3045 return Just(num->IsSmi() ? static_cast<int64_t>(i::Smi::cast(*num)->value()) |
3041 return maybe(static_cast<int64_t>(i::Smi::cast(*num)->value())); | 3046 : static_cast<int64_t>(num->Number())); |
3042 } else { | |
3043 return maybe(static_cast<int64_t>(num->Number())); | |
3044 } | |
3045 } | 3047 } |
3046 | 3048 |
3047 | 3049 |
3048 int64_t Value::IntegerValue() const { | 3050 int64_t Value::IntegerValue() const { |
3049 auto obj = Utils::OpenHandle(this); | 3051 auto obj = Utils::OpenHandle(this); |
3050 if (obj->IsNumber()) { | 3052 if (obj->IsNumber()) { |
3051 if (obj->IsSmi()) { | 3053 if (obj->IsSmi()) { |
3052 return i::Smi::cast(*obj)->value(); | 3054 return i::Smi::cast(*obj)->value(); |
3053 } else { | 3055 } else { |
3054 return static_cast<int64_t>(obj->Number()); | 3056 return static_cast<int64_t>(obj->Number()); |
3055 } | 3057 } |
3056 } | 3058 } |
3057 return IntegerValue(ContextFromHeapObject(obj)).From(0); | 3059 return IntegerValue(ContextFromHeapObject(obj)).FromMaybe(0); |
3058 } | 3060 } |
3059 | 3061 |
3060 | 3062 |
3061 Maybe<int32_t> Value::Int32Value(Local<Context> context) const { | 3063 Maybe<int32_t> Value::Int32Value(Local<Context> context) const { |
3062 auto obj = Utils::OpenHandle(this); | 3064 auto obj = Utils::OpenHandle(this); |
3063 if (obj->IsNumber()) return maybe(NumberToInt32(*obj)); | 3065 if (obj->IsNumber()) return Just(NumberToInt32(*obj)); |
3064 CONTEXT_SCOPE_GET_ISOLATE(context, "Int32Value"); | 3066 CONTEXT_SCOPE_GET_ISOLATE(context, "Int32Value"); |
3065 EXCEPTION_PREAMBLE(isolate); | 3067 EXCEPTION_PREAMBLE(isolate); |
3066 i::Handle<i::Object> num; | 3068 i::Handle<i::Object> num; |
3067 has_pending_exception = !i::Execution::ToInt32(isolate, obj).ToHandle(&num); | 3069 has_pending_exception = !i::Execution::ToInt32(isolate, obj).ToHandle(&num); |
3068 EXCEPTION_BAILOUT_CHECK(isolate, Maybe<int32_t>()); | 3070 EXCEPTION_BAILOUT_CHECK(isolate, Nothing<int32_t>()); |
3069 if (num->IsSmi()) { | 3071 return Just(num->IsSmi() ? i::Smi::cast(*num)->value() |
3070 return maybe(i::Smi::cast(*num)->value()); | 3072 : static_cast<int32_t>(num->Number())); |
3071 } else { | |
3072 return maybe(static_cast<int32_t>(num->Number())); | |
3073 } | |
3074 } | 3073 } |
3075 | 3074 |
3076 | 3075 |
3077 int32_t Value::Int32Value() const { | 3076 int32_t Value::Int32Value() const { |
3078 auto obj = Utils::OpenHandle(this); | 3077 auto obj = Utils::OpenHandle(this); |
3079 if (obj->IsNumber()) return NumberToInt32(*obj); | 3078 if (obj->IsNumber()) return NumberToInt32(*obj); |
3080 return Int32Value(ContextFromHeapObject(obj)).From(0); | 3079 return Int32Value(ContextFromHeapObject(obj)).FromMaybe(0); |
3081 } | 3080 } |
3082 | 3081 |
3083 | 3082 |
3084 Maybe<uint32_t> Value::Uint32Value(Local<Context> context) const { | 3083 Maybe<uint32_t> Value::Uint32Value(Local<Context> context) const { |
3085 auto obj = Utils::OpenHandle(this); | 3084 auto obj = Utils::OpenHandle(this); |
3086 if (obj->IsNumber()) return maybe(NumberToUint32(*obj)); | 3085 if (obj->IsNumber()) return Just(NumberToUint32(*obj)); |
3087 CONTEXT_SCOPE_GET_ISOLATE(context, "Uint32Value"); | 3086 CONTEXT_SCOPE_GET_ISOLATE(context, "Uint32Value"); |
3088 EXCEPTION_PREAMBLE(isolate); | 3087 EXCEPTION_PREAMBLE(isolate); |
3089 i::Handle<i::Object> num; | 3088 i::Handle<i::Object> num; |
3090 has_pending_exception = !i::Execution::ToUint32(isolate, obj).ToHandle(&num); | 3089 has_pending_exception = !i::Execution::ToUint32(isolate, obj).ToHandle(&num); |
3091 EXCEPTION_BAILOUT_CHECK(isolate, Maybe<uint32_t>()); | 3090 EXCEPTION_BAILOUT_CHECK(isolate, Nothing<uint32_t>()); |
3092 if (num->IsSmi()) { | 3091 return Just(num->IsSmi() ? static_cast<uint32_t>(i::Smi::cast(*num)->value()) |
3093 return maybe(static_cast<uint32_t>(i::Smi::cast(*num)->value())); | 3092 : static_cast<uint32_t>(num->Number())); |
3094 } else { | |
3095 return maybe(static_cast<uint32_t>(num->Number())); | |
3096 } | |
3097 } | 3093 } |
3098 | 3094 |
3099 | 3095 |
3100 uint32_t Value::Uint32Value() const { | 3096 uint32_t Value::Uint32Value() const { |
3101 auto obj = Utils::OpenHandle(this); | 3097 auto obj = Utils::OpenHandle(this); |
3102 if (obj->IsNumber()) return NumberToUint32(*obj); | 3098 if (obj->IsNumber()) return NumberToUint32(*obj); |
3103 return Uint32Value(ContextFromHeapObject(obj)).From(0); | 3099 return Uint32Value(ContextFromHeapObject(obj)).FromMaybe(0); |
3104 } | 3100 } |
3105 | 3101 |
3106 | 3102 |
3107 Local<Uint32> Value::ToArrayIndex() const { | 3103 Local<Uint32> Value::ToArrayIndex() const { |
3108 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 3104 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
3109 if (obj->IsSmi()) { | 3105 if (obj->IsSmi()) { |
3110 if (i::Smi::cast(*obj)->value() >= 0) return Utils::Uint32ToLocal(obj); | 3106 if (i::Smi::cast(*obj)->value() >= 0) return Utils::Uint32ToLocal(obj); |
3111 return Local<Uint32>(); | 3107 return Local<Uint32>(); |
3112 } | 3108 } |
3113 i::Isolate* isolate = i::HeapObject::cast(*obj)->GetIsolate(); | 3109 i::Isolate* isolate = i::HeapObject::cast(*obj)->GetIsolate(); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3582 } | 3578 } |
3583 | 3579 |
3584 | 3580 |
3585 bool v8::Object::Has(v8::Handle<Value> key) { | 3581 bool v8::Object::Has(v8::Handle<Value> key) { |
3586 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3582 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3587 ON_BAILOUT(isolate, "v8::Object::Has()", return false); | 3583 ON_BAILOUT(isolate, "v8::Object::Has()", return false); |
3588 ENTER_V8(isolate); | 3584 ENTER_V8(isolate); |
3589 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); | 3585 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); |
3590 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); | 3586 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
3591 EXCEPTION_PREAMBLE(isolate); | 3587 EXCEPTION_PREAMBLE(isolate); |
3592 Maybe<bool> maybe; | 3588 Maybe<bool> maybe = Nothing<bool>(); |
3593 // Check if the given key is an array index. | 3589 // Check if the given key is an array index. |
3594 uint32_t index; | 3590 uint32_t index; |
3595 if (key_obj->ToArrayIndex(&index)) { | 3591 if (key_obj->ToArrayIndex(&index)) { |
3596 maybe = i::JSReceiver::HasElement(self, index); | 3592 maybe = i::JSReceiver::HasElement(self, index); |
3597 } else { | 3593 } else { |
3598 // Convert the key to a name - possibly by calling back into JavaScript. | 3594 // Convert the key to a name - possibly by calling back into JavaScript. |
3599 i::Handle<i::Name> name; | 3595 i::Handle<i::Name> name; |
3600 if (i::Runtime::ToName(isolate, key_obj).ToHandle(&name)) { | 3596 if (i::Runtime::ToName(isolate, key_obj).ToHandle(&name)) { |
3601 maybe = i::JSReceiver::HasProperty(self, name); | 3597 maybe = i::JSReceiver::HasProperty(self, name); |
3602 } | 3598 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3796 EXCEPTION_BAILOUT_CHECK(it->isolate(), Local<Value>()); | 3792 EXCEPTION_BAILOUT_CHECK(it->isolate(), Local<Value>()); |
3797 | 3793 |
3798 if (it->IsFound()) return Utils::ToLocal(result); | 3794 if (it->IsFound()) return Utils::ToLocal(result); |
3799 return Local<Value>(); | 3795 return Local<Value>(); |
3800 } | 3796 } |
3801 | 3797 |
3802 | 3798 |
3803 static Maybe<PropertyAttribute> GetPropertyAttributesByLookup( | 3799 static Maybe<PropertyAttribute> GetPropertyAttributesByLookup( |
3804 i::LookupIterator* it) { | 3800 i::LookupIterator* it) { |
3805 Maybe<PropertyAttributes> attr = i::JSReceiver::GetPropertyAttributes(it); | 3801 Maybe<PropertyAttributes> attr = i::JSReceiver::GetPropertyAttributes(it); |
3806 if (!it->IsFound()) return Maybe<PropertyAttribute>(); | 3802 return it->IsFound() ? Just<PropertyAttribute>( |
3807 return Maybe<PropertyAttribute>(static_cast<PropertyAttribute>(attr.value)); | 3803 static_cast<PropertyAttribute>(attr.value)) |
| 3804 : Nothing<PropertyAttribute>(); |
3808 } | 3805 } |
3809 | 3806 |
3810 | 3807 |
3811 Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain( | 3808 Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain( |
3812 Handle<String> key) { | 3809 Handle<String> key) { |
3813 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3810 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3814 ON_BAILOUT(isolate, | 3811 ON_BAILOUT(isolate, |
3815 "v8::Object::GetRealNamedPropertyInPrototypeChain()", | 3812 "v8::Object::GetRealNamedPropertyInPrototypeChain()", |
3816 return Local<Value>()); | 3813 return Local<Value>()); |
3817 ENTER_V8(isolate); | 3814 ENTER_V8(isolate); |
3818 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); | 3815 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); |
3819 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3816 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3820 i::PrototypeIterator iter(isolate, self_obj); | 3817 i::PrototypeIterator iter(isolate, self_obj); |
3821 if (iter.IsAtEnd()) return Local<Value>(); | 3818 if (iter.IsAtEnd()) return Local<Value>(); |
3822 i::Handle<i::Object> proto = i::PrototypeIterator::GetCurrent(iter); | 3819 i::Handle<i::Object> proto = i::PrototypeIterator::GetCurrent(iter); |
3823 i::LookupIterator it(self_obj, key_obj, i::Handle<i::JSReceiver>::cast(proto), | 3820 i::LookupIterator it(self_obj, key_obj, i::Handle<i::JSReceiver>::cast(proto), |
3824 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 3821 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
3825 return GetPropertyByLookup(&it); | 3822 return GetPropertyByLookup(&it); |
3826 } | 3823 } |
3827 | 3824 |
3828 | 3825 |
3829 Maybe<PropertyAttribute> | 3826 Maybe<PropertyAttribute> |
3830 v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle<String> key) { | 3827 v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle<String> key) { |
3831 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3828 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3832 ON_BAILOUT(isolate, | 3829 ON_BAILOUT(isolate, |
3833 "v8::Object::GetRealNamedPropertyAttributesInPrototypeChain()", | 3830 "v8::Object::GetRealNamedPropertyAttributesInPrototypeChain()", |
3834 return Maybe<PropertyAttribute>()); | 3831 return Nothing<PropertyAttribute>()); |
3835 ENTER_V8(isolate); | 3832 ENTER_V8(isolate); |
3836 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); | 3833 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); |
3837 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3834 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3838 i::PrototypeIterator iter(isolate, self_obj); | 3835 i::PrototypeIterator iter(isolate, self_obj); |
3839 if (iter.IsAtEnd()) return Maybe<PropertyAttribute>(); | 3836 if (iter.IsAtEnd()) return Nothing<PropertyAttribute>(); |
3840 i::Handle<i::Object> proto = i::PrototypeIterator::GetCurrent(iter); | 3837 i::Handle<i::Object> proto = i::PrototypeIterator::GetCurrent(iter); |
3841 i::LookupIterator it(self_obj, key_obj, i::Handle<i::JSReceiver>::cast(proto), | 3838 i::LookupIterator it(self_obj, key_obj, i::Handle<i::JSReceiver>::cast(proto), |
3842 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 3839 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
3843 return GetPropertyAttributesByLookup(&it); | 3840 return GetPropertyAttributesByLookup(&it); |
3844 } | 3841 } |
3845 | 3842 |
3846 | 3843 |
3847 Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) { | 3844 Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) { |
3848 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3845 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3849 ON_BAILOUT(isolate, "v8::Object::GetRealNamedProperty()", | 3846 ON_BAILOUT(isolate, "v8::Object::GetRealNamedProperty()", |
3850 return Local<Value>()); | 3847 return Local<Value>()); |
3851 ENTER_V8(isolate); | 3848 ENTER_V8(isolate); |
3852 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); | 3849 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); |
3853 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3850 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3854 i::LookupIterator it(self_obj, key_obj, | 3851 i::LookupIterator it(self_obj, key_obj, |
3855 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 3852 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
3856 return GetPropertyByLookup(&it); | 3853 return GetPropertyByLookup(&it); |
3857 } | 3854 } |
3858 | 3855 |
3859 | 3856 |
3860 Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes( | 3857 Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes( |
3861 Handle<String> key) { | 3858 Handle<String> key) { |
3862 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3859 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3863 ON_BAILOUT(isolate, "v8::Object::GetRealNamedPropertyAttributes()", | 3860 ON_BAILOUT(isolate, "v8::Object::GetRealNamedPropertyAttributes()", |
3864 return Maybe<PropertyAttribute>()); | 3861 return Nothing<PropertyAttribute>()); |
3865 ENTER_V8(isolate); | 3862 ENTER_V8(isolate); |
3866 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); | 3863 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); |
3867 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3864 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3868 i::LookupIterator it(self_obj, key_obj, | 3865 i::LookupIterator it(self_obj, key_obj, |
3869 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 3866 i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
3870 return GetPropertyAttributesByLookup(&it); | 3867 return GetPropertyAttributesByLookup(&it); |
3871 } | 3868 } |
3872 | 3869 |
3873 | 3870 |
3874 // Turns on access checks by copying the map and setting the check flag. | 3871 // Turns on access checks by copying the map and setting the check flag. |
(...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7872 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7869 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7873 Address callback_address = | 7870 Address callback_address = |
7874 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7871 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7875 VMState<EXTERNAL> state(isolate); | 7872 VMState<EXTERNAL> state(isolate); |
7876 ExternalCallbackScope call_scope(isolate, callback_address); | 7873 ExternalCallbackScope call_scope(isolate, callback_address); |
7877 callback(info); | 7874 callback(info); |
7878 } | 7875 } |
7879 | 7876 |
7880 | 7877 |
7881 } } // namespace v8::internal | 7878 } } // namespace v8::internal |
OLD | NEW |