blob: 58c124fe62b85e4f87cc9603c490b0141a8779da [file] [log] [blame]
Steve Block6ded16b2010-05-10 14:33:55 +01001// Copyright 2010 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Steve Block6ded16b2010-05-10 14:33:55 +01004
5#ifndef V8_PROFILE_GENERATOR_INL_H_
6#define V8_PROFILE_GENERATOR_INL_H_
7
Ben Murdochb8a8cc12014-11-26 15:28:44 +00008#include "src/profile-generator.h"
Steve Block6ded16b2010-05-10 14:33:55 +01009
10namespace v8 {
11namespace internal {
12
13CodeEntry::CodeEntry(Logger::LogEventsAndTags tag,
Steve Block6ded16b2010-05-10 14:33:55 +010014 const char* name,
Ben Murdochb8a8cc12014-11-26 15:28:44 +000015 const char* name_prefix,
Steve Block6ded16b2010-05-10 14:33:55 +010016 const char* resource_name,
Leon Clarkef7060e22010-06-03 12:02:55 +010017 int line_number,
Ben Murdochb8a8cc12014-11-26 15:28:44 +000018 int column_number)
Kristian Monsen0d5e1162010-09-30 15:31:59 +010019 : tag_(tag),
Ben Murdochb8a8cc12014-11-26 15:28:44 +000020 builtin_id_(Builtins::builtin_count),
Steve Block6ded16b2010-05-10 14:33:55 +010021 name_prefix_(name_prefix),
22 name_(name),
23 resource_name_(resource_name),
Leon Clarkef7060e22010-06-03 12:02:55 +010024 line_number_(line_number),
Ben Murdochb8a8cc12014-11-26 15:28:44 +000025 column_number_(column_number),
Ben Murdoche0cee9b2011-05-25 10:26:03 +010026 shared_id_(0),
Ben Murdochb8a8cc12014-11-26 15:28:44 +000027 script_id_(v8::UnboundScript::kNoScriptId),
28 no_frame_ranges_(NULL),
29 bailout_reason_(kEmptyBailoutReason) { }
Steve Block6ded16b2010-05-10 14:33:55 +010030
31
32bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) {
33 return tag == Logger::FUNCTION_TAG
34 || tag == Logger::LAZY_COMPILE_TAG
35 || tag == Logger::SCRIPT_TAG
36 || tag == Logger::NATIVE_FUNCTION_TAG
37 || tag == Logger::NATIVE_LAZY_COMPILE_TAG
38 || tag == Logger::NATIVE_SCRIPT_TAG;
39}
40
41
42ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry)
43 : tree_(tree),
44 entry_(entry),
Steve Block6ded16b2010-05-10 14:33:55 +010045 self_ticks_(0),
Ben Murdochb8a8cc12014-11-26 15:28:44 +000046 children_(CodeEntriesMatch),
47 id_(tree->next_node_id()) { }
Ben Murdochc7cc0282012-03-05 14:35:55 +000048
Steve Block6ded16b2010-05-10 14:33:55 +010049} } // namespace v8::internal
50
Steve Block6ded16b2010-05-10 14:33:55 +010051#endif // V8_PROFILE_GENERATOR_INL_H_