Bug 122395

Summary: Pass VM instead of ExecState to StringObject constructor.
Product: WebKit Reporter: Andreas Kling <kling>
Component: JavaScriptCoreAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, commit-queue, jsbell, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch sam: review+

Description Andreas Kling 2013-10-05 16:47:46 PDT
Pass VM instead of ExecState to StringObject constructor.
Comment 1 Andreas Kling 2013-10-05 16:50:03 PDT
Created attachment 213475 [details]
Patch
Comment 2 Sam Weinig 2013-10-05 18:09:29 PDT
Comment on attachment 213475 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=213475&action=review

> Source/JavaScriptCore/runtime/StringConstructor.cpp:98
>      if (!exec->argumentCount())
> -        return JSValue::encode(StringObject::create(exec, globalObject->stringObjectStructure()));
> +        return JSValue::encode(StringObject::create(exec->vm(), globalObject->stringObjectStructure()));
>      
> -    return JSValue::encode(StringObject::create(exec, globalObject->stringObjectStructure(), exec->uncheckedArgument(0).toString(exec)));
> +    return JSValue::encode(StringObject::create(exec->vm(), globalObject->stringObjectStructure(), exec->uncheckedArgument(0).toString(exec)));

You are doing exec->vm() twice.  Can you pull it out into a local?

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:1599
> +            StringObject* obj = constructString(m_exec->vm(), m_globalObject, jsEmptyString(&m_exec->vm()));

You are doing m_exec->vm() twice here.  Can you pull it out into a local?
Comment 3 Andreas Kling 2013-10-06 11:15:31 PDT
Committed r156998: <http://trac.webkit.org/changeset/156998>