2010-03-15 14:11:19 +00:00
|
|
|
// Copyright 2010 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2010-03-15 14:11:19 +00:00
|
|
|
|
|
|
|
#ifndef V8_PROFILE_GENERATOR_INL_H_
|
|
|
|
#define V8_PROFILE_GENERATOR_INL_H_
|
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/profile-generator.h"
|
2010-03-15 14:11:19 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2014-11-05 12:40:56 +00:00
|
|
|
CodeEntry::CodeEntry(Logger::LogEventsAndTags tag, const char* name,
|
|
|
|
const char* name_prefix, const char* resource_name,
|
2014-11-06 09:16:34 +00:00
|
|
|
int line_number, int column_number,
|
|
|
|
JITLineInfoTable* line_info, Address instruction_start)
|
2014-11-05 12:40:56 +00:00
|
|
|
: bit_field_(TagField::encode(tag) |
|
|
|
|
BuiltinIdField::encode(Builtins::builtin_count)),
|
2010-04-06 10:36:38 +00:00
|
|
|
name_prefix_(name_prefix),
|
2010-03-19 09:46:53 +00:00
|
|
|
name_(name),
|
|
|
|
resource_name_(resource_name),
|
2010-05-18 14:19:33 +00:00
|
|
|
line_number_(line_number),
|
2013-10-10 13:15:47 +00:00
|
|
|
column_number_(column_number),
|
2014-03-14 10:20:33 +00:00
|
|
|
script_id_(v8::UnboundScript::kNoScriptId),
|
2015-02-20 13:28:42 +00:00
|
|
|
position_(0),
|
2013-09-05 13:20:51 +00:00
|
|
|
no_frame_ranges_(NULL),
|
2014-11-06 09:16:34 +00:00
|
|
|
bailout_reason_(kEmptyBailoutReason),
|
2015-02-12 19:51:26 +00:00
|
|
|
deopt_reason_(kNoDeoptReason),
|
2015-02-27 13:34:23 +00:00
|
|
|
deopt_position_(SourcePosition::Unknown()),
|
2014-11-06 09:16:34 +00:00
|
|
|
line_info_(line_info),
|
|
|
|
instruction_start_(instruction_start) {}
|
2010-03-19 09:46:53 +00:00
|
|
|
|
|
|
|
|
2010-04-07 14:18:26 +00:00
|
|
|
bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) {
|
|
|
|
return tag == Logger::FUNCTION_TAG
|
|
|
|
|| tag == Logger::LAZY_COMPILE_TAG
|
|
|
|
|| tag == Logger::SCRIPT_TAG
|
|
|
|
|| tag == Logger::NATIVE_FUNCTION_TAG
|
|
|
|
|| tag == Logger::NATIVE_LAZY_COMPILE_TAG
|
|
|
|
|| tag == Logger::NATIVE_SCRIPT_TAG;
|
2010-03-15 14:11:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-04-15 11:37:29 +00:00
|
|
|
ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry)
|
|
|
|
: tree_(tree),
|
|
|
|
entry_(entry),
|
2010-03-15 14:11:19 +00:00
|
|
|
self_ticks_(0),
|
2013-04-02 07:48:25 +00:00
|
|
|
children_(CodeEntriesMatch),
|
2014-11-06 09:16:34 +00:00
|
|
|
id_(tree->next_node_id()),
|
|
|
|
line_ticks_(LineTickMatch) {}
|
2015-02-20 13:28:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
inline unsigned ProfileNode::function_id() const {
|
|
|
|
return tree_->GetFunctionId(this);
|
|
|
|
}
|
2010-03-15 14:11:19 +00:00
|
|
|
} } // namespace v8::internal
|
|
|
|
|
|
|
|
#endif // V8_PROFILE_GENERATOR_INL_H_
|