Bug 798624 - Specialize low-level character access to JSStableString; r=luke, rs=Waldo

Implements JSStableString::chars() and pushes StableCharPtr into the interface
at several key choke-points. This will solidly enforce the requirement that we
have uninlined jschar*s in places that we may GC with a jschar* on the stack.
This commit is contained in:
Terrence Cole
2012-10-08 15:04:36 -07:00
parent c28931850c
commit 4ef37c98f5
34 changed files with 154 additions and 129 deletions

View File

@@ -49,7 +49,7 @@ SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, JSScript
JSScript *
frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *callerFrame,
const CompileOptions &options,
const jschar *chars, size_t length,
StableCharPtr chars, size_t length,
JSString *source_ /* = NULL */,
unsigned staticLevel /* = 0 */)
{
@@ -250,7 +250,7 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call
// handler attribute in an HTML <INPUT> tag, or in a Function() constructor.
bool
frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions options,
const AutoNameVector &formals, const jschar *chars, size_t length)
const AutoNameVector &formals, StableCharPtr chars, size_t length)
{
if (!CheckLength(cx, length))
return false;