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

Unified Diff: src/objects.cc

Issue 1973473002: [runtime] Record runtime call stats for Map::TransitionTo*Property, JSObject::OptimizeAsPrototype t… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@handler-counters2
Patch Set: Addressing comments and rebasing Created 4 years, 7 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/lookup.cc ('K') | « src/lookup.cc ('k') | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 00bd2c18bc6035777310a8252fa8b3f0e7ac178e..5648f667b841d601fc7810ab5f06b2eeb89d0c4d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -22,6 +22,8 @@
#include "src/codegen.h"
#include "src/compilation-dependencies.h"
#include "src/compiler.h"
+#include "src/counters-inl.h"
+#include "src/counters.h"
#include "src/date.h"
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
@@ -9018,6 +9020,11 @@ Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
Handle<Object> value,
PropertyAttributes attributes,
StoreFromKeyed store_mode) {
+ RuntimeCallTimerScope stats_scope(
+ *map, map->is_prototype_map()
+ ? &RuntimeCallStats::PrototypeMap_TransitionToDataProperty
+ : &RuntimeCallStats::Map_TransitionToDataProperty);
+
DCHECK(name->IsUniqueName());
DCHECK(!map->is_dictionary_map());
@@ -9098,6 +9105,12 @@ Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map,
Handle<Object> getter,
Handle<Object> setter,
PropertyAttributes attributes) {
+ RuntimeCallTimerScope stats_scope(
+ isolate,
+ map->is_prototype_map()
+ ? &RuntimeCallStats::PrototypeMap_TransitionToAccessorProperty
+ : &RuntimeCallStats::Map_TransitionToAccessorProperty);
+
// At least one of the accessors needs to be a new value.
DCHECK(!getter->IsNull() || !setter->IsNull());
DCHECK(name->IsUniqueName());
@@ -11667,6 +11680,8 @@ Handle<Cell> Map::GetOrCreatePrototypeChainValidityCell(Handle<Map> map,
// static
void Map::SetPrototype(Handle<Map> map, Handle<Object> prototype,
PrototypeOptimizationMode proto_mode) {
+ RuntimeCallTimerScope stats_scope(*map, &RuntimeCallStats::Map_SetPrototype);
+
bool is_hidden = false;
if (prototype->IsJSObject()) {
Handle<JSObject> prototype_jsobj = Handle<JSObject>::cast(prototype);
« src/lookup.cc ('K') | « src/lookup.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698