Revision: 14913
Author:   [email protected]
Date:     Mon Jun  3 02:46:32 2013
Log:      Remove unnecessary check from Logger::LogCodeObject

Logger::LogCodeObjects is the only caller of the method. And all its
call sites check for at least one of the coditions before calling
LogCodeObjects. So there is no need to check it again.

BUG=None
[email protected], [email protected]

Review URL: https://codereview.chromium.org/15980007
http://code.google.com/p/v8/source/detail?r=14913

Modified:
 /branches/bleeding_edge/src/cpu-profiler.cc
 /branches/bleeding_edge/src/log.cc

=======================================
--- /branches/bleeding_edge/src/cpu-profiler.cc Tue May 14 15:51:33 2013
+++ /branches/bleeding_edge/src/cpu-profiler.cc Mon Jun  3 02:46:32 2013
@@ -461,10 +461,7 @@
     // Enumerate stuff we already have in the heap.
     if (isolate_->heap()->HasBeenSetUp()) {
       if (!FLAG_prof_browser_mode) {
-        bool saved_log_code_flag = FLAG_log_code;
-        FLAG_log_code = true;
         isolate_->logger()->LogCodeObjects();
-        FLAG_log_code = saved_log_code_flag;
       }
       isolate_->logger()->LogCompiledFunctions();
       isolate_->logger()->LogAccessorCallbacks();
=======================================
--- /branches/bleeding_edge/src/log.cc  Tue May 14 15:51:33 2013
+++ /branches/bleeding_edge/src/log.cc  Mon Jun  3 02:46:32 2013
@@ -1581,57 +1581,55 @@


 void Logger::LogCodeObject(Object* object) {
-  if (FLAG_log_code || FLAG_ll_prof || is_logging_code_events()) {
-    Code* code_object = Code::cast(object);
-    LogEventsAndTags tag = Logger::STUB_TAG;
-    const char* description = "Unknown code from the snapshot";
-    switch (code_object->kind()) {
-      case Code::FUNCTION:
-      case Code::OPTIMIZED_FUNCTION:
-        return;  // We log this later using LogCompiledFunctions.
-      case Code::UNARY_OP_IC:   // fall through
-      case Code::BINARY_OP_IC:   // fall through
-      case Code::COMPARE_IC:  // fall through
-      case Code::COMPARE_NIL_IC:   // fall through
-      case Code::TO_BOOLEAN_IC:  // fall through
-      case Code::STUB:
-        description =
-            CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true);
-        if (description == NULL)
-          description = "A stub from the snapshot";
-        tag = Logger::STUB_TAG;
-        break;
-      case Code::BUILTIN:
-        description = "A builtin from the snapshot";
-        tag = Logger::BUILTIN_TAG;
-        break;
-      case Code::KEYED_LOAD_IC:
-        description = "A keyed load IC from the snapshot";
-        tag = Logger::KEYED_LOAD_IC_TAG;
-        break;
-      case Code::LOAD_IC:
-        description = "A load IC from the snapshot";
-        tag = Logger::LOAD_IC_TAG;
-        break;
-      case Code::STORE_IC:
-        description = "A store IC from the snapshot";
-        tag = Logger::STORE_IC_TAG;
-        break;
-      case Code::KEYED_STORE_IC:
-        description = "A keyed store IC from the snapshot";
-        tag = Logger::KEYED_STORE_IC_TAG;
-        break;
-      case Code::CALL_IC:
-        description = "A call IC from the snapshot";
-        tag = Logger::CALL_IC_TAG;
-        break;
-      case Code::KEYED_CALL_IC:
-        description = "A keyed call IC from the snapshot";
-        tag = Logger::KEYED_CALL_IC_TAG;
-        break;
-    }
-    PROFILE(isolate_, CodeCreateEvent(tag, code_object, description));
+  Code* code_object = Code::cast(object);
+  LogEventsAndTags tag = Logger::STUB_TAG;
+  const char* description = "Unknown code from the snapshot";
+  switch (code_object->kind()) {
+    case Code::FUNCTION:
+    case Code::OPTIMIZED_FUNCTION:
+      return;  // We log this later using LogCompiledFunctions.
+    case Code::UNARY_OP_IC:   // fall through
+    case Code::BINARY_OP_IC:   // fall through
+    case Code::COMPARE_IC:  // fall through
+    case Code::COMPARE_NIL_IC:   // fall through
+    case Code::TO_BOOLEAN_IC:  // fall through
+    case Code::STUB:
+      description =
+          CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true);
+      if (description == NULL)
+        description = "A stub from the snapshot";
+      tag = Logger::STUB_TAG;
+      break;
+    case Code::BUILTIN:
+      description = "A builtin from the snapshot";
+      tag = Logger::BUILTIN_TAG;
+      break;
+    case Code::KEYED_LOAD_IC:
+      description = "A keyed load IC from the snapshot";
+      tag = Logger::KEYED_LOAD_IC_TAG;
+      break;
+    case Code::LOAD_IC:
+      description = "A load IC from the snapshot";
+      tag = Logger::LOAD_IC_TAG;
+      break;
+    case Code::STORE_IC:
+      description = "A store IC from the snapshot";
+      tag = Logger::STORE_IC_TAG;
+      break;
+    case Code::KEYED_STORE_IC:
+      description = "A keyed store IC from the snapshot";
+      tag = Logger::KEYED_STORE_IC_TAG;
+      break;
+    case Code::CALL_IC:
+      description = "A call IC from the snapshot";
+      tag = Logger::CALL_IC_TAG;
+      break;
+    case Code::KEYED_CALL_IC:
+      description = "A keyed call IC from the snapshot";
+      tag = Logger::KEYED_CALL_IC_TAG;
+      break;
   }
+  PROFILE(isolate_, CodeCreateEvent(tag, code_object, description));
 }


--
--
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