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

Side by Side Diff: src/objects.cc

Issue 2187693002: [Tracing] Embed V8 runtime call stats into tracing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix memory leak Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/lookup.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 9328 matching lines...) Expand 10 before | Expand all | Expand 10 after
9339 9339
9340 9340
9341 Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name, 9341 Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
9342 Handle<Object> value, 9342 Handle<Object> value,
9343 PropertyAttributes attributes, 9343 PropertyAttributes attributes,
9344 StoreFromKeyed store_mode) { 9344 StoreFromKeyed store_mode) {
9345 RuntimeCallTimerScope stats_scope( 9345 RuntimeCallTimerScope stats_scope(
9346 *map, map->is_prototype_map() 9346 *map, map->is_prototype_map()
9347 ? &RuntimeCallStats::PrototypeMap_TransitionToDataProperty 9347 ? &RuntimeCallStats::PrototypeMap_TransitionToDataProperty
9348 : &RuntimeCallStats::Map_TransitionToDataProperty); 9348 : &RuntimeCallStats::Map_TransitionToDataProperty);
9349 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
9350 map->GetIsolate(),
9351 (map->is_prototype_map()
9352 ? &tracing::TraceEventStatsTable::
9353 PrototypeMap_TransitionToDataProperty
9354 : &tracing::TraceEventStatsTable::Map_TransitionToDataProperty))
9349 9355
9350 DCHECK(name->IsUniqueName()); 9356 DCHECK(name->IsUniqueName());
9351 DCHECK(!map->is_dictionary_map()); 9357 DCHECK(!map->is_dictionary_map());
9352 9358
9353 // Migrate to the newest map before storing the property. 9359 // Migrate to the newest map before storing the property.
9354 map = Update(map); 9360 map = Update(map);
9355 9361
9356 Map* maybe_transition = 9362 Map* maybe_transition =
9357 TransitionArray::SearchTransition(*map, kData, *name, attributes); 9363 TransitionArray::SearchTransition(*map, kData, *name, attributes);
9358 if (maybe_transition != NULL) { 9364 if (maybe_transition != NULL) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
9425 Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map, 9431 Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map,
9426 Handle<Name> name, int descriptor, 9432 Handle<Name> name, int descriptor,
9427 Handle<Object> getter, 9433 Handle<Object> getter,
9428 Handle<Object> setter, 9434 Handle<Object> setter,
9429 PropertyAttributes attributes) { 9435 PropertyAttributes attributes) {
9430 RuntimeCallTimerScope stats_scope( 9436 RuntimeCallTimerScope stats_scope(
9431 isolate, 9437 isolate,
9432 map->is_prototype_map() 9438 map->is_prototype_map()
9433 ? &RuntimeCallStats::PrototypeMap_TransitionToAccessorProperty 9439 ? &RuntimeCallStats::PrototypeMap_TransitionToAccessorProperty
9434 : &RuntimeCallStats::Map_TransitionToAccessorProperty); 9440 : &RuntimeCallStats::Map_TransitionToAccessorProperty);
9441 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
9442 isolate,
9443 (map->is_prototype_map()
9444 ? &tracing::TraceEventStatsTable::
9445 PrototypeMap_TransitionToAccessorProperty
9446 : &tracing::TraceEventStatsTable::Map_TransitionToAccessorProperty));
9435 9447
9436 // At least one of the accessors needs to be a new value. 9448 // At least one of the accessors needs to be a new value.
9437 DCHECK(!getter->IsNull(isolate) || !setter->IsNull(isolate)); 9449 DCHECK(!getter->IsNull(isolate) || !setter->IsNull(isolate));
9438 DCHECK(name->IsUniqueName()); 9450 DCHECK(name->IsUniqueName());
9439 9451
9440 // Dictionary maps can always have additional data properties. 9452 // Dictionary maps can always have additional data properties.
9441 if (map->is_dictionary_map()) return map; 9453 if (map->is_dictionary_map()) return map;
9442 9454
9443 // Migrate to the newest map before transitioning to the new property. 9455 // Migrate to the newest map before transitioning to the new property.
9444 map = Update(map); 9456 map = Update(map);
(...skipping 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after
12321 handle(Smi::FromInt(Map::kPrototypeChainValid), isolate)); 12333 handle(Smi::FromInt(Map::kPrototypeChainValid), isolate));
12322 proto_info->set_validity_cell(*cell); 12334 proto_info->set_validity_cell(*cell);
12323 return cell; 12335 return cell;
12324 } 12336 }
12325 12337
12326 12338
12327 // static 12339 // static
12328 void Map::SetPrototype(Handle<Map> map, Handle<Object> prototype, 12340 void Map::SetPrototype(Handle<Map> map, Handle<Object> prototype,
12329 PrototypeOptimizationMode proto_mode) { 12341 PrototypeOptimizationMode proto_mode) {
12330 RuntimeCallTimerScope stats_scope(*map, &RuntimeCallStats::Map_SetPrototype); 12342 RuntimeCallTimerScope stats_scope(*map, &RuntimeCallStats::Map_SetPrototype);
12343 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
12344 map->GetIsolate(), &tracing::TraceEventStatsTable::Map_SetPrototype);
12331 12345
12332 bool is_hidden = false; 12346 bool is_hidden = false;
12333 if (prototype->IsJSObject()) { 12347 if (prototype->IsJSObject()) {
12334 Handle<JSObject> prototype_jsobj = Handle<JSObject>::cast(prototype); 12348 Handle<JSObject> prototype_jsobj = Handle<JSObject>::cast(prototype);
12335 JSObject::OptimizeAsPrototype(prototype_jsobj, proto_mode); 12349 JSObject::OptimizeAsPrototype(prototype_jsobj, proto_mode);
12336 12350
12337 Object* maybe_constructor = prototype_jsobj->map()->GetConstructor(); 12351 Object* maybe_constructor = prototype_jsobj->map()->GetConstructor();
12338 if (maybe_constructor->IsJSFunction()) { 12352 if (maybe_constructor->IsJSFunction()) {
12339 JSFunction* constructor = JSFunction::cast(maybe_constructor); 12353 JSFunction* constructor = JSFunction::cast(maybe_constructor);
12340 Object* data = constructor->shared()->function_data(); 12354 Object* data = constructor->shared()->function_data();
(...skipping 6862 matching lines...) Expand 10 before | Expand all | Expand 10 after
19203 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, 19217 for (PrototypeIterator iter(isolate, this, kStartAtReceiver,
19204 PrototypeIterator::END_AT_NULL); 19218 PrototypeIterator::END_AT_NULL);
19205 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { 19219 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) {
19206 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; 19220 if (iter.GetCurrent<Object>()->IsJSProxy()) return true;
19207 } 19221 }
19208 return false; 19222 return false;
19209 } 19223 }
19210 19224
19211 } // namespace internal 19225 } // namespace internal
19212 } // namespace v8 19226 } // namespace v8
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698