]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - bytecode/StructureStubInfo.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / bytecode / StructureStubInfo.cpp
index 70cf2fccb0fb8e35e6f78589c5020009d6fdc92b..5ea530c8aa6bea90cda9a41cb85c4940b2250d7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include "StructureStubInfo.h"
 
 #include "JSObject.h"
+#include "PolymorphicGetByIdList.h"
 #include "PolymorphicPutByIdList.h"
 
-
 namespace JSC {
 
 #if ENABLE(JIT)
 void StructureStubInfo::deref()
 {
     switch (accessType) {
-    case access_get_by_id_self_list: {
-        PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
-        delete polymorphicStructures;
-        return;
-    }
-    case access_get_by_id_proto_list: {
-        PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList;
-        delete polymorphicStructures;
+    case access_get_by_id_list: {
+        delete u.getByIdList.list;
         return;
     }
     case access_put_by_id_list:
         delete u.putByIdList.list;
         return;
+    case access_in_list: {
+        PolymorphicAccessStructureList* polymorphicStructures = u.inList.structureList;
+        delete polymorphicStructures;
+        return;
+    }
     case access_get_by_id_self:
-    case access_get_by_id_proto:
-    case access_get_by_id_chain:
     case access_put_by_id_transition_normal:
     case access_put_by_id_transition_direct:
     case access_put_by_id_replace:
     case access_unset:
-    case access_get_by_id_generic:
-    case access_put_by_id_generic:
-    case access_get_array_length:
-    case access_get_string_length:
         // These instructions don't have to release any allocated memory
         return;
     default:
@@ -67,32 +60,15 @@ void StructureStubInfo::deref()
     }
 }
 
-bool StructureStubInfo::visitWeakReferences()
+bool StructureStubInfo::visitWeakReferences(RepatchBuffer& repatchBuffer)
 {
     switch (accessType) {
     case access_get_by_id_self:
         if (!Heap::isMarked(u.getByIdSelf.baseObjectStructure.get()))
             return false;
         break;
-    case access_get_by_id_proto:
-        if (!Heap::isMarked(u.getByIdProto.baseObjectStructure.get())
-            || !Heap::isMarked(u.getByIdProto.prototypeStructure.get()))
-            return false;
-        break;
-    case access_get_by_id_chain:
-        if (!Heap::isMarked(u.getByIdChain.baseObjectStructure.get())
-            || !Heap::isMarked(u.getByIdChain.chain.get()))
-            return false;
-        break;
-    case access_get_by_id_self_list: {
-        PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
-        if (!polymorphicStructures->visitWeak(u.getByIdSelfList.listSize))
-            return false;
-        break;
-    }
-    case access_get_by_id_proto_list: {
-        PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList;
-        if (!polymorphicStructures->visitWeak(u.getByIdProtoList.listSize))
+    case access_get_by_id_list: {
+        if (!u.getByIdList.list->visitWeak(repatchBuffer))
             return false;
         break;
     }
@@ -108,9 +84,15 @@ bool StructureStubInfo::visitWeakReferences()
             return false;
         break;
     case access_put_by_id_list:
-        if (!u.putByIdList.list->visitWeak())
+        if (!u.putByIdList.list->visitWeak(repatchBuffer))
+            return false;
+        break;
+    case access_in_list: {
+        PolymorphicAccessStructureList* polymorphicStructures = u.inList.structureList;
+        if (!polymorphicStructures->visitWeak(u.inList.listSize))
             return false;
         break;
+    }
     default:
         // The rest of the instructions don't require references, so there is no need to
         // do anything.