Check code kind when resetting profiler ticks.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 2 Apr 2012 13:27:41 +0000 (13:27 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 2 Apr 2012 13:27:41 +0000 (13:27 +0000)
BUG=121147
TEST=chromium gpu_tests/WebGLConformanceTests

Review URL: https://chromiumcodereview.appspot.com/9956060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc

index 58a3463..d99338c 100644 (file)
@@ -7869,14 +7869,17 @@ void SharedFunctionInfo::AttachInitialMap(Map* map) {
 
 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);
+  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);
   }
-  set_opt_count(0);
 }