Commit 6e00d03d authored by oliver@apple.com's avatar oliver@apple.com

Revert last change, something weird happened when I went to land.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 83ea3ae7
2011-05-25 Oliver Hunt <oliver@apple.com>
Revert last change, something weird happened when I went to land.
2011-05-25 Oliver Hunt <oliver@apple.com>
Reviewed by Geoffrey Garen.
......
......@@ -137,7 +137,7 @@ __ZN3JSC12JSGlobalData22clearBuiltinStructuresEv
__ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeE
__ZN3JSC12JSGlobalDataD1Ev
__ZN3JSC12RegExpObject6s_infoE
__ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEPNS_9StructureEPNS_6RegExpE
__ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEPNS_9StructureEN3WTF17NonNullPassRefPtrINS_6RegExpEEE
__ZN3JSC12SamplingTool5setupEv
__ZN3JSC12SmallStrings17createEmptyStringEPNS_12JSGlobalDataE
__ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh
......
......@@ -18,7 +18,7 @@ EXPORTS
??0MD5@WTF@@QAE@XZ
??0Mutex@WTF@@QAE@XZ
??0RefCountedLeakCounter@WTF@@QAE@PBD@Z
??0RegExpObject@JSC@@QAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@JSC@@@WTF@@@Z
??0RegExpObject@JSC@@QAE@PAVJSGlobalObject@1@PAVStructure@1@V?$NonNullPassRefPtr@VRegExp@JSC@@@WTF@@@Z
??0SHA1@WTF@@QAE@XZ
??0StringObject@JSC@@QAE@PAVExecState@1@PAVStructure@1@ABVUString@1@@Z
??0Structure@JSC@@AAE@AAVJSGlobalData@1@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z
......
......@@ -1470,13 +1470,8 @@ void CodeBlock::visitAggregate(SlotVisitor& visitor)
{
visitor.append(&m_globalObject);
visitor.append(&m_ownerExecutable);
if (m_rareData) {
if (m_rareData)
m_rareData->m_evalCodeCache.visitAggregate(visitor);
size_t regExpCount = m_rareData->m_regexps.size();
WriteBarrier<RegExp>* regexps = m_rareData->m_regexps.data();
for (size_t i = 0; i < regExpCount; i++)
visitor.append(regexps + i);
}
visitor.appendValues(m_constantRegisters.data(), m_constantRegisters.size());
for (size_t i = 0; i < m_functionExprs.size(); ++i)
visitor.append(&m_functionExprs[i]);
......
......@@ -36,7 +36,7 @@
#include "JSGlobalObject.h"
#include "JumpTable.h"
#include "Nodes.h"
#include "RegExpObject.h"
#include "RegExp.h"
#include "UString.h"
#include <wtf/FastAllocBase.h>
#include <wtf/PassOwnPtr.h>
......@@ -451,13 +451,7 @@ namespace JSC {
}
FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); }
unsigned addRegExp(RegExp* r)
{
createRareDataIfNecessary();
unsigned size = m_rareData->m_regexps.size();
m_rareData->m_regexps.append(WriteBarrier<RegExp>(*m_globalData, ownerExecutable(), r));
return size;
}
unsigned addRegExp(PassRefPtr<RegExp> r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; }
RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); }
JSGlobalObject* globalObject() { return m_globalObject.get(); }
......@@ -561,7 +555,7 @@ namespace JSC {
Vector<HandlerInfo> m_exceptionHandlers;
// Rare Constants
Vector<WriteBarrier<RegExp> > m_regexps;
Vector<RefPtr<RegExp> > m_regexps;
// Jump Tables
Vector<SimpleJumpTable> m_immediateSwitchJumpTables;
......
......@@ -966,7 +966,7 @@ RegisterID* BytecodeGenerator::addConstantValue(JSValue v)
return &m_constantPoolRegisters[index];
}
unsigned BytecodeGenerator::addRegExp(RegExp* r)
unsigned BytecodeGenerator::addRegExp(PassRefPtr<RegExp> r)
{
return m_codeBlock->addRegExp(r);
}
......@@ -1592,7 +1592,7 @@ RegisterID* BytecodeGenerator::emitNewFunctionInternal(RegisterID* dst, unsigned
return dst;
}
RegisterID* BytecodeGenerator::emitNewRegExp(RegisterID* dst, RegExp* regExp)
RegisterID* BytecodeGenerator::emitNewRegExp(RegisterID* dst, PassRefPtr<RegExp> regExp)
{
emitOpcode(op_new_regexp);
instructions().append(dst->index());
......
......@@ -291,7 +291,7 @@ namespace JSC {
RegisterID* emitLazyNewFunction(RegisterID* dst, FunctionBodyNode* body);
RegisterID* emitNewFunctionInternal(RegisterID* dst, unsigned index, bool shouldNullCheck);
RegisterID* emitNewFunctionExpression(RegisterID* dst, FuncExprNode* func);
RegisterID* emitNewRegExp(RegisterID* dst, RegExp*);
RegisterID* emitNewRegExp(RegisterID* dst, PassRefPtr<RegExp> regExp);
RegisterID* emitMove(RegisterID* dst, RegisterID* src);
......@@ -475,7 +475,7 @@ namespace JSC {
unsigned addConstant(const Identifier&);
RegisterID* addConstantValue(JSValue);
unsigned addRegExp(RegExp*);
unsigned addRegExp(PassRefPtr<RegExp>);
FunctionExecutable* makeFunction(ExecState* exec, FunctionBodyNode* body)
{
......
......@@ -3163,8 +3163,8 @@ DEFINE_STUB_FUNCTION(JSObject*, op_new_regexp)
CallFrame* callFrame = stackFrame.callFrame;
RegExpHolder* regExp = stackFrame.args[0].regExp();
if (!regExp->get()->isValid()) {
RegExp* regExp = stackFrame.args[0].regExp();
if (!regExp->isValid()) {
stackFrame.globalData->exception = createSyntaxError(callFrame, "Invalid flags supplied to RegExp constructor.");
VM_THROW_EXCEPTION();
}
......
......@@ -57,7 +57,7 @@ namespace JSC {
class PropertySlot;
class PutPropertySlot;
class RegisterFile;
class RegExpHolder;
class RegExp;
template <typename T> class Weak;
......@@ -72,7 +72,7 @@ namespace JSC {
int32_t int32() { return asInt32; }
CodeBlock* codeBlock() { return static_cast<CodeBlock*>(asPointer); }
FunctionExecutable* function() { return static_cast<FunctionExecutable*>(asPointer); }
RegExpHolder* regExp() { return static_cast<RegExpHolder*>(asPointer); }
RegExp* regExp() { return static_cast<RegExp*>(asPointer); }
JSPropertyNameIterator* propertyNameIterator() { return static_cast<JSPropertyNameIterator*>(asPointer); }
JSGlobalObject* globalObject() { return static_cast<JSGlobalObject*>(asPointer); }
JSString* jsString() { return static_cast<JSString*>(asPointer); }
......
......@@ -71,7 +71,6 @@ namespace JSC {
friend class ScopeChainNode;
friend class Structure;
friend class StructureChain;
friend class RegExp;
enum CreatingEarlyCellTag { CreatingEarlyCell };
protected:
......
......@@ -52,7 +52,6 @@
#include "Nodes.h"
#include "Parser.h"
#include "RegExpCache.h"
#include "RegExpObject.h"
#include "StrictEvalActivation.h"
#include <wtf/WTFThreadData.h>
#if ENABLE(REGEXP_TRACING)
......@@ -220,7 +219,6 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
programExecutableStructure.set(*this, ProgramExecutable::createStructure(*this, jsNull()));
functionExecutableStructure.set(*this, FunctionExecutable::createStructure(*this, jsNull()));
dummyMarkableCellStructure.set(*this, JSCell::createDummyStructure(*this));
regExpStructure.set(*this, RegExp::createStructure(*this, jsNull()));
structureChainStructure.set(*this, StructureChain::createStructure(*this, jsNull()));
#if ENABLE(JSC_ZOMBIES)
......@@ -281,9 +279,8 @@ void JSGlobalData::clearBuiltinStructures()
programExecutableStructure.clear();
functionExecutableStructure.clear();
dummyMarkableCellStructure.clear();
regExpStructure.clear();
structureChainStructure.clear();
#if ENABLE(JSC_ZOMBIES)
zombieStructure.clear();
#endif
......@@ -449,7 +446,7 @@ void JSGlobalData::recompileAllJSFunctions()
}
#if ENABLE(REGEXP_TRACING)
void JSGlobalData::addRegExpToTrace(RegExp* regExp)
void JSGlobalData::addRegExpToTrace(PassRefPtr<RegExp> regExp)
{
m_rtTraceList->add(regExp);
}
......
......@@ -174,7 +174,6 @@ namespace JSC {
Strong<Structure> programExecutableStructure;
Strong<Structure> functionExecutableStructure;
Strong<Structure> dummyMarkableCellStructure;
Strong<Structure> regExpStructure;
Strong<Structure> structureChainStructure;
#if ENABLE(JSC_ZOMBIES)
......
......@@ -222,9 +222,7 @@ void JSGlobalObject::reset(JSValue prototype)
m_datePrototype.set(exec->globalData(), this, new (exec) DatePrototype(exec, this, DatePrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
m_dateStructure.set(exec->globalData(), this, DateInstance::createStructure(exec->globalData(), m_datePrototype.get()));
RegExp* emptyRegex = RegExp::create(&exec->globalData(), "", NoFlags);
m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), emptyRegex));
m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
m_regExpStructure.set(exec->globalData(), this, RegExpObject::createStructure(exec->globalData(), m_regExpPrototype.get()));
m_methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec));
......
......@@ -34,8 +34,6 @@
namespace JSC {
const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0 };
RegExpFlags regExpFlags(const UString& string)
{
RegExpFlags flags = NoFlags;
......@@ -75,9 +73,8 @@ struct RegExpRepresentation {
OwnPtr<Yarr::BytecodePattern> m_regExpBytecode;
};
inline RegExp::RegExp(JSGlobalData* globalData, const UString& patternString, RegExpFlags flags)
: JSCell(*globalData, globalData->regExpStructure.get())
, m_state(NotCompiled)
inline RegExp::RegExp(JSGlobalData*, const UString& patternString, RegExpFlags flags)
: m_state(NotCompiled)
, m_patternString(patternString)
, m_flags(flags)
, m_constructionError(0)
......@@ -98,13 +95,13 @@ RegExp::~RegExp()
{
}
RegExp* RegExp::create(JSGlobalData* globalData, const UString& patternString, RegExpFlags flags)
PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& patternString, RegExpFlags flags)
{
RegExp* res = new (globalData) RegExp(globalData, patternString, flags);
RefPtr<RegExp> res = adoptRef(new RegExp(globalData, patternString, flags));
#if ENABLE(REGEXP_TRACING)
globalData->addRegExpToTrace(res);
#endif
return res;
return res.release();
}
void RegExp::compile(JSGlobalData* globalData)
......@@ -197,10 +194,6 @@ int RegExp::match(JSGlobalData& globalData, const UString& s, int startOffset, V
return -1;
}
void RegExp::invalidateCode()
{
m_representation.clear();
}
#if ENABLE(YARR_JIT_DEBUG)
void RegExp::matchCompareWithInterpreter(const UString& s, int startOffset, int* offsetVector, int jitResult)
......
......@@ -24,7 +24,6 @@
#include "UString.h"
#include "ExecutableAllocator.h"
#include "Structure.h"
#include "RegExpKey.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
......@@ -36,9 +35,9 @@ namespace JSC {
RegExpFlags regExpFlags(const UString&);
class RegExp : public JSCell {
class RegExp : public RefCounted<RegExp> {
public:
static RegExp* create(JSGlobalData*, const UString& pattern, RegExpFlags);
static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern, RegExpFlags);
~RegExp();
bool global() const { return m_flags & FlagGlobal; }
......@@ -53,19 +52,10 @@ namespace JSC {
int match(JSGlobalData&, const UString&, int startOffset, Vector<int, 32>* ovector = 0);
unsigned numSubpatterns() const { return m_numSubpatterns; }
void invalidateCode();
#if ENABLE(REGEXP_TRACING)
void printTraceData();
#endif
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
return Structure::create(globalData, prototype, TypeInfo(LeafType, 0), 0, &s_info);
}
static JS_EXPORTDATA const ClassInfo s_info;
private:
RegExp(JSGlobalData* globalData, const UString& pattern, RegExpFlags);
......
......@@ -28,31 +28,31 @@
#include "config.h"
#include "RegExpCache.h"
#include "RegExpObject.h"
namespace JSC {
RegExp* RegExpCache::lookupOrCreate(const UString& patternString, RegExpFlags flags)
PassRefPtr<RegExp> RegExpCache::lookupOrCreate(const UString& patternString, RegExpFlags flags)
{
if (patternString.length() < maxCacheablePatternLength) {
pair<RegExpCacheMap::iterator, bool> result = m_cacheMap.add(RegExpKey(flags, patternString), Strong<RegExp>());
pair<RegExpCacheMap::iterator, bool> result = m_cacheMap.add(RegExpKey(flags, patternString), 0);
if (!result.second)
return result.first->second.get();
return result.first->second;
else
return create(patternString, flags, result.first);
}
return create(patternString, flags, m_cacheMap.end());
}
RegExp* RegExpCache::create(const UString& patternString, RegExpFlags flags, RegExpCacheMap::iterator iterator)
PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, RegExpFlags flags, RegExpCacheMap::iterator iterator)
{
RegExp* regExp = RegExp::create(m_globalData, patternString, flags);
RefPtr<RegExp> regExp = RegExp::create(m_globalData, patternString, flags);
if (patternString.length() >= maxCacheablePatternLength)
return regExp;
RegExpKey key = RegExpKey(flags, patternString);
iterator->first = key;
iterator->second.set(*m_globalData, regExp);
iterator->second = regExp;
++m_nextKeyToEvict;
if (m_nextKeyToEvict == maxCacheableEntries) {
......
......@@ -27,7 +27,6 @@
#include "RegExp.h"
#include "RegExpKey.h"
#include "Strong.h"
#include "UString.h"
#include <wtf/FixedArray.h>
#include <wtf/HashMap.h>
......@@ -39,11 +38,11 @@ namespace JSC {
class RegExpCache {
typedef HashMap<RegExpKey, Strong<RegExp> > RegExpCacheMap;
typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
public:
RegExp* lookupOrCreate(const UString& patternString, RegExpFlags);
RegExp* create(const UString& patternString, RegExpFlags, RegExpCacheMap::iterator);
PassRefPtr<RegExp> lookupOrCreate(const UString& patternString, RegExpFlags);
PassRefPtr<RegExp> create(const UString& patternString, RegExpFlags, RegExpCacheMap::iterator);
RegExpCache(JSGlobalData* globalData);
private:
......
......@@ -317,10 +317,10 @@ JSObject* constructRegExp(ExecState* exec, JSGlobalObject* globalObject, const A
return throwError(exec, createSyntaxError(exec, "Invalid flags supplied to RegExp constructor."));
}
RegExp* regExp = exec->globalData().regExpCache()->lookupOrCreate(pattern, flags);
RefPtr<RegExp> regExp = exec->globalData().regExpCache()->lookupOrCreate(pattern, flags);
if (!regExp->isValid())
return throwError(exec, createSyntaxError(exec, regExp->errorMessage()));
return new (exec) RegExpObject(exec->lexicalGlobalObject(), globalObject->regExpStructure(), regExp);
return new (exec) RegExpObject(exec->lexicalGlobalObject(), globalObject->regExpStructure(), regExp.release());
}
static EncodedJSValue JSC_HOST_CALL constructWithRegExpConstructor(ExecState* exec)
......
......@@ -61,9 +61,9 @@ const ClassInfo RegExpObject::s_info = { "RegExp", &JSObjectWithGlobalObject::s_
@end
*/
RegExpObject::RegExpObject(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
RegExpObject::RegExpObject(JSGlobalObject* globalObject, Structure* structure, NonNullPassRefPtr<RegExp> regExp)
: JSObjectWithGlobalObject(globalObject, structure)
, d(adoptPtr(new RegExpObjectData(globalObject->globalData(), this, regExp)))
, d(adoptPtr(new RegExpObjectData(regExp)))
{
ASSERT(inherits(&s_info));
}
......@@ -78,8 +78,6 @@ void RegExpObject::visitChildren(SlotVisitor& visitor)
COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
ASSERT(structure()->typeInfo().overridesVisitChildren());
Base::visitChildren(visitor);
if (d->regExp)
visitor.append(&d->regExp);
if (UNLIKELY(!d->lastIndex.get().isInt32()))
visitor.append(&d->lastIndex);
}
......
......@@ -25,15 +25,15 @@
#include "RegExp.h"
namespace JSC {
class RegExpObject : public JSObjectWithGlobalObject {
public:
typedef JSObjectWithGlobalObject Base;
RegExpObject(JSGlobalObject*, Structure*, RegExp*);
RegExpObject(JSGlobalObject*, Structure*, NonNullPassRefPtr<RegExp>);
virtual ~RegExpObject();
void setRegExp(JSGlobalData& globalData, RegExp* r) { d->regExp.set(globalData, this, r); }
void setRegExp(PassRefPtr<RegExp> r) { d->regExp = r; }
RegExp* regExp() const { return d->regExp.get(); }
void setLastIndex(size_t lastIndex)
......@@ -74,13 +74,13 @@ namespace JSC {
struct RegExpObjectData {
WTF_MAKE_FAST_ALLOCATED;
public:
RegExpObjectData(JSGlobalData& globalData, RegExpObject* owner, RegExp* regExp)
: regExp(globalData, owner, regExp)
RegExpObjectData(NonNullPassRefPtr<RegExp> regExp)
: regExp(regExp)
{
lastIndex.setWithoutWriteBarrier(jsNumber(0));
}
WriteBarrier<RegExp> regExp;
RefPtr<RegExp> regExp;
WriteBarrier<Unknown> lastIndex;
};
#if COMPILER(MSVC)
......
......@@ -62,8 +62,8 @@ const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0,
ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype);
RegExpPrototype::RegExpPrototype(ExecState*, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
: RegExpObject(globalObject, structure, regExp)
RegExpPrototype::RegExpPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
: RegExpObject(globalObject, structure, RegExp::create(&exec->globalData(), "", NoFlags))
{
}
......@@ -101,7 +101,7 @@ EncodedJSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState* exec)
if (!thisValue.inherits(&RegExpObject::s_info))
return throwVMTypeError(exec);
RegExp* regExp;
RefPtr<RegExp> regExp;
JSValue arg0 = exec->argument(0);
JSValue arg1 = exec->argument(1);
......@@ -128,7 +128,7 @@ EncodedJSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState* exec)
if (!regExp->isValid())
return throwVMError(exec, createSyntaxError(exec, regExp->errorMessage()));
asRegExpObject(thisValue)->setRegExp(exec->globalData(), regExp);
asRegExpObject(thisValue)->setRegExp(regExp.release());
asRegExpObject(thisValue)->setLastIndex(0);
return JSValue::encode(jsUndefined());
}
......
......@@ -28,7 +28,7 @@ namespace JSC {
class RegExpPrototype : public RegExpObject {
public:
RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, RegExp*);
RegExpPrototype(ExecState*, JSGlobalObject*, Structure*);
static const ClassInfo s_info;
......
......@@ -606,7 +606,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
JSValue a0 = exec->argument(0);
RegExp* reg;
RefPtr<RegExp> reg;
if (a0.inherits(&RegExpObject::s_info))
reg = asRegExpObject(a0)->regExp();
else {
......@@ -620,7 +620,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
int matchLength = 0;
regExpConstructor->performMatch(*globalData, reg, s, 0, pos, matchLength);
regExpConstructor->performMatch(*globalData, reg.get(), s, 0, pos, matchLength);
if (!(reg->global())) {
// case without 'g' flag is handled like RegExp.prototype.exec
if (pos < 0)
......@@ -633,7 +633,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
while (pos >= 0) {
list.append(jsSubstring(exec, s, pos, matchLength));
pos += matchLength == 0 ? 1 : matchLength;
regExpConstructor->performMatch(*globalData, reg, s, pos, pos, matchLength);
regExpConstructor->performMatch(*globalData, reg.get(), s, pos, pos, matchLength);
}
if (list.isEmpty()) {
// if there are no matches at all, it's important to return
......@@ -655,7 +655,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
JSValue a0 = exec->argument(0);
RegExp* reg;
RefPtr<RegExp> reg;
if (a0.inherits(&RegExpObject::s_info))
reg = asRegExpObject(a0)->regExp();
else {
......@@ -669,7 +669,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
int matchLength = 0;
regExpConstructor->performMatch(*globalData, reg, s, 0, pos, matchLength);
regExpConstructor->performMatch(*globalData, reg.get(), s, 0, pos, matchLength);
return JSValue::encode(jsNumber(pos));
}
......
2011-05-25 Oliver Hunt <oliver@apple.com>
Revert last change, something weird happened when I went to land.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertQVariantToValue):
2011-05-25 James Robinson <jamesr@chromium.org>
Reviewed by Geoffrey Garen
......@@ -1166,7 +1166,7 @@ private:
return JSValue();
RegExpFlags reFlags = regExpFlags(flags->ustring());
ASSERT(reFlags != InvalidFlags);
RegExp* regExp = RegExp::create(&m_exec->globalData(), pattern->ustring(), reFlags);
RefPtr<RegExp> regExp = RegExp::create(&m_exec->globalData(), pattern->ustring(), reFlags);
return new (m_exec) RegExpObject(m_exec->lexicalGlobalObject(), m_globalObject->regExpStructure(), regExp);
}
case ObjectReferenceTag: {
......
......@@ -861,9 +861,9 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
UString pattern((UChar*)re.pattern().utf16(), re.pattern().length());
RegExpFlags flags = (re.caseSensitivity() == Qt::CaseInsensitive) ? FlagIgnoreCase : NoFlags;
JSC::RegExp* regExp = JSC::RegExp::create(&exec->globalData(), pattern, flags);
RefPtr<JSC::RegExp> regExp = JSC::RegExp::create(&exec->globalData(), pattern, flags);
if (regExp->isValid())
return new (exec) RegExpObject(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp);
return new (exec) RegExpObject(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp.release());
return jsNull();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment