Changeset 37433 in webkit for trunk/JavaScriptCore/kjs/regexp.cpp
- Timestamp:
- Oct 8, 2008, 5:40:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/regexp.cpp
r37428 r37433 33 33 namespace JSC { 34 34 35 36 37 inline RegExp::RegExp(ExecState* exec, const UString& pattern) 35 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern) 38 36 : m_pattern(pattern) 39 37 , m_flagBits(0) … … 43 41 { 44 42 #if ENABLE(WREC) 45 if (!(m_wrecFunction = (WRECFunction)CTI::compileRegExp(exec, pattern, &m_numSubpatterns, &m_constructionError))) 43 m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError)); 44 if (m_wrecFunction) 45 return; 46 // Fall through to non-WREC case. 46 47 #else 47 UNUSED_PARAM( exec);48 UNUSED_PARAM(globalData); 48 49 #endif 49 { 50 m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(), 51 JSRegExpDoNotIgnoreCase, JSRegExpSingleLine, &m_numSubpatterns, &m_constructionError); 52 } 50 m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(), 51 JSRegExpDoNotIgnoreCase, JSRegExpSingleLine, &m_numSubpatterns, &m_constructionError); 53 52 } 54 53 55 PassRefPtr<RegExp> RegExp::create( ExecState* exec, const UString& pattern)54 PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern) 56 55 { 57 return adoptRef(new RegExp( exec, pattern));56 return adoptRef(new RegExp(globalData, pattern)); 58 57 } 59 58 60 inline RegExp::RegExp( ExecState* exec, const UString& pattern, const UString& flags)59 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags) 61 60 : m_pattern(pattern) 62 61 , m_flags(flags) … … 85 84 86 85 #if ENABLE(WREC) 87 if (!(m_wrecFunction = (WRECFunction)CTI::compileRegExp(exec, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)))) 86 m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline))); 87 if (m_wrecFunction) 88 return; 89 // Fall through to non-WREC case. 88 90 #else 89 UNUSED_PARAM( exec);91 UNUSED_PARAM(globalData); 90 92 #endif 91 { 92 m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(), 93 ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError); 94 } 93 m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(pattern.data()), pattern.size(), 94 ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError); 95 95 } 96 96 97 PassRefPtr<RegExp> RegExp::create( ExecState* exec, const UString& pattern, const UString& flags)97 PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags) 98 98 { 99 return adoptRef(new RegExp( exec, pattern, flags));99 return adoptRef(new RegExp(globalData, pattern, flags)); 100 100 } 101 101
Note:
See TracChangeset
for help on using the changeset viewer.