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

Side by Side Diff: src/api.cc

Issue 9008012: Move handlified functions from handles.cc to objects.cc (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More formatting fixes. Created 8 years, 11 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/bootstrapper.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 2732
2733 2733
2734 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) { 2734 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) {
2735 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 2735 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2736 ON_BAILOUT(isolate, "v8::Object::Set()", return false); 2736 ON_BAILOUT(isolate, "v8::Object::Set()", return false);
2737 ENTER_V8(isolate); 2737 ENTER_V8(isolate);
2738 i::HandleScope scope(isolate); 2738 i::HandleScope scope(isolate);
2739 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2739 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2740 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); 2740 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
2741 EXCEPTION_PREAMBLE(isolate); 2741 EXCEPTION_PREAMBLE(isolate);
2742 i::Handle<i::Object> obj = i::SetElement( 2742 i::Handle<i::Object> obj = i::JSObject::SetElement(
2743 self, 2743 self,
2744 index, 2744 index,
2745 value_obj, 2745 value_obj,
2746 i::kNonStrictMode); 2746 i::kNonStrictMode);
2747 has_pending_exception = obj.is_null(); 2747 has_pending_exception = obj.is_null();
2748 EXCEPTION_BAILOUT_CHECK(isolate, false); 2748 EXCEPTION_BAILOUT_CHECK(isolate, false);
2749 return true; 2749 return true;
2750 } 2750 }
2751 2751
2752 2752
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2838 return static_cast<PropertyAttribute>(result); 2838 return static_cast<PropertyAttribute>(result);
2839 } 2839 }
2840 2840
2841 2841
2842 Local<Value> v8::Object::GetPrototype() { 2842 Local<Value> v8::Object::GetPrototype() {
2843 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 2843 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2844 ON_BAILOUT(isolate, "v8::Object::GetPrototype()", 2844 ON_BAILOUT(isolate, "v8::Object::GetPrototype()",
2845 return Local<v8::Value>()); 2845 return Local<v8::Value>());
2846 ENTER_V8(isolate); 2846 ENTER_V8(isolate);
2847 i::Handle<i::Object> self = Utils::OpenHandle(this); 2847 i::Handle<i::Object> self = Utils::OpenHandle(this);
2848 i::Handle<i::Object> result = i::GetPrototype(self); 2848 i::Handle<i::Object> result(self->GetPrototype());
2849 return Utils::ToLocal(result); 2849 return Utils::ToLocal(result);
2850 } 2850 }
2851 2851
2852 2852
2853 bool v8::Object::SetPrototype(Handle<Value> value) { 2853 bool v8::Object::SetPrototype(Handle<Value> value) {
2854 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 2854 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2855 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false); 2855 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false);
2856 ENTER_V8(isolate); 2856 ENTER_V8(isolate);
2857 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2857 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2858 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); 2858 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2992 } 2992 }
2993 2993
2994 2994
2995 bool v8::Object::Delete(v8::Handle<String> key) { 2995 bool v8::Object::Delete(v8::Handle<String> key) {
2996 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 2996 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2997 ON_BAILOUT(isolate, "v8::Object::Delete()", return false); 2997 ON_BAILOUT(isolate, "v8::Object::Delete()", return false);
2998 ENTER_V8(isolate); 2998 ENTER_V8(isolate);
2999 i::HandleScope scope(isolate); 2999 i::HandleScope scope(isolate);
3000 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3000 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3001 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 3001 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
3002 return i::DeleteProperty(self, key_obj)->IsTrue(); 3002 return i::JSObject::DeleteProperty(self, key_obj)->IsTrue();
3003 } 3003 }
3004 3004
3005 3005
3006 bool v8::Object::Has(v8::Handle<String> key) { 3006 bool v8::Object::Has(v8::Handle<String> key) {
3007 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3007 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3008 ON_BAILOUT(isolate, "v8::Object::Has()", return false); 3008 ON_BAILOUT(isolate, "v8::Object::Has()", return false);
3009 ENTER_V8(isolate); 3009 ENTER_V8(isolate);
3010 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3010 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3011 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 3011 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
3012 return self->HasProperty(*key_obj); 3012 return self->HasProperty(*key_obj);
3013 } 3013 }
3014 3014
3015 3015
3016 bool v8::Object::Delete(uint32_t index) { 3016 bool v8::Object::Delete(uint32_t index) {
3017 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3017 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3018 ON_BAILOUT(isolate, "v8::Object::DeleteProperty()", 3018 ON_BAILOUT(isolate, "v8::Object::DeleteProperty()",
3019 return false); 3019 return false);
3020 ENTER_V8(isolate); 3020 ENTER_V8(isolate);
3021 HandleScope scope; 3021 HandleScope scope;
3022 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3022 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3023 return i::DeleteElement(self, index)->IsTrue(); 3023 return i::JSObject::DeleteElement(self, index)->IsTrue();
3024 } 3024 }
3025 3025
3026 3026
3027 bool v8::Object::Has(uint32_t index) { 3027 bool v8::Object::Has(uint32_t index) {
3028 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3028 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3029 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false); 3029 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false);
3030 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3030 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3031 return self->HasElement(index); 3031 return self->HasElement(index);
3032 } 3032 }
3033 3033
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
3218 return Utils::ToLocal(i::Handle<i::Context>(context)); 3218 return Utils::ToLocal(i::Handle<i::Context>(context));
3219 } 3219 }
3220 3220
3221 3221
3222 int v8::Object::GetIdentityHash() { 3222 int v8::Object::GetIdentityHash() {
3223 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3223 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3224 ON_BAILOUT(isolate, "v8::Object::GetIdentityHash()", return 0); 3224 ON_BAILOUT(isolate, "v8::Object::GetIdentityHash()", return 0);
3225 ENTER_V8(isolate); 3225 ENTER_V8(isolate);
3226 i::HandleScope scope(isolate); 3226 i::HandleScope scope(isolate);
3227 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3227 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3228 return i::GetIdentityHash(self); 3228 return i::JSObject::GetIdentityHash(self);
3229 } 3229 }
3230 3230
3231 3231
3232 bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key, 3232 bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key,
3233 v8::Handle<v8::Value> value) { 3233 v8::Handle<v8::Value> value) {
3234 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3234 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3235 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false); 3235 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false);
3236 ENTER_V8(isolate); 3236 ENTER_V8(isolate);
3237 i::HandleScope scope(isolate); 3237 i::HandleScope scope(isolate);
3238 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3238 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3239 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 3239 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
3240 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); 3240 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
3241 i::Handle<i::Object> result = i::SetHiddenProperty(self, key_obj, value_obj); 3241 i::Handle<i::Object> result =
3242 i::JSObject::SetHiddenProperty(self, key_obj, value_obj);
3242 return *result == *self; 3243 return *result == *self;
3243 } 3244 }
3244 3245
3245 3246
3246 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { 3247 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) {
3247 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3248 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3248 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()", 3249 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()",
3249 return Local<v8::Value>()); 3250 return Local<v8::Value>());
3250 ENTER_V8(isolate); 3251 ENTER_V8(isolate);
3251 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3252 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
(...skipping 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after
6147 6148
6148 6149
6149 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6150 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6150 HandleScopeImplementer* scope_implementer = 6151 HandleScopeImplementer* scope_implementer =
6151 reinterpret_cast<HandleScopeImplementer*>(storage); 6152 reinterpret_cast<HandleScopeImplementer*>(storage);
6152 scope_implementer->IterateThis(v); 6153 scope_implementer->IterateThis(v);
6153 return storage + ArchiveSpacePerThread(); 6154 return storage + ArchiveSpacePerThread();
6154 } 6155 }
6155 6156
6156 } } // namespace v8::internal 6157 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698