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

Side by Side Diff: src/api.cc

Issue 88026: Added ForceSet on objects (Closed)
Patch Set: Added docs for ForceSet Created 11 years, 8 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 self, 1828 self,
1829 key_obj, 1829 key_obj,
1830 value_obj, 1830 value_obj,
1831 static_cast<PropertyAttributes>(attribs)); 1831 static_cast<PropertyAttributes>(attribs));
1832 has_pending_exception = obj.is_null(); 1832 has_pending_exception = obj.is_null();
1833 EXCEPTION_BAILOUT_CHECK(false); 1833 EXCEPTION_BAILOUT_CHECK(false);
1834 return true; 1834 return true;
1835 } 1835 }
1836 1836
1837 1837
1838 bool v8::Object::ForceSet(v8::Handle<Value> key,
1839 v8::Handle<Value> value,
1840 v8::PropertyAttribute attribs) {
1841 ON_BAILOUT("v8::Object::ForceSet()", return false);
1842 ENTER_V8;
1843 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
1844 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
1845 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
1846 EXCEPTION_PREAMBLE();
1847 i::Handle<i::Object> obj = i::ForceSetProperty(
1848 self,
1849 key_obj,
1850 value_obj,
1851 static_cast<PropertyAttributes>(attribs));
1852 has_pending_exception = obj.is_null();
1853 EXCEPTION_BAILOUT_CHECK(false);
1854 return true;
1855 }
1856
1857
1838 Local<Value> v8::Object::Get(v8::Handle<Value> key) { 1858 Local<Value> v8::Object::Get(v8::Handle<Value> key) {
1839 ON_BAILOUT("v8::Object::Get()", return Local<v8::Value>()); 1859 ON_BAILOUT("v8::Object::Get()", return Local<v8::Value>());
1840 ENTER_V8; 1860 ENTER_V8;
1841 i::Handle<i::Object> self = Utils::OpenHandle(this); 1861 i::Handle<i::Object> self = Utils::OpenHandle(this);
1842 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); 1862 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
1843 EXCEPTION_PREAMBLE(); 1863 EXCEPTION_PREAMBLE();
1844 i::Handle<i::Object> result = i::GetProperty(self, key_obj); 1864 i::Handle<i::Object> result = i::GetProperty(self, key_obj);
1845 has_pending_exception = result.is_null(); 1865 has_pending_exception = result.is_null();
1846 EXCEPTION_BAILOUT_CHECK(Local<Value>()); 1866 EXCEPTION_BAILOUT_CHECK(Local<Value>());
1847 return Utils::ToLocal(result); 1867 return Utils::ToLocal(result);
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
3368 reinterpret_cast<HandleScopeImplementer*>(storage); 3388 reinterpret_cast<HandleScopeImplementer*>(storage);
3369 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); 3389 List<void**>* blocks_of_archived_thread = thread_local->Blocks();
3370 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = 3390 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread =
3371 &thread_local->handle_scope_data_; 3391 &thread_local->handle_scope_data_;
3372 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); 3392 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread);
3373 3393
3374 return storage + ArchiveSpacePerThread(); 3394 return storage + ArchiveSpacePerThread();
3375 } 3395 }
3376 3396
3377 } } // namespace v8::internal 3397 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698