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

Unified Diff: src/runtime.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 side-by-side diff with in-line comments
Download patch
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 6e93e58620d04564d04255dcef9571b17540b104..9ec690079dffefcb83e8d2c063b998dd82db0d93 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4350,26 +4350,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineAccessorProperty) {
RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
PropertyAttributes attr = static_cast<PropertyAttributes>(unchecked);
- // TODO(svenpanne) Define getter/setter/attributes in a single step.
- if (getter->IsNull() && setter->IsNull()) {
- JSArray* array;
- { MaybeObject* maybe_array = GetOwnProperty(isolate, obj, name);
- if (!maybe_array->To(&array)) return maybe_array;
- }
- Object* current = FixedArray::cast(array->elements())->get(GETTER_INDEX);
- getter = Handle<Object>(current, isolate);
- }
- if (!getter->IsNull()) {
- MaybeObject* ok =
- obj->DefineAccessor(*name, ACCESSOR_GETTER, *getter, attr);
- if (ok->IsFailure()) return ok;
- }
- if (!setter->IsNull()) {
- MaybeObject* ok =
- obj->DefineAccessor(*name, ACCESSOR_SETTER, *setter, attr);
- if (ok->IsFailure()) return ok;
- }
-
+ JSObject::DefineAccessor(obj, name, getter, setter, attr);
+ JSObject::TransformToFastProperties(obj, 0);
Michael Starzinger 2012/03/21 12:33:08 See first comment.
Sven Panne 2012/03/21 13:14:18 Done.
return isolate->heap()->undefined_value();
}
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698