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

Side by Side Diff: src/api.cc

Issue 9716035: Make setting of accessors even more atomic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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') | src/objects.h » ('J')
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 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 AccessControl settings, 3058 AccessControl settings,
3059 PropertyAttribute attributes) { 3059 PropertyAttribute attributes) {
3060 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3060 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3061 ON_BAILOUT(isolate, "v8::Object::SetAccessor()", return false); 3061 ON_BAILOUT(isolate, "v8::Object::SetAccessor()", return false);
3062 ENTER_V8(isolate); 3062 ENTER_V8(isolate);
3063 i::HandleScope scope(isolate); 3063 i::HandleScope scope(isolate);
3064 i::Handle<i::AccessorInfo> info = MakeAccessorInfo(name, 3064 i::Handle<i::AccessorInfo> info = MakeAccessorInfo(name,
3065 getter, setter, data, 3065 getter, setter, data,
3066 settings, attributes); 3066 settings, attributes);
3067 i::Handle<i::Object> result = i::SetAccessor(Utils::OpenHandle(this), info); 3067 i::Handle<i::Object> result = i::SetAccessor(Utils::OpenHandle(this), info);
3068 return !result.is_null() && !result->IsUndefined(); 3068 if (result.is_null() || result->IsUndefined()) return false;
3069 i::JSObject::TransformToFastProperties(Utils::OpenHandle(this), 0);
Michael Starzinger 2012/03/21 12:33:08 It would be nice not to have this code duplicated
Sven Panne 2012/03/21 13:14:18 Well, C++'s abstraction capabilities are extremely
3070 return true;
3069 } 3071 }
3070 3072
3071 3073
3072 bool v8::Object::HasOwnProperty(Handle<String> key) { 3074 bool v8::Object::HasOwnProperty(Handle<String> key) {
3073 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3075 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3074 ON_BAILOUT(isolate, "v8::Object::HasOwnProperty()", 3076 ON_BAILOUT(isolate, "v8::Object::HasOwnProperty()",
3075 return false); 3077 return false);
3076 return Utils::OpenHandle(this)->HasLocalProperty( 3078 return Utils::OpenHandle(this)->HasLocalProperty(
3077 *Utils::OpenHandle(*key)); 3079 *Utils::OpenHandle(*key));
3078 } 3080 }
(...skipping 3152 matching lines...) Expand 10 before | Expand all | Expand 10 after
6231 6233
6232 6234
6233 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6235 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6234 HandleScopeImplementer* scope_implementer = 6236 HandleScopeImplementer* scope_implementer =
6235 reinterpret_cast<HandleScopeImplementer*>(storage); 6237 reinterpret_cast<HandleScopeImplementer*>(storage);
6236 scope_implementer->IterateThis(v); 6238 scope_implementer->IterateThis(v);
6237 return storage + ArchiveSpacePerThread(); 6239 return storage + ArchiveSpacePerThread();
6238 } 6240 }
6239 6241
6240 } } // namespace v8::internal 6242 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698