Revision: 11208
Author:   [email protected]
Date:     Mon Apr  2 06:27:41 2012
Log:      Check code kind when resetting profiler ticks.

BUG=121147
TEST=chromium gpu_tests/WebGLConformanceTests

Review URL: https://chromiumcodereview.appspot.com/9956060
http://code.google.com/p/v8/source/detail?r=11208

Modified:
 /branches/bleeding_edge/src/objects.cc

=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Apr  2 01:26:30 2012
+++ /branches/bleeding_edge/src/objects.cc      Mon Apr  2 06:27:41 2012
@@ -7869,14 +7869,17 @@

 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) {
   code()->ClearInlineCaches();
-  code()->set_profiler_ticks(0);
   set_ic_age(new_ic_age);
- if (optimization_disabled() && opt_count() >= Compiler::kDefaultMaxOptCount) { - // Re-enable optimizations if they were disabled due to opt_count limit.
-    set_optimization_disabled(false);
-    code()->set_optimizable(true);
-  }
-  set_opt_count(0);
+  if (code()->kind() == Code::FUNCTION) {
+    code()->set_profiler_ticks(0);
+    if (optimization_disabled() &&
+        opt_count() >= Compiler::kDefaultMaxOptCount) {
+ // Re-enable optimizations if they were disabled due to opt_count limit.
+      set_optimization_disabled(false);
+      code()->set_optimizable(true);
+    }
+    set_opt_count(0);
+  }
 }


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

Reply via email to