<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this"
href="https://bugs.webkit.org/show_bug.cgi?id=144956#c37">Comment # 37</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this"
href="https://bugs.webkit.org/show_bug.cgi?id=144956">bug 144956</a>
from <span class="vcard"><a class="email" href="mailto:saambarati1@gmail.com" title="Saam Barati <saambarati1@gmail.com>"> <span class="fn">Saam Barati</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=256121&action=diff" name="attach_256121" title="Patch">attachment 256121</a> <a href="attachment.cgi?id=256121&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=256121&action=review">https://bugs.webkit.org/attachment.cgi?id=256121&action=review</a>
<span class="quote">> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1822
> +RegisterID* BytecodeGenerator::emitNewArrowFunctionExpression(RegisterID* r0, FuncExprNode* n)</span >
Use better variable names here. I'd use 'destination' and 'function' or something similar.
<span class="quote">> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:4522
> +void SpeculativeJIT::compileNewArrowFunction(Node* node)</span >
This and compileNewFunction(.) share a lot of code. I'd find a way to abstract out the common bits into a helper function.
<span class="quote">> Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp:3145
> + void compileNewArrowFunction()</span >
Ditto here. Find a way to abstract this.
<span class="quote">> Source/JavaScriptCore/jit/JITOpcodes.cpp:1003
> +void JIT::emit_op_new_arrow_func_exp(Instruction* currentInstruction)</span >
Ditto. Find a way to abstract this. It's not good to have two functions doing almost identical computations.
<span class="quote">> Source/JavaScriptCore/jit/JITOpcodes.cpp:1011
> + store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, sizeof(Register) * dst));</span >
Do we have a helper function for this?
<span class="quote">> Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:177
> +#define LLINT_CALC_PROPERTY_FOR_FUNC_EXPR() \</span >
I don't love this being a macro. Maybe you can create one function that returns JSFunction and op_new_func_exp can just return that while op_new_arrow_func can use it as a helper function.
<span class="quote">> Source/JavaScriptCore/runtime/JSArrowFunction.cpp:1
> +/*</span >
I still need to read through this and the rest of the patch.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>