[Webkit-unassigned] [Bug 144956] [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 6 14:40:23 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=144956

--- Comment #40 from GSkachkov <gskachkov at gmail.com> ---
Comment on attachment 256121
  --> https://bugs.webkit.org/attachment.cgi?id=256121
Patch

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

Saam Barati: I've tried to fix comments. Please take a looks if it make sense.

>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1822
>> +RegisterID* BytecodeGenerator::emitNewArrowFunctionExpression(RegisterID* r0, FuncExprNode* n)
> 
> Use better variable names here. I'd use 'destination' and 'function' or something similar.

Refactored and renamed

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:4522
>> +void SpeculativeJIT::compileNewArrowFunction(Node* node)
> 
> This and compileNewFunction(.) share a lot of code. I'd find a way to abstract out the common bits into a helper function.

Reractored

>> Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp:3145
>> +    void compileNewArrowFunction()
> 
> Ditto here. Find a way to abstract this.

Refactored

>> Source/JavaScriptCore/jit/JITOpcodes.cpp:1003
>> +void JIT::emit_op_new_arrow_func_exp(Instruction* currentInstruction)
> 
> Ditto. Find a way to abstract this. It's not good to have two functions doing almost identical computations.

Refactored

>> Source/JavaScriptCore/jit/JITOpcodes.cpp:1011
>> +    store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, sizeof(Register) * dst));
> 
> Do we have a helper function for this?

I didn't find

>> Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:177
>> +#define LLINT_CALC_PROPERTY_FOR_FUNC_EXPR()                                     \
> 
> 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.

Refactored

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150706/26c685ab/attachment-0001.html>


More information about the webkit-unassigned mailing list