summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/StringConstructor.cpp
diff options
context:
space:
mode:
authorLeon Clarke <leonclarke@google.com>2010-06-03 14:33:32 +0100
committerLeon Clarke <leonclarke@google.com>2010-06-08 12:24:51 +0100
commit5af96e2c7b73ebc627c6894727826a7576d31758 (patch)
treef9d5e6f6175ccd7e3d14de9b290f08937a0d17ba /JavaScriptCore/runtime/StringConstructor.cpp
parent8cc4fcf4f6adcbc0e0aebfc24fbad9a4cddf2cfb (diff)
downloadexternal_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.zip
external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.gz
external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.bz2
Merge webkit.org at r60469 : Initial merge by git.
Change-Id: I66a0047aa2af802f66bb0c7f2a8b02247a596234
Diffstat (limited to 'JavaScriptCore/runtime/StringConstructor.cpp')
-rw-r--r--JavaScriptCore/runtime/StringConstructor.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/JavaScriptCore/runtime/StringConstructor.cpp b/JavaScriptCore/runtime/StringConstructor.cpp
index b5c46b6..c1484c5 100644
--- a/JavaScriptCore/runtime/StringConstructor.cpp
+++ b/JavaScriptCore/runtime/StringConstructor.cpp
@@ -30,21 +30,21 @@
namespace JSC {
-static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec, const ArgList& args)
+static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec)
{
- unsigned length = args.size();
+ unsigned length = exec->argumentCount();
UChar* buf;
PassRefPtr<UStringImpl> impl = UStringImpl::createUninitialized(length, buf);
for (unsigned i = 0; i < length; ++i)
- buf[i] = static_cast<UChar>(args.at(i).toUInt32(exec));
+ buf[i] = static_cast<UChar>(exec->argument(i).toUInt32(exec));
return jsString(exec, impl);
}
-static JSValue JSC_HOST_CALL stringFromCharCode(ExecState* exec, JSObject*, JSValue, const ArgList& args)
+static JSValue JSC_HOST_CALL stringFromCharCode(ExecState* exec)
{
- if (LIKELY(args.size() == 1))
- return jsSingleCharacterString(exec, args.at(0).toUInt32(exec));
- return stringFromCharCodeSlowCase(exec, args);
+ if (LIKELY(exec->argumentCount() == 1))
+ return jsSingleCharacterString(exec, exec->argument(0).toUInt32(exec));
+ return stringFromCharCodeSlowCase(exec);
}
ASSERT_CLASS_FITS_IN_CELL(StringConstructor);
@@ -56,7 +56,7 @@ StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObje
putDirectWithoutTransition(exec->propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete);
// ECMA 15.5.3.2 fromCharCode()
-#if ENABLE(JIT)
+#if ENABLE(JIT) && ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, exec->globalData().getHostFunction(stringFromCharCode, fromCharCodeThunkGenerator)), DontEnum);
#else
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum);
@@ -80,11 +80,11 @@ ConstructType StringConstructor::getConstructData(ConstructData& constructData)
}
// ECMA 15.5.1
-static JSValue JSC_HOST_CALL callStringConstructor(ExecState* exec, JSObject*, JSValue, const ArgList& args)
+static JSValue JSC_HOST_CALL callStringConstructor(ExecState* exec)
{
- if (args.isEmpty())
+ if (!exec->argumentCount())
return jsEmptyString(exec);
- return jsString(exec, args.at(0).toString(exec));
+ return jsString(exec, exec->argument(0).toString(exec));
}
CallType StringConstructor::getCallData(CallData& callData)