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

Unified Diff: src/runtime.cc

Issue 261583004: Object.defineProperty shouldn't be a hint that we're constructing a dictionary. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/regress/regress-362870.js » ('j') | 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 6b7a446c5c962891345f8ba32ef13bc8ce4332a7..29284106fbed22fd475ae92873fd9ca3e2ff82c1 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5275,7 +5275,9 @@ RUNTIME_FUNCTION(Runtime_DefineOrRedefineDataProperty) {
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
- Runtime::ForceSetObjectProperty(js_object, name, obj_value, attr));
+ Runtime::ForceSetObjectProperty(
+ js_object, name, obj_value, attr,
+ JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED));
return *result;
}
@@ -5387,10 +5389,12 @@ MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate,
}
-MaybeHandle<Object> Runtime::ForceSetObjectProperty(Handle<JSObject> js_object,
- Handle<Object> key,
- Handle<Object> value,
- PropertyAttributes attr) {
+MaybeHandle<Object> Runtime::ForceSetObjectProperty(
+ Handle<JSObject> js_object,
+ Handle<Object> key,
+ Handle<Object> value,
+ PropertyAttributes attr,
+ JSReceiver::StoreFromKeyed store_from_keyed) {
Isolate* isolate = js_object->GetIsolate();
// Check if the given key is an array index.
uint32_t index;
@@ -5418,7 +5422,9 @@ MaybeHandle<Object> Runtime::ForceSetObjectProperty(Handle<JSObject> js_object,
} else {
if (name->IsString()) name = String::Flatten(Handle<String>::cast(name));
return JSObject::SetLocalPropertyIgnoreAttributes(
- js_object, name, value, attr);
+ js_object, name, value, attr, Object::OPTIMAL_REPRESENTATION,
+ ALLOW_AS_CONSTANT, JSReceiver::PERFORM_EXTENSIBILITY_CHECK,
+ store_from_keyed);
}
}
@@ -5432,8 +5438,10 @@ MaybeHandle<Object> Runtime::ForceSetObjectProperty(Handle<JSObject> js_object,
return JSObject::SetElement(js_object, index, value, attr,
SLOPPY, false, DEFINE_PROPERTY);
} else {
- return JSObject::SetLocalPropertyIgnoreAttributes(js_object, name, value,
- attr);
+ return JSObject::SetLocalPropertyIgnoreAttributes(
+ js_object, name, value, attr, Object::OPTIMAL_REPRESENTATION,
+ ALLOW_AS_CONSTANT, JSReceiver::PERFORM_EXTENSIBILITY_CHECK,
+ store_from_keyed);
}
}
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/regress/regress-362870.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698