Changeset 197416 in webkit for trunk/Source/JavaScriptCore/runtime
- Timestamp:
- Mar 1, 2016, 3:35:05 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r197408 r197416 447 447 } 448 448 449 static NEVER_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSString* string, const String& source, RegExp* regExp)449 static ALWAYS_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSString* string, const String& source, RegExp* regExp) 450 450 { 451 451 size_t lastIndex = 0; … … 507 507 } 508 508 509 // FIXME: This is wrong because we may be called directly from the FTL. 510 // https://bugs.webkit.org/show_bug.cgi?id=154874 509 511 RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor(); 510 512 … … 663 665 664 666 return JSValue::encode(jsSpliceSubstringsWithSeparators(exec, string, source, sourceRanges.data(), sourceRanges.size(), replacements.data(), replacements.size())); 667 } 668 669 EncodedJSValue JIT_OPERATION operationStringProtoFuncReplaceRegExpEmptyStr( 670 ExecState* exec, JSString* thisValue, RegExpObject* searchValue) 671 { 672 RegExp* regExp = searchValue->regExp(); 673 if (regExp->global()) { 674 // ES5.1 15.5.4.10 step 8.a. 675 searchValue->setLastIndex(exec, 0); 676 if (exec->hadException()) 677 return JSValue::encode(jsUndefined()); 678 return removeUsingRegExpSearch(exec, thisValue, thisValue->value(exec), regExp); 679 } 680 681 CallData callData; 682 String replacementString = emptyString(); 683 return replaceUsingRegExpSearch( 684 exec, thisValue, searchValue, callData, CallTypeNone, replacementString, JSValue()); 665 685 } 666 686 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.h
r197408 r197416 55 55 56 56 EncodedJSValue JIT_OPERATION operationStringProtoFuncReplaceGeneric( 57 ExecState* exec, EncodedJSValue thisValue, EncodedJSValue searchValue, 58 EncodedJSValue replaceValue); 57 ExecState*, EncodedJSValue thisValue, EncodedJSValue searchValue, EncodedJSValue replaceValue); 58 59 EncodedJSValue JIT_OPERATION operationStringProtoFuncReplaceRegExpEmptyStr( 60 ExecState*, JSString* thisValue, RegExpObject* searchValue); 59 61 60 62 EncodedJSValue JIT_OPERATION operationStringProtoFuncReplaceRegExpString( 61 ExecState* exec, JSString* thisValue, RegExpObject* searchValue, JSString* replaceValue);63 ExecState*, JSString* thisValue, RegExpObject* searchValue, JSString* replaceValue); 62 64 63 65 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.