summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/jit
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-02 18:21:35 +0000
committerSteve Block <steveblock@google.com>2010-02-04 15:06:56 +0000
commit33fc8ca0ce504ea94c9b038e11968187fc10d13e (patch)
tree3133f325e4e2fba60b28d593fcaa6a01bf93c0cc /JavaScriptCore/jit
parent5277f3a59aa76c1a40995a47261b9710c284f877 (diff)
downloadexternal_webkit-33fc8ca0ce504ea94c9b038e11968187fc10d13e.zip
external_webkit-33fc8ca0ce504ea94c9b038e11968187fc10d13e.tar.gz
external_webkit-33fc8ca0ce504ea94c9b038e11968187fc10d13e.tar.bz2
Merge webkit.org at r54127 : Take theirs for changes to JavaScript string addition.
The conflict is due to the fact that we cherry-picked a WebKit change http://trac.webkit.org/changeset/51978 to fix a bug. This change updates all files touched by this change to match webkit.org. See https://android-git.corp.google.com/g/#change,36411 Change-Id: Ie17c59467b74f3bf3be1149bebe086b92b30afc4
Diffstat (limited to 'JavaScriptCore/jit')
-rw-r--r--JavaScriptCore/jit/JITStubs.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp
index 9191907..bf5168b 100644
--- a/JavaScriptCore/jit/JITStubs.cpp
+++ b/JavaScriptCore/jit/JITStubs.cpp
@@ -1112,41 +1112,19 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_add)
JSValue v1 = stackFrame.args[0].jsValue();
JSValue v2 = stackFrame.args[1].jsValue();
-
- double left;
- double right = 0.0;
-
- bool rightIsNumber = v2.getNumber(right);
- if (rightIsNumber && v1.getNumber(left))
- return JSValue::encode(jsNumber(stackFrame.globalData, left + right));
-
CallFrame* callFrame = stackFrame.callFrame;
-<<<<<<< HEAD
- bool leftIsString = v1.isString();
- if (leftIsString && v2.isString()) {
- JSValue result = jsString(callFrame, asString(v1), asString(v2));
-=======
if (v1.isString()) {
JSValue result = v2.isString()
? jsString(callFrame, asString(v1), asString(v2))
: jsString(callFrame, asString(v1), v2.toPrimitiveString(callFrame));
->>>>>>> webkit.org at r54127
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
- if (rightIsNumber & leftIsString) {
- RefPtr<UString::Rep> value = v2.isInt32() ?
- concatenate(asString(v1)->value(callFrame).rep(), v2.asInt32()) :
- concatenate(asString(v1)->value(callFrame).rep(), right);
-
- if (UNLIKELY(!value)) {
- throwOutOfMemoryError(callFrame);
- VM_THROW_EXCEPTION();
- }
- return JSValue::encode(jsString(stackFrame.globalData, value.release()));
- }
+ double left = 0.0, right;
+ if (v1.getNumber(left) && v2.getNumber(right))
+ return JSValue::encode(jsNumber(stackFrame.globalData, left + right));
// All other cases are pretty uncommon
JSValue result = jsAddSlowCase(callFrame, v1, v2);