| Index: src/runtime/runtime-object.cc
|
| diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
|
| index dd24728457d2fab4b5fdb1d284e3116849bc0276..4ad26dee0fad043988a5ec11645bf71f68f136d5 100644
|
| --- a/src/runtime/runtime-object.cc
|
| +++ b/src/runtime/runtime-object.cc
|
| @@ -680,6 +680,44 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) {
|
| return *object;
|
| }
|
|
|
| +RUNTIME_FUNCTION(Runtime_StoreTypeInformation) {
|
| + HandleScope scope(isolate);
|
| + DCHECK_EQ(4, args.length());
|
| + CONVERT_ARG_HANDLE_CHECKED(Name, name, 0);
|
| + CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
|
| + CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 2);
|
| + CONVERT_SMI_ARG_CHECKED(index, 3);
|
| +
|
| + DCHECK(FLAG_type_profile);
|
| +
|
| + StoreDataPropertyInLiteralICNexus nexus(vector, vector->ToSlot(index));
|
| + if (nexus.ic_state() == UNINITIALIZED) {
|
| + if (name->IsUniqueName()) {
|
| + printf(".");
|
| + nexus.ConfigureMonomorphic(name, handle(name->map()));
|
| + } else {
|
| + nexus.ConfigureMegamorphic();
|
| + }
|
| + } else if (nexus.ic_state() == MONOMORPHIC) {
|
| + printf("1");
|
| + if (nexus.FindFirstMap() != name->map() ||
|
| + nexus.GetFeedbackExtra() != *name) {
|
| + nexus.ConfigureMegamorphic();
|
| + }
|
| + }
|
| +
|
| + // We want to print the type profile, i.e., variable name and result of
|
| + // value.constructor.name or typeof value.
|
| +
|
| + printf("name: ");
|
| + name->Print();
|
| + printf("value: ");
|
| + Object::TypeOf(isolate, value)->Print();
|
| + printf("\n");
|
| +
|
| + return *value;
|
| +}
|
| +
|
| // Return property without being observable by accessors or interceptors.
|
| RUNTIME_FUNCTION(Runtime_GetDataProperty) {
|
| HandleScope scope(isolate);
|
|
|