Changeset 34946 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Jul 1, 2008, 11:35:03 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSGlobalObject.cpp
r34907 r34946 175 175 _prop.clear(); 176 176 symbolTable().clear(); 177 setRegisterArray(0, 0); 177 178 178 179 // Prototypes -
trunk/JavaScriptCore/kjs/JSGlobalObject.h
r34919 r34946 260 260 { 261 261 size_t registerArraySize = d()->registerArraySize; 262 Register* registerArray = static_cast<Register*>(fastMalloc((registerArraySize + count) * sizeof(Register)));262 Register* registerArray = new Register[registerArraySize + count]; 263 263 if (d()->registerArray) 264 264 memcpy(registerArray + count, d()->registerArray.get(), registerArraySize * sizeof(Register)); -
trunk/JavaScriptCore/kjs/JSVariableObject.cpp
r34906 r34946 68 68 JSObject::mark(); 69 69 70 if (!d->registerArray)70 if (!d->registerArray) 71 71 return; 72 72 … … 88 88 ASSERT(!d->registerArray); 89 89 90 Register* registerArray = static_cast<Register*>(fastMalloc(count * sizeof(Register)));90 Register* registerArray = new Register[count]; 91 91 memcpy(registerArray, src, count * sizeof(Register)); 92 92 … … 96 96 void JSVariableObject::setRegisterArray(Register* registerArray, size_t count) 97 97 { 98 d->registerArray.set(registerArray); 98 if (registerArray != d->registerArray.get()) 99 d->registerArray.set(registerArray); 99 100 d->registerArraySize = count; 100 101 d->registers = registerArray + count; -
trunk/JavaScriptCore/kjs/JSVariableObject.h
r34906 r34946 34 34 #include "SymbolTable.h" 35 35 #include "UnusedParam.h" 36 #include <wtf/Own Ptr.h>36 #include <wtf/OwnArrayPtr.h> 37 37 #include <wtf/UnusedParam.h> 38 38 … … 70 70 ASSERT(symbolTable_); 71 71 } 72 72 73 73 SymbolTable* symbolTable; // Maps name -> offset from "r" in register file. 74 74 Register* registers; // Pointers to the register past the end of local storage. (Local storage indexes are negative.) 75 Own Ptr<Register> registerArray; // Independent copy of registers, used when a variable object copies its registers out of the register file.75 OwnArrayPtr<Register> registerArray; // Independent copy of registers, used when a variable object copies its registers out of the register file. 76 76 size_t registerArraySize; 77 78 private: 79 JSVariableObjectData(const JSVariableObjectData&); 80 JSVariableObjectData& operator=(const JSVariableObjectData&); 77 81 }; 78 82
Note:
See TracChangeset
for help on using the changeset viewer.