diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp index 19f3b81ad..062650a86 100644 --- a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp +++ b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp @@ -27,33 +27,34 @@ #include "RegExpMatchesArray.h" #include "ButterflyInlines.h" +#include "Operations.h" namespace JSC { const ClassInfo RegExpMatchesArray::s_info = {"Array", &JSArray::s_info, 0, 0, CREATE_METHOD_TABLE(RegExpMatchesArray)}; -RegExpMatchesArray::RegExpMatchesArray(JSGlobalData& globalData, Butterfly* butterfly, JSGlobalObject* globalObject, JSString* input, RegExp* regExp, MatchResult result) - : JSArray(globalData, globalObject->regExpMatchesArrayStructure(), butterfly) +RegExpMatchesArray::RegExpMatchesArray(VM& vm, Butterfly* butterfly, JSGlobalObject* globalObject, JSString* input, RegExp* regExp, MatchResult result) + : JSArray(vm, globalObject->regExpMatchesArrayStructure(), butterfly) , m_result(result) , m_state(ReifiedNone) { - m_input.set(globalData, this, input); - m_regExp.set(globalData, this, regExp); + m_input.set(vm, this, input); + m_regExp.set(vm, this, regExp); } RegExpMatchesArray* RegExpMatchesArray::create(ExecState* exec, JSString* input, RegExp* regExp, MatchResult result) { ASSERT(result); - JSGlobalData& globalData = exec->globalData(); - Butterfly* butterfly = createArrayButterfly(globalData, regExp->numSubpatterns() + 1); - RegExpMatchesArray* array = new (NotNull, allocateCell<RegExpMatchesArray>(globalData.heap)) RegExpMatchesArray(globalData, butterfly, exec->lexicalGlobalObject(), input, regExp, result); - array->finishCreation(globalData); + VM& vm = exec->vm(); + Butterfly* butterfly = createArrayButterfly(vm, regExp->numSubpatterns() + 1); + RegExpMatchesArray* array = new (NotNull, allocateCell<RegExpMatchesArray>(vm.heap)) RegExpMatchesArray(vm, butterfly, exec->lexicalGlobalObject(), input, regExp, result); + array->finishCreation(vm); return array; } -void RegExpMatchesArray::finishCreation(JSGlobalData& globalData) +void RegExpMatchesArray::finishCreation(VM& vm) { - Base::finishCreation(globalData); + Base::finishCreation(vm); } void RegExpMatchesArray::visitChildren(JSCell* cell, SlotVisitor& visitor) @@ -77,7 +78,7 @@ void RegExpMatchesArray::reifyAllProperties(ExecState* exec) if (unsigned numSubpatterns = m_regExp->numSubpatterns()) { Vector<int, 32> subpatternResults; - int position = m_regExp->match(exec->globalData(), m_input->value(exec), m_result.start, subpatternResults); + int position = m_regExp->match(exec->vm(), m_input->value(exec), m_result.start, subpatternResults); ASSERT_UNUSED(position, position >= 0 && static_cast<size_t>(position) == m_result.start); ASSERT(m_result.start == static_cast<size_t>(subpatternResults[0])); ASSERT(m_result.end == static_cast<size_t>(subpatternResults[1])); |