Revision: 21440
Author:   [email protected]
Date:     Thu May 22 15:11:11 2014 UTC
Log:      ClearTypeFeedbackInfo() assumed we have a context in the isolate.

Better, is to compare against the context for the JSFunction we are
currently looking at.

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu May 22 13:59:37 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc      Thu May 22 15:11:11 2014 UTC
@@ -11245,19 +11245,6 @@
 void SharedFunctionInfo::ClearTypeFeedbackInfo() {
   FixedArray* vector = feedback_vector();
   Heap* heap = GetHeap();
-  JSFunction* array_function = NULL;
-
-  // Clearing type feedback can be called when the contexts are still being
-  // set up so caution is required.
-  Context* context = GetIsolate()->context();
-  if (context != NULL) {
-    Context* native_context = context->native_context();
-    Object* candidate = native_context->get(Context::ARRAY_FUNCTION_INDEX);
-    if (candidate->IsJSFunction()) {
-      array_function = JSFunction::cast(candidate);
-    }
-  }
-
   int length = vector->length();

   for (int i = 0; i < length; i++) {
@@ -11272,8 +11259,12 @@
           break;
         case JS_FUNCTION_TYPE:
           // No need to clear the native context array function.
-          if (obj == array_function) break;
+          if (obj == JSFunction::cast(obj)->context()->native_context()->
+              get(Context::ARRAY_FUNCTION_INDEX)) {
+            break;
+          }
           // Fall through...
+
         default:
           vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap),
                       SKIP_WRITE_BARRIER);

--
--
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/d/optout.

Reply via email to