- use custom single-threaded malloc for all non-GC JavaScriptCore
allocations, for a 9.1% speedup on JavaScript iBench
* khtml/ecma/kjs_binding.cpp:
(UString::UString):
* khtml/ecma/kjs_proxy.cpp:
(KJSProxyImpl::evaluate):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9019
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-04-12 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Richard.
+
+ - use custom single-threaded malloc for all non-GC JavaScriptCore
+ allocations, for a 9.1% speedup on JavaScript iBench
+
+ * khtml/ecma/kjs_binding.cpp:
+ (UString::UString):
+ * khtml/ecma/kjs_proxy.cpp:
+ (KJSProxyImpl::evaluate):
+
2005-04-15 David Hyatt <hyatt@apple.com>
Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
UString::UString(const QString &d)
{
- unsigned int len = d.length();
- UChar *dat = new UChar[len];
- memcpy(dat, d.unicode(), len * sizeof(UChar));
- rep = UString::Rep::create(dat, len);
+ // reinterpret_cast is ugly but in this case safe, since QChar and UChar have the same
+ // memory layout
+ rep = UString::Rep::createCopying(reinterpret_cast<const UChar *>(d.unicode()), d.length());
}
UString::UString(const DOMString &d)
attach(&Rep::null);
return;
}
-
- unsigned int len = d.length();
- UChar *dat = new UChar[len];
- memcpy(dat, d.unicode(), len * sizeof(UChar));
- rep = UString::Rep::create(dat, len);
+ // reinterpret_cast is ugly but in this case safe, since QChar and UChar have the same
+ // memory layout
+ rep = UString::Rep::createCopying(reinterpret_cast<const UChar *>(d.unicode()), d.length());
}
DOMString UString::string() const
KJS::Interpreter::lock();
char *message = exec->exception().toObject(exec).get(exec, messagePropertyName).toString(exec).ascii();
int lineNumber = exec->exception().toObject(exec).get(exec, "line").toInt32(exec);
- UString sourceURL = exec->exception().toObject(exec).get(exec, "sourceURL").toString(exec);
+ QString sourceURL;
+ {
+ // put this in a block to make sure UString is deallocated inside the lock
+ UString uSourceURL = exec->exception().toObject(exec).get(exec, "sourceURL").toString(exec);
+ sourceURL = uSourceURL.qstring();
+ }
KJS::Interpreter::unlock();
if (Interpreter::shouldPrintExceptions()) {
printf("(event handler):%s\n", message);
}
- KWQ(part)->addMessageToConsole(message, lineNumber, sourceURL.qstring());
+ KWQ(part)->addMessageToConsole(message, lineNumber, sourceURL);
exec->clearException();
}
#else
m_script->setInlineCode(inlineCode);
KJS::Value thisNode = n.isNull() ? Window::retrieve( m_part ) : getDOMNode(m_script->globalExec(),n);
+ KJS::Interpreter::lock();
UString code( str );
+ KJS::Interpreter::unlock();
+
Completion comp = m_script->evaluate(filename, baseLine, code, thisNode);
bool success = ( comp.complType() == Normal ) || ( comp.complType() == ReturnValue );
#ifdef KJS_DEBUGGER