summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
commitd0424a769059c84ae20beb3c217812792ea6726b (patch)
tree6f94a5c3db8c52c6694ee56498542a6c35417350 /Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
parent88a04ac016f57c2d78e714682445dff2e7db4ade (diff)
downloadqtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
index b2c3027b5..ed8aace66 100644
--- a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
@@ -26,15 +26,37 @@
#include "config.h"
#include "RegExpMatchesArray.h"
+#include "ButterflyInlineMethods.h"
+#include "SparseArrayValueMapInlineMethods.h"
+
namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(RegExpMatchesArray);
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)
+ , m_result(result)
+ , m_state(ReifiedNone)
+{
+ m_input.set(globalData, this, input);
+ m_regExp.set(globalData, 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);
+ return array;
+}
+
void RegExpMatchesArray::finishCreation(JSGlobalData& globalData)
{
- Base::finishCreation(globalData, m_regExp->numSubpatterns() + 1);
+ Base::finishCreation(globalData);
}
void RegExpMatchesArray::visitChildren(JSCell* cell, SlotVisitor& visitor)