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

Unified Diff: src/runtime/runtime-object.cc

Issue 2587393006: [runtime] Collect IC feedback in DefineDataPropertyInLiteral. (Closed)
Patch Set: Rebase. Created 3 years, 11 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/runtime.h ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index c1477769bacdd569ff3d4903cc7ea4806d632509..a90ff7aa893d56049de7432979f61a4236fd144a 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -648,11 +648,27 @@ RUNTIME_FUNCTION(Runtime_DefineAccessorPropertyUnchecked) {
RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) {
HandleScope scope(isolate);
- DCHECK(args.length() == 4);
+ DCHECK_EQ(6, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
CONVERT_SMI_ARG_CHECKED(flag, 3);
+ CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 4);
+ CONVERT_SMI_ARG_CHECKED(index, 5);
+
+ StoreDataPropertyInLiteralICNexus nexus(vector, vector->ToSlot(index));
+ if (nexus.ic_state() == UNINITIALIZED) {
+ if (name->IsUniqueName()) {
+ nexus.ConfigureMonomorphic(name, handle(object->map()));
+ } else {
+ nexus.ConfigureMegamorphic();
+ }
+ } else if (nexus.ic_state() == MONOMORPHIC) {
+ if (nexus.FindFirstMap() != object->map() ||
+ nexus.GetFeedbackExtra() != *name) {
+ nexus.ConfigureMegamorphic();
+ }
+ }
DataPropertyInLiteralFlags flags =
static_cast<DataPropertyInLiteralFlag>(flag);
« no previous file with comments | « src/runtime/runtime.h ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698