[ignition] Change --trace-ignition to a runtime flag
Generate the code (extra runtime calls) for --trace-ignition support at compile time, based on a #define (similar to TRACE_MAPS). Then check for --trace-ignition at run-time when deciding whether to actually print anything. This should make --trace-ignition less painful to use. Note that --trace-igition is disabled by default, even on debug builds. It has to be enabled with the gn arg "v8_enable_trace_ignition=true" As a drive-by, TRACE_MAPS is renamed to V8_TRACE_MAPS, for consistency, and SFI unique index (needed both by --trace-ignition and --trace-maps) is cleaned up to be behind another #define. Change-Id: I8dd0c62d0e6b7ee9c75541d45eb729dc03acbee9 Reviewed-on: https://chromium-review.googlesource.com/506203 Commit-Queue: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#45346}
This commit is contained in:
parent
647b1b84c0
commit
4becbe345f
15
BUILD.gn
15
BUILD.gn
@ -67,14 +67,14 @@ declare_args() {
|
|||||||
# Sets -dOBJECT_PRINT.
|
# Sets -dOBJECT_PRINT.
|
||||||
v8_enable_object_print = ""
|
v8_enable_object_print = ""
|
||||||
|
|
||||||
# Sets -dTRACE_MAPS.
|
# Sets -dV8_TRACE_MAPS.
|
||||||
v8_enable_trace_maps = ""
|
v8_enable_trace_maps = ""
|
||||||
|
|
||||||
# Sets -dV8_ENABLE_CHECKS.
|
# Sets -dV8_ENABLE_CHECKS.
|
||||||
v8_enable_v8_checks = ""
|
v8_enable_v8_checks = ""
|
||||||
|
|
||||||
# Builds the snapshot with --trace-ignition
|
# Sets -dV8_TRACE_IGNITION.
|
||||||
v8_trace_ignition = false
|
v8_enable_trace_ignition = false
|
||||||
|
|
||||||
# With post mortem support enabled, metadata is embedded into libv8 that
|
# With post mortem support enabled, metadata is embedded into libv8 that
|
||||||
# describes various parameters of the VM for use by debuggers. See
|
# describes various parameters of the VM for use by debuggers. See
|
||||||
@ -228,7 +228,10 @@ config("features") {
|
|||||||
defines += [ "VERIFY_PREDICTABLE" ]
|
defines += [ "VERIFY_PREDICTABLE" ]
|
||||||
}
|
}
|
||||||
if (v8_enable_trace_maps) {
|
if (v8_enable_trace_maps) {
|
||||||
defines += [ "TRACE_MAPS" ]
|
defines += [ "V8_TRACE_MAPS" ]
|
||||||
|
}
|
||||||
|
if (v8_enable_trace_ignition) {
|
||||||
|
defines += [ "V8_TRACE_IGNITION" ]
|
||||||
}
|
}
|
||||||
if (v8_enable_v8_checks) {
|
if (v8_enable_v8_checks) {
|
||||||
defines += [ "V8_ENABLE_CHECKS" ]
|
defines += [ "V8_ENABLE_CHECKS" ]
|
||||||
@ -732,10 +735,6 @@ action("run_mksnapshot") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v8_trace_ignition) {
|
|
||||||
args += [ "--trace-ignition" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v8_use_external_startup_data) {
|
if (v8_use_external_startup_data) {
|
||||||
outputs += [ "$root_out_dir/snapshot_blob.bin" ]
|
outputs += [ "$root_out_dir/snapshot_blob.bin" ]
|
||||||
args += [
|
args += [
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
'defines': ['VERIFY_HEAP',],
|
'defines': ['VERIFY_HEAP',],
|
||||||
}],
|
}],
|
||||||
['v8_trace_maps==1', {
|
['v8_trace_maps==1', {
|
||||||
'defines': ['TRACE_MAPS',],
|
'defines': ['V8_TRACE_MAPS',],
|
||||||
}],
|
}],
|
||||||
['v8_enable_verify_predictable==1', {
|
['v8_enable_verify_predictable==1', {
|
||||||
'defines': ['VERIFY_PREDICTABLE',],
|
'defines': ['VERIFY_PREDICTABLE',],
|
||||||
|
@ -1245,7 +1245,7 @@
|
|||||||
'OBJECT_PRINT',
|
'OBJECT_PRINT',
|
||||||
'VERIFY_HEAP',
|
'VERIFY_HEAP',
|
||||||
'DEBUG',
|
'DEBUG',
|
||||||
'TRACE_MAPS'
|
'V8_TRACE_MAPS'
|
||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
|
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
|
||||||
|
@ -5117,7 +5117,7 @@ Genesis::Genesis(
|
|||||||
AddToWeakNativeContextList(*native_context());
|
AddToWeakNativeContextList(*native_context());
|
||||||
isolate->set_context(*native_context());
|
isolate->set_context(*native_context());
|
||||||
isolate->counters()->contexts_created_by_snapshot()->Increment();
|
isolate->counters()->contexts_created_by_snapshot()->Increment();
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
if (FLAG_trace_maps) {
|
if (FLAG_trace_maps) {
|
||||||
Handle<JSFunction> object_fun = isolate->object_function();
|
Handle<JSFunction> object_fun = isolate->object_function();
|
||||||
PrintF("[TraceMap: InitialMap map= %p SFI= %d_Object ]\n",
|
PrintF("[TraceMap: InitialMap map= %p SFI= %d_Object ]\n",
|
||||||
|
@ -2489,7 +2489,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
|
|||||||
FeedbackMetadata::New(isolate(), &empty_spec);
|
FeedbackMetadata::New(isolate(), &empty_spec);
|
||||||
share->set_feedback_metadata(*feedback_metadata, SKIP_WRITE_BARRIER);
|
share->set_feedback_metadata(*feedback_metadata, SKIP_WRITE_BARRIER);
|
||||||
share->set_function_literal_id(FunctionLiteral::kIdTypeInvalid);
|
share->set_function_literal_id(FunctionLiteral::kIdTypeInvalid);
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId());
|
share->set_unique_id(isolate()->GetNextUniqueSharedFunctionInfoId());
|
||||||
#endif
|
#endif
|
||||||
share->set_profiler_ticks(0);
|
share->set_profiler_ticks(0);
|
||||||
|
@ -331,8 +331,10 @@ DEFINE_BOOL(print_bytecode, false,
|
|||||||
"print bytecode generated by ignition interpreter")
|
"print bytecode generated by ignition interpreter")
|
||||||
DEFINE_STRING(print_bytecode_filter, "*",
|
DEFINE_STRING(print_bytecode_filter, "*",
|
||||||
"filter for selecting which functions to print bytecode")
|
"filter for selecting which functions to print bytecode")
|
||||||
|
#ifdef V8_TRACE_IGNITION
|
||||||
DEFINE_BOOL(trace_ignition, false,
|
DEFINE_BOOL(trace_ignition, false,
|
||||||
"trace the bytecodes executed by the ignition interpreter")
|
"trace the bytecodes executed by the ignition interpreter")
|
||||||
|
#endif
|
||||||
DEFINE_BOOL(trace_ignition_codegen, false,
|
DEFINE_BOOL(trace_ignition_codegen, false,
|
||||||
"trace the codegen of ignition interpreter bytecode handlers")
|
"trace the codegen of ignition interpreter bytecode handlers")
|
||||||
DEFINE_BOOL(trace_ignition_dispatches, false,
|
DEFINE_BOOL(trace_ignition_dispatches, false,
|
||||||
@ -932,7 +934,7 @@ DEFINE_BOOL(trace_prototype_users, false,
|
|||||||
"Trace updates to prototype user tracking")
|
"Trace updates to prototype user tracking")
|
||||||
DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
|
DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
|
||||||
DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths")
|
DEFINE_BOOL(trace_for_in_enumerate, false, "Trace for-in enumerate slow-paths")
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
DEFINE_BOOL(trace_maps, false, "trace map creation")
|
DEFINE_BOOL(trace_maps, false, "trace map creation")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -120,6 +120,11 @@ namespace internal {
|
|||||||
|
|
||||||
#define V8_CONCURRENT_MARKING 0
|
#define V8_CONCURRENT_MARKING 0
|
||||||
|
|
||||||
|
// Some types of tracing require the SFI to store a unique ID.
|
||||||
|
#if defined(V8_TRACE_MAPS) || defined(V8_TRACE_IGNITION)
|
||||||
|
#define V8_SFI_HAS_UNIQUE_ID 1
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef uint8_t byte;
|
typedef uint8_t byte;
|
||||||
typedef byte* Address;
|
typedef byte* Address;
|
||||||
|
|
||||||
|
@ -49,9 +49,9 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state,
|
|||||||
dispatch_table_.Bind(
|
dispatch_table_.Bind(
|
||||||
Parameter(InterpreterDispatchDescriptor::kDispatchTable));
|
Parameter(InterpreterDispatchDescriptor::kDispatchTable));
|
||||||
|
|
||||||
if (FLAG_trace_ignition) {
|
#ifdef V8_TRACE_IGNITION
|
||||||
TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry);
|
TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry);
|
||||||
}
|
#endif
|
||||||
RegisterCallGenerationCallbacks([this] { CallPrologue(); },
|
RegisterCallGenerationCallbacks([this] { CallPrologue(); },
|
||||||
[this] { CallEpilogue(); });
|
[this] { CallEpilogue(); });
|
||||||
|
|
||||||
@ -1012,9 +1012,9 @@ Node* InterpreterAssembler::Advance(int delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Node* InterpreterAssembler::Advance(Node* delta, bool backward) {
|
Node* InterpreterAssembler::Advance(Node* delta, bool backward) {
|
||||||
if (FLAG_trace_ignition) {
|
#ifdef V8_TRACE_IGNITION
|
||||||
TraceBytecode(Runtime::kInterpreterTraceBytecodeExit);
|
TraceBytecode(Runtime::kInterpreterTraceBytecodeExit);
|
||||||
}
|
#endif
|
||||||
Node* next_offset = backward ? IntPtrSub(BytecodeOffset(), delta)
|
Node* next_offset = backward ? IntPtrSub(BytecodeOffset(), delta)
|
||||||
: IntPtrAdd(BytecodeOffset(), delta);
|
: IntPtrAdd(BytecodeOffset(), delta);
|
||||||
bytecode_offset_.Bind(next_offset);
|
bytecode_offset_.Bind(next_offset);
|
||||||
@ -1088,9 +1088,9 @@ void InterpreterAssembler::InlineStar() {
|
|||||||
bytecode_ = Bytecode::kStar;
|
bytecode_ = Bytecode::kStar;
|
||||||
accumulator_use_ = AccumulatorUse::kNone;
|
accumulator_use_ = AccumulatorUse::kNone;
|
||||||
|
|
||||||
if (FLAG_trace_ignition) {
|
#ifdef V8_TRACE_IGNITION
|
||||||
TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry);
|
TraceBytecode(Runtime::kInterpreterTraceBytecodeEntry);
|
||||||
}
|
#endif
|
||||||
StoreRegister(GetAccumulator(), BytecodeOperandReg(0));
|
StoreRegister(GetAccumulator(), BytecodeOperandReg(0));
|
||||||
|
|
||||||
DCHECK_EQ(accumulator_use_, Bytecodes::GetAccumulatorUse(bytecode_));
|
DCHECK_EQ(accumulator_use_, Bytecodes::GetAccumulatorUse(bytecode_));
|
||||||
|
@ -2346,7 +2346,7 @@ Isolate::Isolate(bool enable_serializer)
|
|||||||
optimizing_compile_dispatcher_(NULL),
|
optimizing_compile_dispatcher_(NULL),
|
||||||
stress_deopt_count_(0),
|
stress_deopt_count_(0),
|
||||||
next_optimization_id_(0),
|
next_optimization_id_(0),
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
next_unique_sfi_id_(0),
|
next_unique_sfi_id_(0),
|
||||||
#endif
|
#endif
|
||||||
is_running_microtasks_(false),
|
is_running_microtasks_(false),
|
||||||
|
@ -1167,7 +1167,7 @@ class Isolate {
|
|||||||
|
|
||||||
std::string GetTurboCfgFileName();
|
std::string GetTurboCfgFileName();
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; }
|
int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1541,7 +1541,7 @@ class Isolate {
|
|||||||
|
|
||||||
int next_optimization_id_;
|
int next_optimization_id_;
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
int next_unique_sfi_id_;
|
int next_unique_sfi_id_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -5921,7 +5921,7 @@ ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset)
|
|||||||
ACCESSORS(SharedFunctionInfo, feedback_metadata, FeedbackMetadata,
|
ACCESSORS(SharedFunctionInfo, feedback_metadata, FeedbackMetadata,
|
||||||
kFeedbackMetadataOffset)
|
kFeedbackMetadataOffset)
|
||||||
SMI_ACCESSORS(SharedFunctionInfo, function_literal_id, kFunctionLiteralIdOffset)
|
SMI_ACCESSORS(SharedFunctionInfo, function_literal_id, kFunctionLiteralIdOffset)
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset)
|
SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset)
|
||||||
#endif
|
#endif
|
||||||
ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
|
ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
|
||||||
|
@ -1523,9 +1523,7 @@ void LayoutDescriptor::Print(std::ostream& os) { // NOLINT
|
|||||||
|
|
||||||
#endif // OBJECT_PRINT
|
#endif // OBJECT_PRINT
|
||||||
|
|
||||||
|
#if V8_TRACE_MAPS
|
||||||
#if TRACE_MAPS
|
|
||||||
|
|
||||||
|
|
||||||
void Name::NameShortPrint() {
|
void Name::NameShortPrint() {
|
||||||
if (this->IsString()) {
|
if (this->IsString()) {
|
||||||
@ -1556,9 +1554,7 @@ int Name::NameShortPrint(Vector<char> str) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // V8_TRACE_MAPS
|
||||||
#endif // TRACE_MAPS
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(OBJECT_PRINT)
|
#if defined(DEBUG) || defined(OBJECT_PRINT)
|
||||||
// This method is only meant to be called from gdb for debugging purposes.
|
// This method is only meant to be called from gdb for debugging purposes.
|
||||||
|
@ -5699,7 +5699,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
|
|||||||
|
|
||||||
NotifyMapChange(old_map, new_map, isolate);
|
NotifyMapChange(old_map, new_map, isolate);
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
if (FLAG_trace_maps) {
|
if (FLAG_trace_maps) {
|
||||||
PrintF("[TraceMaps: SlowToFast from= %p to= %p reason= %s ]\n",
|
PrintF("[TraceMaps: SlowToFast from= %p to= %p reason= %s ]\n",
|
||||||
reinterpret_cast<void*>(*old_map), reinterpret_cast<void*>(*new_map),
|
reinterpret_cast<void*>(*old_map), reinterpret_cast<void*>(*new_map),
|
||||||
@ -8655,7 +8655,7 @@ Handle<Map> Map::Normalize(Handle<Map> fast_map, PropertyNormalizationMode mode,
|
|||||||
cache->Set(fast_map, new_map);
|
cache->Set(fast_map, new_map);
|
||||||
isolate->counters()->maps_normalized()->Increment();
|
isolate->counters()->maps_normalized()->Increment();
|
||||||
}
|
}
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
if (FLAG_trace_maps) {
|
if (FLAG_trace_maps) {
|
||||||
PrintF("[TraceMaps: Normalize from= %p to= %p reason= %s ]\n",
|
PrintF("[TraceMaps: Normalize from= %p to= %p reason= %s ]\n",
|
||||||
reinterpret_cast<void*>(*fast_map),
|
reinterpret_cast<void*>(*fast_map),
|
||||||
@ -8814,8 +8814,7 @@ Handle<Map> Map::ShareDescriptor(Handle<Map> map,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if V8_TRACE_MAPS
|
||||||
#if TRACE_MAPS
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void Map::TraceTransition(const char* what, Map* from, Map* to, Name* name) {
|
void Map::TraceTransition(const char* what, Map* from, Map* to, Name* name) {
|
||||||
@ -8840,8 +8839,7 @@ void Map::TraceAllTransitions(Map* map) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TRACE_MAPS
|
#endif // V8_TRACE_MAPS
|
||||||
|
|
||||||
|
|
||||||
void Map::ConnectTransition(Handle<Map> parent, Handle<Map> child,
|
void Map::ConnectTransition(Handle<Map> parent, Handle<Map> child,
|
||||||
Handle<Name> name, SimpleTransitionFlag flag) {
|
Handle<Name> name, SimpleTransitionFlag flag) {
|
||||||
@ -8856,12 +8854,12 @@ void Map::ConnectTransition(Handle<Map> parent, Handle<Map> child,
|
|||||||
}
|
}
|
||||||
if (parent->is_prototype_map()) {
|
if (parent->is_prototype_map()) {
|
||||||
DCHECK(child->is_prototype_map());
|
DCHECK(child->is_prototype_map());
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
Map::TraceTransition("NoTransition", *parent, *child, *name);
|
Map::TraceTransition("NoTransition", *parent, *child, *name);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
TransitionArray::Insert(parent, name, child, flag);
|
TransitionArray::Insert(parent, name, child, flag);
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
Map::TraceTransition("Transition", *parent, *child, *name);
|
Map::TraceTransition("Transition", *parent, *child, *name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -8893,7 +8891,7 @@ Handle<Map> Map::CopyReplaceDescriptors(
|
|||||||
} else {
|
} else {
|
||||||
result->InitializeDescriptors(*descriptors, *layout_descriptor);
|
result->InitializeDescriptors(*descriptors, *layout_descriptor);
|
||||||
}
|
}
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
if (FLAG_trace_maps &&
|
if (FLAG_trace_maps &&
|
||||||
// Mirror conditions above that did not call ConnectTransition().
|
// Mirror conditions above that did not call ConnectTransition().
|
||||||
(map->is_prototype_map() ||
|
(map->is_prototype_map() ||
|
||||||
@ -9093,7 +9091,7 @@ Handle<Map> Map::CopyForTransition(Handle<Map> map, const char* reason) {
|
|||||||
new_map->InitializeDescriptors(*new_descriptors, *new_layout_descriptor);
|
new_map->InitializeDescriptors(*new_descriptors, *new_layout_descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
if (FLAG_trace_maps) {
|
if (FLAG_trace_maps) {
|
||||||
PrintF("[TraceMaps: CopyForTransition from= %p to= %p reason= %s ]\n",
|
PrintF("[TraceMaps: CopyForTransition from= %p to= %p reason= %s ]\n",
|
||||||
reinterpret_cast<void*>(*map), reinterpret_cast<void*>(*new_map),
|
reinterpret_cast<void*>(*map), reinterpret_cast<void*>(*new_map),
|
||||||
@ -9276,7 +9274,7 @@ Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
|
|||||||
if (!maybe_map.ToHandle(&result)) {
|
if (!maybe_map.ToHandle(&result)) {
|
||||||
Isolate* isolate = name->GetIsolate();
|
Isolate* isolate = name->GetIsolate();
|
||||||
const char* reason = "TooManyFastProperties";
|
const char* reason = "TooManyFastProperties";
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
std::unique_ptr<ScopedVector<char>> buffer;
|
std::unique_ptr<ScopedVector<char>> buffer;
|
||||||
if (FLAG_trace_maps) {
|
if (FLAG_trace_maps) {
|
||||||
ScopedVector<char> name_buffer(100);
|
ScopedVector<char> name_buffer(100);
|
||||||
@ -12651,7 +12649,7 @@ void JSFunction::SetInitialMap(Handle<JSFunction> function, Handle<Map> map,
|
|||||||
}
|
}
|
||||||
function->set_prototype_or_initial_map(*map);
|
function->set_prototype_or_initial_map(*map);
|
||||||
map->SetConstructor(*function);
|
map->SetConstructor(*function);
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
if (FLAG_trace_maps) {
|
if (FLAG_trace_maps) {
|
||||||
PrintF("[TraceMaps: InitialMap map= %p SFI= %d_%s ]\n",
|
PrintF("[TraceMaps: InitialMap map= %p SFI= %d_%s ]\n",
|
||||||
reinterpret_cast<void*>(*map), function->shared()->unique_id(),
|
reinterpret_cast<void*>(*map), function->shared()->unique_id(),
|
||||||
|
@ -5120,7 +5120,7 @@ class Map: public HeapObject {
|
|||||||
// Returns true if given field is unboxed double.
|
// Returns true if given field is unboxed double.
|
||||||
inline bool IsUnboxedDoubleField(FieldIndex index);
|
inline bool IsUnboxedDoubleField(FieldIndex index);
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
static void TraceTransition(const char* what, Map* from, Map* to, Name* name);
|
static void TraceTransition(const char* what, Map* from, Map* to, Name* name);
|
||||||
static void TraceAllTransitions(Map* map);
|
static void TraceAllTransitions(Map* map);
|
||||||
#endif
|
#endif
|
||||||
@ -5931,9 +5931,9 @@ class SharedFunctionInfo: public HeapObject {
|
|||||||
inline int function_literal_id() const;
|
inline int function_literal_id() const;
|
||||||
inline void set_function_literal_id(int value);
|
inline void set_function_literal_id(int value);
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
// [unique_id] - For --trace-maps purposes, an identifier that's persistent
|
// [unique_id] - For tracing purposes, an identifier that's persistent even if
|
||||||
// even if the GC moves this SharedFunctionInfo.
|
// the GC moves this SharedFunctionInfo.
|
||||||
inline int unique_id() const;
|
inline int unique_id() const;
|
||||||
inline void set_unique_id(int value);
|
inline void set_unique_id(int value);
|
||||||
#endif
|
#endif
|
||||||
@ -6271,7 +6271,7 @@ class SharedFunctionInfo: public HeapObject {
|
|||||||
kFunctionIdentifierOffset + kPointerSize;
|
kFunctionIdentifierOffset + kPointerSize;
|
||||||
static const int kFunctionLiteralIdOffset =
|
static const int kFunctionLiteralIdOffset =
|
||||||
kFeedbackMetadataOffset + kPointerSize;
|
kFeedbackMetadataOffset + kPointerSize;
|
||||||
#if TRACE_MAPS
|
#if V8_SFI_HAS_UNIQUE_ID
|
||||||
static const int kUniqueIdOffset = kFunctionLiteralIdOffset + kPointerSize;
|
static const int kUniqueIdOffset = kFunctionLiteralIdOffset + kPointerSize;
|
||||||
static const int kLastPointerFieldOffset = kUniqueIdOffset;
|
static const int kLastPointerFieldOffset = kUniqueIdOffset;
|
||||||
#else
|
#else
|
||||||
@ -7842,7 +7842,7 @@ class Name: public HeapObject {
|
|||||||
DECLARE_CAST(Name)
|
DECLARE_CAST(Name)
|
||||||
|
|
||||||
DECLARE_PRINTER(Name)
|
DECLARE_PRINTER(Name)
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
void NameShortPrint();
|
void NameShortPrint();
|
||||||
int NameShortPrint(Vector<char> str);
|
int NameShortPrint(Vector<char> str);
|
||||||
#endif
|
#endif
|
||||||
@ -7961,7 +7961,7 @@ class Symbol: public Name {
|
|||||||
private:
|
private:
|
||||||
const char* PrivateSymbolToName() const;
|
const char* PrivateSymbolToName() const;
|
||||||
|
|
||||||
#if TRACE_MAPS
|
#if V8_TRACE_MAPS
|
||||||
friend class Name; // For PrivateSymbolToName.
|
friend class Name; // For PrivateSymbolToName.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) {
|
|||||||
static_cast<PretenureFlag>(pretenured_flag));
|
static_cast<PretenureFlag>(pretenured_flag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef V8_TRACE_IGNITION
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void AdvanceToOffsetForTracing(
|
void AdvanceToOffsetForTracing(
|
||||||
@ -109,17 +111,22 @@ void PrintRegisters(std::ostream& os, bool is_input,
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) {
|
RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) {
|
||||||
|
if (!FLAG_trace_ignition) {
|
||||||
|
return isolate->heap()->undefined_value();
|
||||||
|
}
|
||||||
|
|
||||||
SealHandleScope shs(isolate);
|
SealHandleScope shs(isolate);
|
||||||
DCHECK_EQ(3, args.length());
|
DCHECK_EQ(3, args.length());
|
||||||
CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0);
|
CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0);
|
||||||
CONVERT_SMI_ARG_CHECKED(bytecode_offset, 1);
|
CONVERT_SMI_ARG_CHECKED(bytecode_offset, 1);
|
||||||
CONVERT_ARG_HANDLE_CHECKED(Object, accumulator, 2);
|
CONVERT_ARG_HANDLE_CHECKED(Object, accumulator, 2);
|
||||||
OFStream os(stdout);
|
|
||||||
|
|
||||||
int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
|
int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
|
||||||
interpreter::BytecodeArrayIterator bytecode_iterator(bytecode_array);
|
interpreter::BytecodeArrayIterator bytecode_iterator(bytecode_array);
|
||||||
AdvanceToOffsetForTracing(bytecode_iterator, offset);
|
AdvanceToOffsetForTracing(bytecode_iterator, offset);
|
||||||
if (offset == bytecode_iterator.current_offset()) {
|
if (offset == bytecode_iterator.current_offset()) {
|
||||||
|
OFStream os(stdout);
|
||||||
|
|
||||||
// Print bytecode.
|
// Print bytecode.
|
||||||
const uint8_t* base_address = bytecode_array->GetFirstBytecodeAddress();
|
const uint8_t* base_address = bytecode_array->GetFirstBytecodeAddress();
|
||||||
const uint8_t* bytecode_address = base_address + offset;
|
const uint8_t* bytecode_address = base_address + offset;
|
||||||
@ -137,6 +144,10 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) {
|
RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) {
|
||||||
|
if (!FLAG_trace_ignition) {
|
||||||
|
return isolate->heap()->undefined_value();
|
||||||
|
}
|
||||||
|
|
||||||
SealHandleScope shs(isolate);
|
SealHandleScope shs(isolate);
|
||||||
DCHECK_EQ(3, args.length());
|
DCHECK_EQ(3, args.length());
|
||||||
CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0);
|
CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0);
|
||||||
@ -160,6 +171,8 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) {
|
|||||||
return isolate->heap()->undefined_value();
|
return isolate->heap()->undefined_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
RUNTIME_FUNCTION(Runtime_InterpreterAdvanceBytecodeOffset) {
|
RUNTIME_FUNCTION(Runtime_InterpreterAdvanceBytecodeOffset) {
|
||||||
SealHandleScope shs(isolate);
|
SealHandleScope shs(isolate);
|
||||||
DCHECK_EQ(2, args.length());
|
DCHECK_EQ(2, args.length());
|
||||||
|
@ -216,10 +216,17 @@ namespace internal {
|
|||||||
F(ForInFilter, 2, 1) \
|
F(ForInFilter, 2, 1) \
|
||||||
F(ForInHasProperty, 2, 1)
|
F(ForInHasProperty, 2, 1)
|
||||||
|
|
||||||
|
#ifdef V8_TRACE_IGNITION
|
||||||
|
#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F) \
|
||||||
|
F(InterpreterTraceBytecodeEntry, 3, 1) \
|
||||||
|
F(InterpreterTraceBytecodeExit, 3, 1)
|
||||||
|
#else
|
||||||
|
#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FOR_EACH_INTRINSIC_INTERPRETER(F) \
|
#define FOR_EACH_INTRINSIC_INTERPRETER(F) \
|
||||||
|
FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F) \
|
||||||
F(InterpreterNewClosure, 4, 1) \
|
F(InterpreterNewClosure, 4, 1) \
|
||||||
F(InterpreterTraceBytecodeEntry, 3, 1) \
|
|
||||||
F(InterpreterTraceBytecodeExit, 3, 1) \
|
|
||||||
F(InterpreterAdvanceBytecodeOffset, 2, 1)
|
F(InterpreterAdvanceBytecodeOffset, 2, 1)
|
||||||
|
|
||||||
#define FOR_EACH_INTRINSIC_FUNCTION(F) \
|
#define FOR_EACH_INTRINSIC_FUNCTION(F) \
|
||||||
|
@ -20,14 +20,6 @@ void SetupIsolateDelegate::SetupBuiltins(Isolate* isolate,
|
|||||||
|
|
||||||
void SetupIsolateDelegate::SetupInterpreter(
|
void SetupIsolateDelegate::SetupInterpreter(
|
||||||
interpreter::Interpreter* interpreter, bool create_heap_objects) {
|
interpreter::Interpreter* interpreter, bool create_heap_objects) {
|
||||||
#ifdef V8_USE_SNAPSHOT
|
|
||||||
if (FLAG_trace_ignition || FLAG_trace_ignition_codegen ||
|
|
||||||
FLAG_trace_ignition_dispatches) {
|
|
||||||
OFStream os(stdout);
|
|
||||||
os << "Warning: --trace-ignition-* flags must be passed at mksnapshot "
|
|
||||||
<< "time or used with nosnapshot builds." << std::endl;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
DCHECK(interpreter->IsDispatchTableInitialized());
|
DCHECK(interpreter->IsDispatchTableInitialized());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user