Changeset 167199 in webkit for trunk/Source/JavaScriptCore/ChangeLog
- Timestamp:
- Apr 13, 2014, 11:01:54 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r167189 r167199 1 2014-04-08 Oliver Hunt <[email protected]> 2 3 Rewrite Function.bind as a builtin 4 https://bugs.webkit.org/show_bug.cgi?id=131083 5 6 Reviewed by Geoffrey Garen. 7 8 This change removes the existing function.bind implementation 9 entirely so JSBoundFunction is no more. 10 11 Instead we just return a regular JS closure with a few 12 private properties hanging off it that allow us to perform 13 the necessary bound function fakery. While most of this is 14 simple, a couple of key changes: 15 16 - The parser and lexer now directly track whether they're 17 parsing code for call or construct and convert the private 18 name @IsConstructor into TRUETOK or FALSETOK as appropriate. 19 This automatically gives us the ability to vary behaviour 20 from within the builtin. It also leaves a lot of headroom 21 for trivial future improvements. 22 - The instanceof operator now uses the prototypeForHasInstance 23 private name, and we have a helper function to ensure that 24 all objects that need to can update their magical 'prototype' 25 property pair correctly. 26 27 * API/JSScriptRef.cpp: 28 (parseScript): 29 * JavaScriptCore.xcodeproj/project.pbxproj: 30 * builtins/BuiltinExecutables.cpp: 31 (JSC::BuiltinExecutables::createBuiltinExecutable): 32 * builtins/Function.prototype.js: 33 (bind.bindingFunction): 34 (bind.else.bindingFunction): 35 (bind): 36 * bytecode/UnlinkedCodeBlock.cpp: 37 (JSC::generateFunctionCodeBlock): 38 * bytecompiler/NodesCodegen.cpp: 39 (JSC::InstanceOfNode::emitBytecode): 40 * interpreter/Interpreter.cpp: 41 * parser/Lexer.cpp: 42 (JSC::Lexer<T>::Lexer): 43 (JSC::Lexer<LChar>::parseIdentifier): 44 (JSC::Lexer<UChar>::parseIdentifier): 45 * parser/Lexer.h: 46 * parser/Parser.cpp: 47 (JSC::Parser<LexerType>::Parser): 48 (JSC::Parser<LexerType>::parseInner): 49 * parser/Parser.h: 50 (JSC::parse): 51 * parser/ParserModes.h: 52 * runtime/CodeCache.cpp: 53 (JSC::CodeCache::getGlobalCodeBlock): 54 (JSC::CodeCache::getFunctionExecutableFromGlobalCode): 55 * runtime/CommonIdentifiers.h: 56 * runtime/Completion.cpp: 57 (JSC::checkSyntax): 58 * runtime/Executable.cpp: 59 (JSC::ProgramExecutable::checkSyntax): 60 * runtime/FunctionPrototype.cpp: 61 (JSC::FunctionPrototype::addFunctionProperties): 62 (JSC::functionProtoFuncBind): Deleted. 63 * runtime/JSBoundFunction.cpp: Removed. 64 * runtime/JSBoundFunction.h: Removed. 65 * runtime/JSFunction.cpp: 66 (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): 67 (JSC::RetrieveCallerFunctionFunctor::operator()): 68 (JSC::retrieveCallerFunction): 69 (JSC::JSFunction::getOwnPropertySlot): 70 (JSC::JSFunction::defineOwnProperty): 71 * runtime/JSGlobalObject.cpp: 72 (JSC::JSGlobalObject::reset): 73 * runtime/JSGlobalObjectFunctions.cpp: 74 (JSC::globalFuncSetTypeErrorAccessor): 75 * runtime/JSGlobalObjectFunctions.h: 76 * runtime/JSObject.h: 77 (JSC::JSObject::inlineGetOwnPropertySlot): 78 1 79 2014-04-12 Filip Pizlo <[email protected]> 2 80
Note:
See TracChangeset
for help on using the changeset viewer.