OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3928 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { | 3928 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { |
3929 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3929 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3930 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()", | 3930 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()", |
3931 return Local<v8::Value>()); | 3931 return Local<v8::Value>()); |
3932 ENTER_V8(isolate); | 3932 ENTER_V8(isolate); |
3933 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3933 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3934 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3934 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3935 i::Handle<i::String> key_string = | 3935 i::Handle<i::String> key_string = |
3936 isolate->factory()->InternalizeString(key_obj); | 3936 isolate->factory()->InternalizeString(key_obj); |
3937 i::Handle<i::Object> result(self->GetHiddenProperty(*key_string), isolate); | 3937 i::Handle<i::Object> result(self->GetHiddenProperty(*key_string), isolate); |
3938 if (result->IsUndefined()) return v8::Local<v8::Value>(); | 3938 if (result->IsTheHole()) return v8::Local<v8::Value>(); |
3939 return Utils::ToLocal(result); | 3939 return Utils::ToLocal(result); |
3940 } | 3940 } |
3941 | 3941 |
3942 | 3942 |
3943 bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) { | 3943 bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) { |
3944 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3944 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3945 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false); | 3945 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false); |
3946 ENTER_V8(isolate); | 3946 ENTER_V8(isolate); |
3947 i::HandleScope scope(isolate); | 3947 i::HandleScope scope(isolate); |
3948 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3948 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
(...skipping 4042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7991 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7991 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7992 Address callback_address = | 7992 Address callback_address = |
7993 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7993 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7994 VMState<EXTERNAL> state(isolate); | 7994 VMState<EXTERNAL> state(isolate); |
7995 ExternalCallbackScope call_scope(isolate, callback_address); | 7995 ExternalCallbackScope call_scope(isolate, callback_address); |
7996 return callback(info); | 7996 return callback(info); |
7997 } | 7997 } |
7998 | 7998 |
7999 | 7999 |
8000 } } // namespace v8::internal | 8000 } } // namespace v8::internal |
OLD | NEW |