Reviewers: loislo, alph, Yang,

Description:
profile-generator.* code clean-up

* Removed unused CodeEntry::CopyData
* Removed unnecessary INLINE macros

BUG=None

Please review this at https://codereview.chromium.org/25382003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+43, -55 lines):
  M src/profile-generator-inl.h
  M src/profile-generator.h
  M src/profile-generator.cc


Index: src/profile-generator-inl.h
diff --git a/src/profile-generator-inl.h b/src/profile-generator-inl.h
index 76a9fb1796937f75c563947a2ed510fe01421cf4..ac23ee3f01195be14df4de15c951ac1f030a98ee 100644
--- a/src/profile-generator-inl.h
+++ b/src/profile-generator-inl.h
@@ -79,25 +79,6 @@ ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry)
       children_(CodeEntriesMatch),
       id_(tree->next_node_id()) { }

-
-CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
-  switch (tag) {
-    case GC:
-      return gc_entry_;
-    case JS:
-    case COMPILER:
-    // DOM events handlers are reported as OTHER / EXTERNAL entries.
-    // To avoid confusing people, let's put all these entries into
-    // one bucket.
-    case OTHER:
-    case EXTERNAL:
-      return program_entry_;
-    case IDLE:
-      return idle_entry_;
-    default: return NULL;
-  }
-}
-
 } }  // namespace v8::internal

 #endif  // V8_PROFILE_GENERATOR_INL_H_
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index d8e8c127bf3949ad586e48822ae7a3d2610226dd..cf268afc9b41e18f0b763816df783a1f0008798d 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -141,15 +141,6 @@ CodeEntry::~CodeEntry() {
 }


-void CodeEntry::CopyData(const CodeEntry& source) {
-  tag_ = source.tag_;
-  name_prefix_ = source.name_prefix_;
-  name_ = source.name_;
-  resource_name_ = source.resource_name_;
-  line_number_ = source.line_number_;
-}
-
-
 uint32_t CodeEntry::GetCallUid() const {
   uint32_t hash = ComputeIntegerHash(tag_, v8::internal::kZeroHashSeed);
   if (shared_id_ != 0) {
@@ -662,4 +653,22 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
 }


+CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
+  switch (tag) {
+    case GC:
+      return gc_entry_;
+    case JS:
+    case COMPILER:
+    // DOM events handlers are reported as OTHER / EXTERNAL entries.
+    // To avoid confusing people, let's put all these entries into
+    // one bucket.
+    case OTHER:
+    case EXTERNAL:
+      return program_entry_;
+    case IDLE:
+      return idle_entry_;
+    default: return NULL;
+  }
+}
+
 } }  // namespace v8::internal
Index: src/profile-generator.h
diff --git a/src/profile-generator.h b/src/profile-generator.h
index b9536ab3365b32bdf7bb589c7aff0023cf2b5115..890fb2e5f80a28b63bbf96e7980433d73578918b 100644
--- a/src/profile-generator.h
+++ b/src/profile-generator.h
@@ -56,7 +56,7 @@ class StringsStorage {
  private:
   static const int kMaxNameSize = 1024;

-  INLINE(static bool StringsMatch(void* key1, void* key2)) {
+  static bool StringsMatch(void* key1, void* key2) {
     return strcmp(reinterpret_cast<char*>(key1),
                   reinterpret_cast<char*>(key2)) == 0;
   }
@@ -73,31 +73,30 @@ class StringsStorage {
 class CodeEntry {
  public:
   // CodeEntry doesn't own name strings, just references them.
-  INLINE(CodeEntry(Logger::LogEventsAndTags tag,
+  inline CodeEntry(Logger::LogEventsAndTags tag,
                    const char* name,
                    const char* name_prefix = CodeEntry::kEmptyNamePrefix,
const char* resource_name = CodeEntry::kEmptyResourceName,
                    int line_number = v8::CpuProfileNode::kNoLineNumberInfo,
-                   int column_number =
-                       v8::CpuProfileNode::kNoColumnNumberInfo));
+ int column_number = v8::CpuProfileNode::kNoColumnNumberInfo);
   ~CodeEntry();

-  INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); }
-  INLINE(const char* name_prefix() const) { return name_prefix_; }
-  INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; }
-  INLINE(const char* name() const) { return name_; }
-  INLINE(const char* resource_name() const) { return resource_name_; }
-  INLINE(int line_number() const) { return line_number_; }
+  bool is_js_function() const { return is_js_function_tag(tag_); }
+  const char* name_prefix() const { return name_prefix_; }
+  bool has_name_prefix() const { return name_prefix_[0] != '\0'; }
+  const char* name() const { return name_; }
+  const char* resource_name() const { return resource_name_; }
+  int line_number() const { return line_number_; }
   int column_number() const { return column_number_; }
-  INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; }
-  INLINE(int script_id() const) { return script_id_; }
-  INLINE(void set_script_id(int script_id)) { script_id_ = script_id; }
-  INLINE(void set_bailout_reason(const char* bailout_reason)) {
+  void set_shared_id(int shared_id) { shared_id_ = shared_id; }
+  int script_id() const { return script_id_; }
+  void set_script_id(int script_id) { script_id_ = script_id; }
+  void set_bailout_reason(const char* bailout_reason) {
     bailout_reason_ = bailout_reason;
   }
-  INLINE(const char* bailout_reason() const) { return bailout_reason_; }
+  const char* bailout_reason() const { return bailout_reason_; }

-  INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
+  static inline bool is_js_function_tag(Logger::LogEventsAndTags tag);

   List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; }
   void set_no_frame_ranges(List<OffsetRange>* ranges) {
@@ -107,7 +106,6 @@ class CodeEntry {
   void SetBuiltinId(Builtins::Name id);
   Builtins::Name builtin_id() const { return builtin_id_; }

-  void CopyData(const CodeEntry& source);
   uint32_t GetCallUid() const;
   bool IsSameAs(CodeEntry* entry) const;

@@ -136,27 +134,27 @@ class ProfileTree;

 class ProfileNode {
  public:
-  INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry));
+  inline ProfileNode(ProfileTree* tree, CodeEntry* entry);

   ProfileNode* FindChild(CodeEntry* entry);
   ProfileNode* FindOrAddChild(CodeEntry* entry);
-  INLINE(void IncrementSelfTicks()) { ++self_ticks_; }
- INLINE(void IncreaseSelfTicks(unsigned amount)) { self_ticks_ += amount; }
+  void IncrementSelfTicks() { ++self_ticks_; }
+  void IncreaseSelfTicks(unsigned amount) { self_ticks_ += amount; }

-  INLINE(CodeEntry* entry() const) { return entry_; }
-  INLINE(unsigned self_ticks() const) { return self_ticks_; }
- INLINE(const List<ProfileNode*>* children() const) { return &children_list_; }
+  CodeEntry* entry() const { return entry_; }
+  unsigned self_ticks() const { return self_ticks_; }
+  const List<ProfileNode*>* children() const { return &children_list_; }
   unsigned id() const { return id_; }

   void Print(int indent);

  private:
-  INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) {
+  static bool CodeEntriesMatch(void* entry1, void* entry2) {
     return reinterpret_cast<CodeEntry*>(entry1)->IsSameAs(
         reinterpret_cast<CodeEntry*>(entry2));
   }

-  INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) {
+  static uint32_t CodeEntryHash(CodeEntry* entry) {
     return entry->GetCallUid();
   }

@@ -336,7 +334,7 @@ class ProfileGenerator {

   void RecordTickSample(const TickSample& sample);

-  INLINE(CodeMap* code_map()) { return &code_map_; }
+  CodeMap* code_map() { return &code_map_; }

   static const char* const kAnonymousFunctionName;
   static const char* const kProgramEntryName;
@@ -347,7 +345,7 @@ class ProfileGenerator {
   static const char* const kUnresolvedFunctionName;

  private:
-  INLINE(CodeEntry* EntryForVMState(StateTag tag));
+  CodeEntry* EntryForVMState(StateTag tag);

   CpuProfilesCollection* profiles_;
   CodeMap code_map_;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to