]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/JSSegmentedVariableObject.cpp
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / runtime / JSSegmentedVariableObject.cpp
index 01c070451609582a22dbbd6db1f4245341abef15..fba6f7902e0f4c32ab75ae965dca3f83dd524be8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -10,7 +10,7 @@
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission. 
  *
 #include "config.h"
 #include "JSSegmentedVariableObject.h"
 
-#include "Operations.h"
+#include "JSCInlines.h"
 
 namespace JSC {
 
 int JSSegmentedVariableObject::findRegisterIndex(void* registerAddress)
 {
+    ConcurrentJITLocker locker(m_lock);
+    
     for (int i = m_registers.size(); i--;) {
         if (&m_registers[i] != registerAddress)
             continue;
@@ -46,6 +48,8 @@ int JSSegmentedVariableObject::findRegisterIndex(void* registerAddress)
 
 int JSSegmentedVariableObject::addRegisters(int numberOfRegistersToAdd)
 {
+    ConcurrentJITLocker locker(m_lock);
+    
     ASSERT(numberOfRegistersToAdd >= 0);
     
     size_t oldSize = m_registers.size();
@@ -60,7 +64,7 @@ int JSSegmentedVariableObject::addRegisters(int numberOfRegistersToAdd)
 void JSSegmentedVariableObject::visitChildren(JSCell* cell, SlotVisitor& slotVisitor)
 {
     JSSegmentedVariableObject* thisObject = jsCast<JSSegmentedVariableObject*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     JSSymbolTableObject::visitChildren(thisObject, slotVisitor);