Revision: 3812
Author: [email protected]
Date: Mon Feb  8 00:54:27 2010
Log: Move class declaration of Comment from codegen-inl.h to codegen.h

-inl.h files should only contains small inline functions and
no class declarations. Implementation moved to codegen.cc since
it's not a performance critical class (only used in DEBUG mode).

Review URL: http://codereview.chromium.org/585004
http://code.google.com/p/v8/source/detail?r=3812

Modified:
 /branches/bleeding_edge/src/codegen-inl.h
 /branches/bleeding_edge/src/codegen.cc
 /branches/bleeding_edge/src/codegen.h

=======================================
--- /branches/bleeding_edge/src/codegen-inl.h   Thu Feb  4 12:36:58 2010
+++ /branches/bleeding_edge/src/codegen-inl.h   Mon Feb  8 00:54:27 2010
@@ -49,46 +49,8 @@
 namespace v8 {
 namespace internal {

-#define __ ACCESS_MASM(masm_)
-
 Handle<Script> CodeGenerator::script() { return info_->script(); }
 bool CodeGenerator::is_eval() { return info_->is_eval(); }
-
-
-// -----------------------------------------------------------------------------
-// Support for "structured" code comments.
-//
-// By selecting matching brackets in disassembler output,
-// code segments can be identified more easily.
-
-#ifdef DEBUG
-
-class Comment BASE_EMBEDDED {
- public:
-  Comment(MacroAssembler* masm, const char* msg) : masm_(masm), msg_(msg) {
-    __ RecordComment(msg);
-  }
-
-  ~Comment() {
-    if (msg_[0] == '[') __ RecordComment("]");
-  }
-
- private:
-  MacroAssembler* masm_;
-  const char* msg_;
-};
-
-#else
-
-class Comment BASE_EMBEDDED {
- public:
-  Comment(MacroAssembler*, const char*)  {}
-};
-
-#endif  // DEBUG
-
-#undef __
-

 } }  // namespace v8::internal

=======================================
--- /branches/bleeding_edge/src/codegen.cc      Wed Feb  3 08:12:55 2010
+++ /branches/bleeding_edge/src/codegen.cc      Mon Feb  8 00:54:27 2010
@@ -42,6 +42,24 @@
 namespace v8 {
 namespace internal {

+#define __ ACCESS_MASM(masm_)
+
+#ifdef DEBUG
+
+Comment::Comment(MacroAssembler* masm, const char* msg)
+    : masm_(masm), msg_(msg) {
+  __ RecordComment(msg);
+}
+
+
+Comment::~Comment() {
+  if (msg_[0] == '[') __ RecordComment("]");
+}
+
+#endif  // DEBUG
+
+#undef __
+

 CodeGenerator* CodeGeneratorScope::top_ = NULL;

=======================================
--- /branches/bleeding_edge/src/codegen.h       Thu Feb  4 12:36:58 2010
+++ /branches/bleeding_edge/src/codegen.h       Mon Feb  8 00:54:27 2010
@@ -98,6 +98,29 @@
 namespace internal {


+// Support for "structured" code comments.
+#ifdef DEBUG
+
+class Comment BASE_EMBEDDED {
+ public:
+  Comment(MacroAssembler* masm, const char* msg);
+  ~Comment();
+
+ private:
+  MacroAssembler* masm_;
+  const char* msg_;
+};
+
+#else
+
+class Comment BASE_EMBEDDED {
+ public:
+  Comment(MacroAssembler*, const char*)  {}
+};
+
+#endif  // DEBUG
+
+
 // Code generation can be nested.  Code generation scopes form a stack
 // of active code generators.
 class CodeGeneratorScope BASE_EMBEDDED {

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to