Bug 122395 - Pass VM instead of ExecState to StringObject constructor.
Summary: Pass VM instead of ExecState to StringObject constructor.
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Depends on:
Reported: 2013-10-05 16:47 PDT by Andreas Kling
Modified: 2013-10-06 11:15 PDT (History)
4 users (show)

See Also:

Patch (7.90 KB, patch)
2013-10-05 16:50 PDT, Andreas Kling
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 Sam Weinig 2013-10-05 18:09:29 PDT
Comment on attachment 213475 [details]

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>