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

Side by Side Diff: src/api.cc

Issue 660243: Small API improvements: (Closed)
Patch Set: Created 10 years, 10 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
« no previous file with comments | « include/v8.h ('k') | src/handles.h » ('j') | src/runtime.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 self, 1968 self,
1969 key_obj, 1969 key_obj,
1970 value_obj, 1970 value_obj,
1971 static_cast<PropertyAttributes>(attribs)); 1971 static_cast<PropertyAttributes>(attribs));
1972 has_pending_exception = obj.is_null(); 1972 has_pending_exception = obj.is_null();
1973 EXCEPTION_BAILOUT_CHECK(false); 1973 EXCEPTION_BAILOUT_CHECK(false);
1974 return true; 1974 return true;
1975 } 1975 }
1976 1976
1977 1977
1978 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) {
1979 ON_BAILOUT("v8::Object::Set()", return false);
1980 ENTER_V8;
1981 HandleScope scope;
1982 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
1983 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
1984 EXCEPTION_PREAMBLE();
1985 i::Handle<i::Object> obj = i::SetElement(
1986 self,
1987 index,
1988 value_obj);
1989 has_pending_exception = obj.is_null();
1990 EXCEPTION_BAILOUT_CHECK(false);
1991 return true;
1992 }
1993
1994
1978 bool v8::Object::ForceSet(v8::Handle<Value> key, 1995 bool v8::Object::ForceSet(v8::Handle<Value> key,
1979 v8::Handle<Value> value, 1996 v8::Handle<Value> value,
1980 v8::PropertyAttribute attribs) { 1997 v8::PropertyAttribute attribs) {
1981 ON_BAILOUT("v8::Object::ForceSet()", return false); 1998 ON_BAILOUT("v8::Object::ForceSet()", return false);
1982 ENTER_V8; 1999 ENTER_V8;
1983 HandleScope scope; 2000 HandleScope scope;
1984 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2001 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
1985 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); 2002 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
1986 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); 2003 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
1987 EXCEPTION_PREAMBLE(); 2004 EXCEPTION_PREAMBLE();
(...skipping 28 matching lines...) Expand all
2016 i::Handle<i::Object> self = Utils::OpenHandle(this); 2033 i::Handle<i::Object> self = Utils::OpenHandle(this);
2017 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); 2034 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
2018 EXCEPTION_PREAMBLE(); 2035 EXCEPTION_PREAMBLE();
2019 i::Handle<i::Object> result = i::GetProperty(self, key_obj); 2036 i::Handle<i::Object> result = i::GetProperty(self, key_obj);
2020 has_pending_exception = result.is_null(); 2037 has_pending_exception = result.is_null();
2021 EXCEPTION_BAILOUT_CHECK(Local<Value>()); 2038 EXCEPTION_BAILOUT_CHECK(Local<Value>());
2022 return Utils::ToLocal(result); 2039 return Utils::ToLocal(result);
2023 } 2040 }
2024 2041
2025 2042
2043 Local<Value> v8::Object::Get(uint32_t index) {
2044 ON_BAILOUT("v8::Object::Get()", return Local<v8::Value>());
2045 ENTER_V8;
2046 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2047 EXCEPTION_PREAMBLE();
2048 i::Handle<i::Object> result = i::GetElement(self, index);
2049 has_pending_exception = result.is_null();
2050 EXCEPTION_BAILOUT_CHECK(Local<Value>());
2051 return Utils::ToLocal(result);
2052 }
2053
2054
2026 Local<Value> v8::Object::GetPrototype() { 2055 Local<Value> v8::Object::GetPrototype() {
2027 ON_BAILOUT("v8::Object::GetPrototype()", return Local<v8::Value>()); 2056 ON_BAILOUT("v8::Object::GetPrototype()", return Local<v8::Value>());
2028 ENTER_V8; 2057 ENTER_V8;
2029 i::Handle<i::Object> self = Utils::OpenHandle(this); 2058 i::Handle<i::Object> self = Utils::OpenHandle(this);
2030 i::Handle<i::Object> result = i::GetPrototype(self); 2059 i::Handle<i::Object> result = i::GetPrototype(self);
2031 return Utils::ToLocal(result); 2060 return Utils::ToLocal(result);
2032 } 2061 }
2033 2062
2034 2063
2035 bool v8::Object::SetPrototype(Handle<Value> value) { 2064 bool v8::Object::SetPrototype(Handle<Value> value) {
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
3944 3973
3945 3974
3946 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3975 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3947 HandleScopeImplementer* thread_local = 3976 HandleScopeImplementer* thread_local =
3948 reinterpret_cast<HandleScopeImplementer*>(storage); 3977 reinterpret_cast<HandleScopeImplementer*>(storage);
3949 thread_local->IterateThis(v); 3978 thread_local->IterateThis(v);
3950 return storage + ArchiveSpacePerThread(); 3979 return storage + ArchiveSpacePerThread();
3951 } 3980 }
3952 3981
3953 } } // namespace v8::internal 3982 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/handles.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698