Ignore:
Timestamp:
Oct 31, 2008, 12:53:20 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-31 Cameron Zwarich <[email protected]>

Reviewed by Darin Adler.

Bug 22005: Move StructureIDChain into its own file
<https://bugs.webkit.org/show_bug.cgi?id=22005>

  • GNUmakefile.am:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • runtime/StructureID.cpp:
  • runtime/StructureID.h:
  • runtime/StructureIDChain.cpp: Copied from runtime/StructureID.cpp.
  • runtime/StructureIDChain.h: Copied from runtime/StructureID.h.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/StructureID.cpp

    r38016 r38046  
    2929#include "JSObject.h"
    3030#include "PropertyNameArray.h"
     31#include "StructureIDChain.h"
    3132#include "identifier.h"
    3233#include "lookup.h"
     
    893894#endif // DO_PROPERTYMAP_CONSTENCY_CHECK
    894895
    895 // StructureIDChain
    896 
    897 StructureIDChain::StructureIDChain(StructureID* structureID)
    898 {
    899     size_t size = 1;
    900 
    901     StructureID* tmp = structureID;
    902     while (!tmp->storedPrototype()->isNull()) {
    903         ++size;
    904         tmp = asCell(tmp->storedPrototype())->structureID();
    905     }
    906    
    907     m_vector.set(new RefPtr<StructureID>[size + 1]);
    908 
    909     size_t i;
    910     for (i = 0; i < size - 1; ++i) {
    911         m_vector[i] = structureID;
    912         structureID = asObject(structureID->storedPrototype())->structureID();
    913     }
    914     m_vector[i] = structureID;
    915     m_vector[i + 1] = 0;
    916 }
    917 
    918 bool structureIDChainsAreEqual(StructureIDChain* chainA, StructureIDChain* chainB)
    919 {
    920     if (!chainA || !chainB)
    921         return false;
    922 
    923     RefPtr<StructureID>* a = chainA->head();
    924     RefPtr<StructureID>* b = chainB->head();
    925     while (1) {
    926         if (*a != *b)
    927             return false;
    928         if (!*a)
    929             return true;
    930         a++;
    931         b++;
    932     }
    933 }
    934 
    935896} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.