Changeset 51964 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- Dec 10, 2009, 2:13:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r51801 r51964 1044 1044 bool leftIsString = v1.isString(); 1045 1045 if (leftIsString && v2.isString()) { 1046 if (asString(v1)->isRope() || asString(v2)->isRope()) { 1047 RefPtr<JSString::Rope> rope = JSString::Rope::createOrNull(2); 1048 if (UNLIKELY(!rope)) { 1049 throwOutOfMemoryError(callFrame); 1050 VM_THROW_EXCEPTION(); 1051 } 1052 rope->initializeFiber(0, asString(v1)); 1053 rope->initializeFiber(1, asString(v2)); 1054 JSGlobalData* globalData = &callFrame->globalData(); 1055 return JSValue::encode(new (globalData) JSString(globalData, rope.release())); 1056 } 1057 1058 RefPtr<UString::Rep> value = concatenate(asString(v1)->value(callFrame).rep(), asString(v2)->value(callFrame).rep()); 1059 if (UNLIKELY(!value)) { 1060 throwOutOfMemoryError(callFrame); 1061 VM_THROW_EXCEPTION(); 1062 } 1063 1064 return JSValue::encode(jsString(stackFrame.globalData, value.release())); 1046 JSValue result = jsString(callFrame, asString(v1), asString(v2)); 1047 CHECK_FOR_EXCEPTION_AT_END(); 1048 return JSValue::encode(result); 1065 1049 } 1066 1050 … … 2852 2836 STUB_INIT_STACK_FRAME(stackFrame); 2853 2837 2854 JSValue result = concatenateStrings(stackFrame.callFrame, &stackFrame.callFrame->registers()[stackFrame.args[0].int32()], stackFrame.args[1].int32());2838 JSValue result = jsString(stackFrame.callFrame, &stackFrame.callFrame->registers()[stackFrame.args[0].int32()], stackFrame.args[1].int32()); 2855 2839 CHECK_FOR_EXCEPTION_AT_END(); 2856 2840 return JSValue::encode(result);
Note:
See TracChangeset
for help on using the changeset viewer.