Chromium Code Reviews| Index: src/runtime/runtime-object.cc |
| diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
| index 7d301bfa20f96235fd181e96bc00bc7e3143bff9..614408752ecf3b21afae0dc95929429eeced083f 100644 |
| --- a/src/runtime/runtime-object.cc |
| +++ b/src/runtime/runtime-object.cc |
| @@ -691,6 +691,32 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) { |
| return *object; |
| } |
| +RUNTIME_FUNCTION(Runtime_CollectTypeProfile) { |
| + HandleScope scope(isolate); |
| + DCHECK_EQ(4, args.length()); |
| + CONVERT_ARG_HANDLE_CHECKED(Object, 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); |
| + |
| + Handle<Name> type = Object::TypeOf(isolate, value); |
| + if (value->IsJSReceiver()) { |
| + Handle<JSReceiver> object = Handle<JSReceiver>::cast(value); |
| + type = JSReceiver::GetConstructorName(object); |
| + } |
| + |
| + CollectTypeProfileNexus nexus(vector, vector->ToSlot(index)); |
| + nexus.Collect(type); |
| + |
| + name->Print(); |
| + nexus.Print(); |
| + PrintF("\n"); |
|
rmcilroy
2017/03/13 10:50:59
Leftover PrintF debugging?
Franzi
2017/03/13 12:01:56
It's part of the output. At the moment I'm dumping
|
| + |
| + return *name; |
| +} |
| + |
| // Return property without being observable by accessors or interceptors. |
| RUNTIME_FUNCTION(Runtime_GetDataProperty) { |
| HandleScope scope(isolate); |