Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: src/api.cc

Issue 23496058: Handlify JSReceiver::HasProperty and friends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 2049
2050 2050
2051 v8::Local<Value> v8::TryCatch::StackTrace() const { 2051 v8::Local<Value> v8::TryCatch::StackTrace() const {
2052 ASSERT(isolate_ == i::Isolate::Current()); 2052 ASSERT(isolate_ == i::Isolate::Current());
2053 if (HasCaught()) { 2053 if (HasCaught()) {
2054 i::Object* raw_obj = reinterpret_cast<i::Object*>(exception_); 2054 i::Object* raw_obj = reinterpret_cast<i::Object*>(exception_);
2055 if (!raw_obj->IsJSObject()) return v8::Local<Value>(); 2055 if (!raw_obj->IsJSObject()) return v8::Local<Value>();
2056 i::HandleScope scope(isolate_); 2056 i::HandleScope scope(isolate_);
2057 i::Handle<i::JSObject> obj(i::JSObject::cast(raw_obj), isolate_); 2057 i::Handle<i::JSObject> obj(i::JSObject::cast(raw_obj), isolate_);
2058 i::Handle<i::String> name = isolate_->factory()->stack_string(); 2058 i::Handle<i::String> name = isolate_->factory()->stack_string();
2059 if (!obj->HasProperty(*name)) return v8::Local<Value>(); 2059 if (!i::JSReceiver::HasProperty(obj, name)) return v8::Local<Value>();
2060 i::Handle<i::Object> value = i::GetProperty(isolate_, obj, name); 2060 i::Handle<i::Object> value = i::GetProperty(isolate_, obj, name);
2061 if (value.is_null()) return v8::Local<Value>(); 2061 if (value.is_null()) return v8::Local<Value>();
2062 return v8::Utils::ToLocal(scope.CloseAndEscape(value)); 2062 return v8::Utils::ToLocal(scope.CloseAndEscape(value));
2063 } else { 2063 } else {
2064 return v8::Local<Value>(); 2064 return v8::Local<Value>();
2065 } 2065 }
2066 } 2066 }
2067 2067
2068 2068
2069 v8::Local<v8::Message> v8::TryCatch::Message() const { 2069 v8::Local<v8::Message> v8::TryCatch::Message() const {
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
3618 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); 3618 HandleScope scope(reinterpret_cast<Isolate*>(isolate));
3619 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3619 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3620 return i::JSReceiver::DeleteElement(self, index)->IsTrue(); 3620 return i::JSReceiver::DeleteElement(self, index)->IsTrue();
3621 } 3621 }
3622 3622
3623 3623
3624 bool v8::Object::Has(uint32_t index) { 3624 bool v8::Object::Has(uint32_t index) {
3625 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3625 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3626 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false); 3626 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false);
3627 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3627 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3628 return self->HasElement(index); 3628 return i::JSReceiver::HasElement(self, index);
3629 } 3629 }
3630 3630
3631 3631
3632 template<typename Setter, typename Getter, typename Data> 3632 template<typename Setter, typename Getter, typename Data>
3633 static inline bool ObjectSetAccessor(Object* obj, 3633 static inline bool ObjectSetAccessor(Object* obj,
3634 Handle<String> name, 3634 Handle<String> name,
3635 Setter getter, 3635 Setter getter,
3636 Getter setter, 3636 Getter setter,
3637 Data data, 3637 Data data,
3638 AccessControl settings, 3638 AccessControl settings,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
3672 void* null = NULL; 3672 void* null = NULL;
3673 return ObjectSetAccessor( 3673 return ObjectSetAccessor(
3674 this, name, descriptor, null, null, settings, attributes); 3674 this, name, descriptor, null, null, settings, attributes);
3675 } 3675 }
3676 3676
3677 3677
3678 bool v8::Object::HasOwnProperty(Handle<String> key) { 3678 bool v8::Object::HasOwnProperty(Handle<String> key) {
3679 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3679 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3680 ON_BAILOUT(isolate, "v8::Object::HasOwnProperty()", 3680 ON_BAILOUT(isolate, "v8::Object::HasOwnProperty()",
3681 return false); 3681 return false);
3682 return Utils::OpenHandle(this)->HasLocalProperty( 3682 return i::JSReceiver::HasLocalProperty(
3683 *Utils::OpenHandle(*key)); 3683 Utils::OpenHandle(this), Utils::OpenHandle(*key));
3684 } 3684 }
3685 3685
3686 3686
3687 bool v8::Object::HasRealNamedProperty(Handle<String> key) { 3687 bool v8::Object::HasRealNamedProperty(Handle<String> key) {
3688 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3688 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3689 ON_BAILOUT(isolate, "v8::Object::HasRealNamedProperty()", 3689 ON_BAILOUT(isolate, "v8::Object::HasRealNamedProperty()",
3690 return false); 3690 return false);
3691 return Utils::OpenHandle(this)->HasRealNamedProperty( 3691 return Utils::OpenHandle(this)->HasRealNamedProperty(
3692 isolate, 3692 isolate,
3693 *Utils::OpenHandle(*key)); 3693 *Utils::OpenHandle(*key));
(...skipping 4170 matching lines...) Expand 10 before | Expand all | Expand 10 after
7864 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7864 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7865 Address callback_address = 7865 Address callback_address =
7866 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7866 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7867 VMState<EXTERNAL> state(isolate); 7867 VMState<EXTERNAL> state(isolate);
7868 ExternalCallbackScope call_scope(isolate, callback_address); 7868 ExternalCallbackScope call_scope(isolate, callback_address);
7869 callback(info); 7869 callback(info);
7870 } 7870 }
7871 7871
7872 7872
7873 } } // namespace v8::internal 7873 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698