Bug 70157 - FunctionExecutable should expose the ability to create unattached FunctionCodeBlocks
Summary: FunctionExecutable should expose the ability to create unattached FunctionCod...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 69996
  Show dependency treegraph
 
Reported: 2011-10-14 16:43 PDT by Filip Pizlo
Modified: 2011-10-15 14:44 PDT (History)
1 user (show)

See Also:


Attachments
the patch (16.24 KB, patch)
2011-10-14 16:48 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch - fix style (16.20 KB, patch)
2011-10-14 16:54 PDT, Filip Pizlo
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2011-10-14 16:43:04 PDT
Inlining requires being able to create a CodeBlock that is populated with bytecode for any callee that constitutes an inlining candidate.  Currently this is not possible without a non-trivial amount of code duplication.  Since FunctionExecutable already has the code for creating FunctionCodeBlocks that are populated with bytecode (in fact it has this functionality twice), this should simply be exposed as a method.  This will also provide an opportunity to reduce some of the redundant code in FunctionExecutable.
Comment 1 Filip Pizlo 2011-10-14 16:48:22 PDT
Created attachment 111107 [details]
the patch
Comment 2 WebKit Review Bot 2011-10-14 16:50:52 PDT
Attachment 111107 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/runtime/Executable.h:465:  The parameter name "exec" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/JavaScriptCore/runtime/Executable.h:465:  The parameter name "scopeChainNode" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/JavaScriptCore/runtime/Executable.h:465:  The parameter name "compilationKind" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/JavaScriptCore/runtime/Executable.h:465:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 4 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Filip Pizlo 2011-10-14 16:54:43 PDT
Created attachment 111108 [details]
the patch - fix style
Comment 4 Geoffrey Garen 2011-10-14 17:10:57 PDT
Comment on attachment 111108 [details]
the patch - fix style

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

r=me

> Source/JavaScriptCore/runtime/Executable.cpp:416
> +        return PassOwnPtr<FunctionCodeBlock>();

I think you can just return nullptr here.

> Source/JavaScriptCore/runtime/Executable.cpp:427
> +    result = adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), specializationKind == CodeForConstruct, PassOwnPtr<FunctionCodeBlock>()));

nullptr, or maybe just make that the default function argument.

> Source/JavaScriptCore/runtime/Executable.cpp:432
> +        return PassOwnPtr<FunctionCodeBlock>();

nullptr
Comment 5 Filip Pizlo 2011-10-15 14:44:23 PDT
Landed in r97564.