Changeset 167313 in webkit
- Timestamp:
- Apr 15, 2014 10:46:42 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 deleted
- 71 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167311 r167313 1 2014-04-15 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r167199 and r167251. 4 https://bugs.webkit.org/show_bug.cgi?id=131678 5 6 Caused a DYEBench regression and does not seem to improve perf 7 on relevant websites (Requested by rniwa on #webkit). 8 9 Reverted changesets: 10 11 "Rewrite Function.bind as a builtin" 12 https://bugs.webkit.org/show_bug.cgi?id=131083 13 http://trac.webkit.org/changeset/167199 14 15 "Update test result" 16 http://trac.webkit.org/changeset/167251 17 1 18 2014-04-15 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/LayoutTests/js/dom/function-bind-expected.txt
r167199 r167313 4 4 5 5 6 PASS new (decodeURI.bind())() threw exception TypeError: function is not a constructor .6 PASS new (decodeURI.bind())() threw exception TypeError: function is not a constructor (evaluating 'new (decodeURI.bind())()'). 7 7 PASS (new (String.bind())('foo')).toString() is 'foo' 8 8 PASS result is "[object Window] -> x:1, y:2" … … 24 24 PASS "prototype" in G is false 25 25 PASS "prototype" in H is false 26 PASS Function.bind.call(undefined) threw exception TypeError: Cannot bind non-function object..26 PASS Function.bind.call(undefined) threw exception TypeError: Type error. 27 27 PASS abcAt(1) is "b" 28 PASS new abcAt(1) threw exception TypeError: function is not a constructor .28 PASS new abcAt(1) threw exception TypeError: function is not a constructor (evaluating 'new abcAt(1)'). 29 29 PASS boundFunctionPrototypeAccessed is false 30 30 PASS Function.bind.length is 1 -
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r167199 r167313 128 128 JSCallbackConstructor* constructor = JSCallbackConstructor::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); 129 129 constructor->putDirect(exec->vm(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); 130 constructor->putDirect(exec->vm(), exec->propertyNames().prototypeForHasInstancePrivateName, jsPrototype, DontEnum | DontDelete | ReadOnly);131 130 return toRef(constructor); 132 131 } -
trunk/Source/JavaScriptCore/API/JSScriptRef.cpp
r167199 r167313 69 69 static bool parseScript(VM* vm, const SourceCode& source, ParserError& error) 70 70 { 71 return JSC::parse<JSC::ProgramNode>(vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, JSNotFunctionKind,error);71 return JSC::parse<JSC::ProgramNode>(vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error); 72 72 } 73 73 -
trunk/Source/JavaScriptCore/CMakeLists.txt
r167199 r167313 395 395 runtime/JSArrayBufferView.cpp 396 396 runtime/JSArrayIterator.cpp 397 runtime/JSBoundFunction.cpp 397 398 runtime/JSCJSValue.cpp 398 399 runtime/JSCell.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r167297 r167313 1 2014-04-15 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r167199 and r167251. 4 https://bugs.webkit.org/show_bug.cgi?id=131678 5 6 Caused a DYEBench regression and does not seem to improve perf 7 on relevant websites (Requested by rniwa on #webkit). 8 9 Reverted changesets: 10 11 "Rewrite Function.bind as a builtin" 12 https://bugs.webkit.org/show_bug.cgi?id=131083 13 http://trac.webkit.org/changeset/167199 14 15 "Update test result" 16 http://trac.webkit.org/changeset/167251 17 1 18 2014-04-14 Commit Queue <commit-queue@webkit.org> 2 19 -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r167199 r167313 641 641 <ClCompile Include="..\runtime\JSArrayBufferPrototype.cpp" /> 642 642 <ClCompile Include="..\runtime\JSArrayBufferView.cpp" /> 643 <ClCompile Include="..\runtime\JSBoundFunction.cpp" /> 643 644 <ClCompile Include="..\runtime\JSCJSValue.cpp" /> 644 645 <ClCompile Include="..\runtime\JSCell.cpp" /> … … 1301 1302 <ClInclude Include="..\runtime\JSArrayBufferViewInlines.h" /> 1302 1303 <ClInclude Include="..\runtime\JSArrayIterator.h" /> 1304 <ClInclude Include="..\runtime\JSBoundFunction.h" /> 1303 1305 <ClInclude Include="..\runtime\JSCInlines.h" /> 1304 1306 <ClInclude Include="..\runtime\JSCJSValue.h" /> -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
r167199 r167313 607 607 <Filter>runtime</Filter> 608 608 </ClCompile> 609 <ClCompile Include="..\runtime\JSBoundFunction.cpp"> 610 <Filter>runtime</Filter> 611 </ClCompile> 609 612 <ClCompile Include="..\runtime\JSCell.cpp"> 610 613 <Filter>runtime</Filter> … … 2251 2254 </ClInclude> 2252 2255 <ClInclude Include="..\runtime\JSArray.h"> 2256 <Filter>runtime</Filter> 2257 </ClInclude> 2258 <ClInclude Include="..\runtime\JSBoundFunction.h"> 2253 2259 <Filter>runtime</Filter> 2254 2260 </ClInclude> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r167199 r167313 1216 1216 86F3EEBE168CDE930077B92A /* ObjCCallbackFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */; }; 1217 1217 86F3EEBF168CDE930077B92A /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB616855A5B0077B92A /* ObjcRuntimeExtras.h */; }; 1218 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */; }; 1219 86FA9E92142BBB2E001773B7 /* JSBoundFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */; }; 1218 1220 90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */; }; 1219 1221 90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2788 2790 86F75EFC151C062F007C9BA3 /* RegExpCachedResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCachedResult.h; sourceTree = "<group>"; }; 2789 2791 86F75EFD151C062F007C9BA3 /* RegExpMatchesArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpMatchesArray.cpp; sourceTree = "<group>"; }; 2792 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBoundFunction.cpp; sourceTree = "<group>"; }; 2793 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBoundFunction.h; sourceTree = "<group>"; }; 2790 2794 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryStatistics.cpp; sourceTree = "<group>"; }; 2791 2795 90213E3C123A40C200D422F3 /* MemoryStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryStatistics.h; sourceTree = "<group>"; }; … … 4319 4323 A7BDAEC417F4EA1400F6140C /* JSArrayIterator.cpp */, 4320 4324 A7BDAEC517F4EA1400F6140C /* JSArrayIterator.h */, 4325 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */, 4326 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */, 4321 4327 BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */, 4322 4328 BC1167D80E19BCC9008066DD /* JSCell.h */, … … 5934 5940 BC18C4180E16F5CD00B34460 /* JSBase.h in Headers */, 5935 5941 140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */, 5942 86FA9E92142BBB2E001773B7 /* JSBoundFunction.h in Headers */, 5936 5943 BC18C4190E16F5CD00B34460 /* JSCallbackConstructor.h in Headers */, 5937 5944 BC18C41A0E16F5CD00B34460 /* JSCallbackFunction.h in Headers */, … … 7127 7134 A7BDAECA17F4EA1400F6140C /* JSArrayIterator.cpp in Sources */, 7128 7135 1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */, 7136 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */, 7129 7137 1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */, 7130 7138 1440F8920A508B100005F061 /* JSCallbackFunction.cpp in Sources */, -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
r167199 r167313 47 47 JSTextPosition positionBeforeLastNewline; 48 48 ParserError error; 49 RefPtr<ProgramNode> program = parse<ProgramNode>(&m_vm, source, 0, Identifier(), JSParseBuiltin, JSParseProgramCode, JSNotFunctionKind,error, &positionBeforeLastNewline);49 RefPtr<ProgramNode> program = parse<ProgramNode>(&m_vm, source, 0, Identifier(), JSParseBuiltin, JSParseProgramCode, error, &positionBeforeLastNewline); 50 50 51 51 if (!program) { … … 72 72 for (const auto& closedVariable : program->closedVariables()) { 73 73 if (closedVariable == m_vm.propertyNames->arguments.impl()) 74 74 continue; 75 75 76 76 if (closedVariable == m_vm.propertyNames->undefinedKeyword.impl()) -
trunk/Source/JavaScriptCore/builtins/Function.prototype.js
r167297 r167313 33 33 return this.@apply(thisValue, argumentValues); 34 34 } 35 36 function bind(thisValue /*, optional arguments */)37 {38 "use strict";39 var boundFunction = this;40 if (typeof boundFunction !== "function")41 throw new @TypeError("Cannot bind non-function object.");42 var bindingFunction;43 var oversizedCall = undefined;44 if (arguments.length <= 1) {45 bindingFunction = function () {46 if (@IsConstructor)47 return new boundFunction(...arguments);48 return boundFunction.@apply(thisValue, arguments);49 }50 } else {51 var length = arguments.length;52 switch (length - 1 /* skip thisValue */) {53 case 1: {54 var boundParameter = arguments[1];55 bindingFunction = function () {56 var argumentLength = arguments.length;57 if (!argumentLength) {58 if (@IsConstructor)59 return new boundFunction(boundParameter);60 return boundFunction.@call(thisValue, boundParameter);61 }62 if (argumentLength == 1) {63 if (@IsConstructor)64 return new boundFunction(boundParameter, arguments[0]);65 return boundFunction.@call(thisValue, boundParameter, arguments[0]);66 }67 if (argumentLength == 2) {68 if (@IsConstructor)69 return new boundFunction(boundParameter, arguments[0], arguments[1]);70 return boundFunction.@call(thisValue, boundParameter, arguments[0], arguments[1]);71 }72 if (argumentLength == 3) {73 if (@IsConstructor)74 return new boundFunction(boundParameter, arguments[0], arguments[1], arguments[2]);75 return boundFunction.@call(thisValue, boundParameter, arguments[0], arguments[1], arguments[2]);76 }77 var completeArguments = [boundParameter, ...arguments];78 if (!oversizedCall) {79 oversizedCall = function (isConstruct, boundFunction, thisValue, completeArguments) {80 if (isConstruct)81 return new boundFunction(...completeArguments);82 return boundFunction.@apply(thisValue, completeArguments);83 }84 }85 return oversizedCall(@IsConstructor, boundFunction, thisValue, completeArguments);86 }87 break;88 }89 case 2: {90 var boundParameter1 = arguments[1];91 var boundParameter2 = arguments[2];92 bindingFunction = function () {93 if (!arguments.length) {94 if (@IsConstructor)95 return new boundFunction(boundParameter1, boundParameter2);96 return boundFunction.@call(thisValue, boundParameter1, boundParameter2);97 }98 if (arguments.length == 1) {99 if (@IsConstructor)100 return new boundFunction(boundParameter1, boundParameter2, arguments[0]);101 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, arguments[0]);102 }103 if (arguments.length == 2) {104 if (@IsConstructor)105 return new boundFunction(boundParameter1, boundParameter2, arguments[0], arguments[1]);106 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, arguments[0], arguments[1]);107 }108 if (arguments.length == 3) {109 if (@IsConstructor)110 return new boundFunction(boundParameter1, boundParameter2, arguments[0], arguments[1], arguments[2]);111 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, arguments[0], arguments[1], arguments[2]);112 }113 var completeArguments = [boundParameter1, boundParameter2, ...arguments];114 if (!oversizedCall) {115 oversizedCall = function (isConstruct, boundFunction, thisValue, completeArguments) {116 if (isConstruct)117 return new boundFunction(...completeArguments);118 return boundFunction.@apply(thisValue, completeArguments);119 }120 }121 return oversizedCall(@IsConstructor, boundFunction, thisValue, completeArguments);122 }123 break;124 }125 case 3: {126 var boundParameter1 = arguments[1];127 var boundParameter2 = arguments[2];128 var boundParameter3 = arguments[3];129 bindingFunction = function () {130 if (!arguments.length) {131 if (@IsConstructor)132 return new boundFunction(boundParameter1, boundParameter2, boundParameter3);133 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, boundParameter3);134 }135 if (arguments.length == 1) {136 if (@IsConstructor)137 return new boundFunction(boundParameter1, boundParameter2, boundParameter3, arguments[0]);138 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, boundParameter3, arguments[0]);139 }140 if (arguments.length == 2) {141 if (@IsConstructor)142 return new boundFunction(boundParameter1, boundParameter2, boundParameter3, arguments[0], arguments[1]);143 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, boundParameter3, arguments[0], arguments[1]);144 }145 if (arguments.length == 3) {146 if (@IsConstructor)147 return new boundFunction(boundParameter1, boundParameter2, boundParameter3, arguments[0], arguments[1], arguments[2]);148 return boundFunction.@call(thisValue, boundParameter1, boundParameter2, boundParameter3, arguments[0], arguments[1], arguments[2]);149 }150 var completeArguments = [boundParameter1, boundParameter2, boundParameter3, ...arguments];151 if (!oversizedCall) {152 oversizedCall = function (isConstruct, boundFunction, thisValue, completeArguments) {153 if (isConstruct)154 return new boundFunction(...completeArguments);155 return boundFunction.@apply(thisValue, completeArguments);156 }157 }158 return oversizedCall(@IsConstructor, boundFunction, thisValue, completeArguments);159 }160 break;161 }162 default:163 var boundParameters = [];164 for (var i = 1; i < length; i++)165 boundParameters[i - 1] = arguments[i];166 167 bindingFunction = function () {168 if (!arguments.length) {169 if (@IsConstructor)170 return new boundFunction(...boundParameters);171 return boundFunction.@apply(thisValue, boundParameters);172 }173 174 var completeArguments = [];175 var localBoundParameters = boundParameters;176 var boundLength = localBoundParameters.length;177 for (var i = 0; i < boundLength; i++)178 completeArguments[i] = localBoundParameters[i];179 for (var i = 0; i < arguments.length; i++)180 completeArguments[i + boundLength] = arguments[i];181 if (@IsConstructor)182 return new boundFunction(...completeArguments);183 else184 return boundFunction.@apply(thisValue, completeArguments);185 }186 }187 }188 bindingFunction.@boundFunctionName = this.name;189 bindingFunction.@boundFunction = boundFunction.@boundFunction || boundFunction;190 var boundLength = boundFunction.length - (arguments.length - 1);191 if (boundLength < 0)192 boundLength = 0;193 bindingFunction.@boundFunctionLength = boundLength;194 @SetTypeErrorAccessor(bindingFunction, "arguments");195 @SetTypeErrorAccessor(bindingFunction, "caller");196 return bindingFunction;197 } -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
r167199 r167313 52 52 static UnlinkedFunctionCodeBlock* generateFunctionCodeBlock(VM& vm, UnlinkedFunctionExecutable* executable, const SourceCode& source, CodeSpecializationKind kind, DebuggerMode debuggerMode, ProfilerMode profilerMode, UnlinkedFunctionKind functionKind, ParserError& error) 53 53 { 54 RefPtr<FunctionBodyNode> body = parse<FunctionBodyNode>(&vm, source, executable->parameters(), executable->name(), executable->toStrictness(), JSParseFunctionCode, kind == CodeForConstruct ? JSFunctionIsConstructorKind : JSFunctionIsFunctionKind,error);54 RefPtr<FunctionBodyNode> body = parse<FunctionBodyNode>(&vm, source, executable->parameters(), executable->name(), executable->toStrictness(), JSParseFunctionCode, error); 55 55 56 56 if (!body) { -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r167199 r167313 1286 1286 1287 1287 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); 1288 generator.emitGetById(prototype.get(), src2.get(), generator.vm()->propertyNames->prototype ForHasInstancePrivateName);1288 generator.emitGetById(prototype.get(), src2.get(), generator.vm()->propertyNames->prototype); 1289 1289 1290 1290 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); … … 1697 1697 { 1698 1698 generator.emitDebugHook(WillExecuteStatement, firstLine(), startOffset(), lineStartOffset()); 1699 bool constantBranch = false; 1700 if (m_condition->getBooleanConstant(constantBranch)) { 1701 if (constantBranch) 1702 generator.emitNode(dst, m_ifBlock); 1703 else if (m_elseBlock) 1704 generator.emitNode(dst, m_elseBlock); 1705 return; 1706 } 1699 1707 1700 RefPtr<Label> beforeThen = generator.newLabel(); 1708 1701 RefPtr<Label> beforeElse = generator.newLabel(); -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r167199 r167313 45 45 #include "JSActivation.h" 46 46 #include "JSArray.h" 47 #include "JSBoundFunction.h" 47 48 #include "JSNameScope.h" 48 49 #include "JSNotAnObject.h" -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r167199 r167313 490 490 491 491 template <typename T> 492 Lexer<T>::Lexer(VM* vm, JSParserStrictness strictness , JSFunctionKind functionKind)492 Lexer<T>::Lexer(VM* vm, JSParserStrictness strictness) 493 493 : m_isReparsing(false) 494 494 , m_vm(vm) 495 495 , m_parsingBuiltinFunction(strictness == JSParseBuiltin) 496 , m_functionKind(functionKind)497 496 { 498 497 } … … 821 820 else if (*ident == m_vm->propertyNames->undefinedKeyword) 822 821 tokenData->ident = &m_vm->propertyNames->undefinedPrivateName; 823 824 822 if (!ident) 825 823 return INVALID_PRIVATE_NAME_ERRORTOK; 826 827 if (*ident == m_vm->propertyNames->IsConstructorPrivateName)828 return m_functionKind == JSFunctionIsConstructorKind ? TRUETOKEN : FALSETOKEN;829 830 824 } 831 825 tokenData->ident = ident; … … 903 897 else if (*ident == m_vm->propertyNames->undefinedKeyword) 904 898 tokenData->ident = &m_vm->propertyNames->undefinedPrivateName; 905 if (m_functionKind == JSFunctionIsConstructorKind) {906 if (*ident == m_vm->propertyNames->IsConstructorPrivateName)907 return TRUETOKEN;908 return FALSETOKEN;909 }910 899 if (!ident) 911 900 return INVALID_PRIVATE_NAME_ERRORTOK; -
trunk/Source/JavaScriptCore/parser/Lexer.h
r167199 r167313 72 72 73 73 public: 74 Lexer(VM*, JSParserStrictness , JSFunctionKind);74 Lexer(VM*, JSParserStrictness); 75 75 ~Lexer(); 76 76 … … 239 239 VM* m_vm; 240 240 bool m_parsingBuiltinFunction; 241 JSFunctionKind m_functionKind;242 241 }; 243 242 -
trunk/Source/JavaScriptCore/parser/Nodes.h
r167199 r167313 165 165 virtual bool isBoolean() const { return false; } 166 166 virtual bool isSpreadExpression() const { return false; } 167 virtual bool getBooleanConstant(bool&) const { return false; }168 167 169 168 virtual void emitBytecodeInConditionContext(BytecodeGenerator&, Label*, Label*, FallThroughMode); … … 215 214 216 215 private: 217 218 bool getBooleanConstant(bool& value) const override219 {220 value = false;221 return true;222 }223 224 216 virtual bool isNull() const override { return true; } 225 217 virtual JSValue jsValue(BytecodeGenerator&) const override { return jsNull(); } … … 230 222 BooleanNode(const JSTokenLocation&, bool value); 231 223 bool value() { return m_value; } 232 233 private: 234 bool getBooleanConstant(bool& value) const override 235 { 236 value = m_value; 237 return true; 238 } 239 224 225 private: 240 226 virtual bool isBoolean() const override { return true; } 241 227 virtual JSValue jsValue(BytecodeGenerator&) const override { return jsBoolean(m_value); } … … 251 237 252 238 private: 253 bool getBooleanConstant(bool& value) const override254 {255 value = (bool)m_value;256 return true;257 }258 239 virtual bool isNumber() const override { return true; } 259 240 virtual JSValue jsValue(BytecodeGenerator&) const override { return jsNumber(m_value); } -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r167199 r167313 193 193 194 194 template <typename LexerType> 195 Parser<LexerType>::Parser(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode , JSFunctionKind functionKind)195 Parser<LexerType>::Parser(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode) 196 196 : m_vm(vm) 197 197 , m_source(&source) … … 208 208 , m_parsingBuiltin(strictness == JSParseBuiltin) 209 209 { 210 m_lexer = adoptPtr(new LexerType(vm, strictness , functionKind));210 m_lexer = adoptPtr(new LexerType(vm, strictness)); 211 211 m_arena = m_vm->parserArena.get(); 212 212 m_lexer->setCode(source, m_arena); … … 284 284 Vector<RefPtr<StringImpl>> closedVariables; 285 285 if (m_parsingBuiltin) { 286 RELEASE_ASSERT(!capturedVariables.size()); 286 287 IdentifierSet usedVariables; 287 288 scope->getUsedVariables(usedVariables); … … 293 294 continue; 294 295 closedVariables.append(variable); 295 }296 if (!capturedVariables.isEmpty()) {297 for (const auto& capturedVariable : capturedVariables) {298 if (scope->hasDeclaredVariable(Identifier(m_vm, capturedVariable.get())))299 continue;300 301 if (scope->hasDeclaredParameter(Identifier(m_vm, capturedVariable.get())))302 continue;303 RELEASE_ASSERT_NOT_REACHED();304 }305 296 } 306 297 } -
trunk/Source/JavaScriptCore/parser/Parser.h
r167199 r167313 412 412 413 413 public: 414 Parser(VM*, const SourceCode&, FunctionParameters*, const Identifier&, JSParserStrictness, JSParserMode , JSFunctionKind);414 Parser(VM*, const SourceCode&, FunctionParameters*, const Identifier&, JSParserStrictness, JSParserMode); 415 415 ~Parser(); 416 416 … … 955 955 956 956 template <class ParsedNode> 957 PassRefPtr<ParsedNode> parse(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode, JSFunctionKind functionKind,ParserError& error, JSTextPosition* positionBeforeLastNewline = 0)957 PassRefPtr<ParsedNode> parse(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode, ParserError& error, JSTextPosition* positionBeforeLastNewline = 0) 958 958 { 959 959 SamplingRegion samplingRegion("Parsing"); … … 961 961 ASSERT(!source.provider()->source().isNull()); 962 962 if (source.provider()->source().is8Bit()) { 963 Parser<Lexer<LChar>> parser(vm, source, parameters, name, strictness, parserMode , functionKind);963 Parser<Lexer<LChar>> parser(vm, source, parameters, name, strictness, parserMode); 964 964 RefPtr<ParsedNode> result = parser.parse<ParsedNode>(error); 965 965 if (positionBeforeLastNewline) … … 973 973 return result.release(); 974 974 } 975 Parser<Lexer<UChar>> parser(vm, source, parameters, name, strictness, parserMode , functionKind);975 Parser<Lexer<UChar>> parser(vm, source, parameters, name, strictness, parserMode); 976 976 RefPtr<ParsedNode> result = parser.parse<ParsedNode>(error); 977 977 if (positionBeforeLastNewline) -
trunk/Source/JavaScriptCore/parser/ParserModes.h
r167199 r167313 34 34 enum JSParserStrictness { JSParseNormal, JSParseBuiltin, JSParseStrict }; 35 35 enum JSParserMode { JSParseProgramCode, JSParseFunctionCode }; 36 enum JSFunctionKind { JSNotFunctionKind, JSFunctionIsFunctionKind, JSFunctionIsConstructorKind }; 37 36 38 37 enum ProfilerMode { ProfilerOff, ProfilerOn }; 39 38 enum DebuggerMode { DebuggerOff, DebuggerOn }; -
trunk/Source/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp
r167199 r167313 40 40 { 41 41 Base::finishCreation(vm); 42 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);42 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 43 43 } 44 44 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r167199 r167313 63 63 { 64 64 Base::finishCreation(vm, arrayPrototype->classInfo()->className); 65 putDirect PrototypePropertyWithoutTransitions(vm, arrayPrototype, DontEnum | DontDelete | ReadOnly);65 putDirectWithoutTransition(vm, vm.propertyNames->prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly); 66 66 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 67 67 } -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r167199 r167313 40 40 { 41 41 Base::finishCreation(vm, booleanPrototype->classInfo()->className); 42 putDirect PrototypePropertyWithoutTransitions(vm, booleanPrototype, DontEnum | DontDelete | ReadOnly);42 putDirectWithoutTransition(vm, vm.propertyNames->prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly); 43 43 44 44 // no. of arguments for constructor -
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r167199 r167313 93 93 94 94 typedef typename CacheTypes<UnlinkedCodeBlockType>::RootNode RootNode; 95 RefPtr<RootNode> rootNode = parse<RootNode>(&vm, source, 0, Identifier(), strictness, JSParseProgramCode, JSNotFunctionKind,error);95 RefPtr<RootNode> rootNode = parse<RootNode>(&vm, source, 0, Identifier(), strictness, JSParseProgramCode, error); 96 96 if (!rootNode) { 97 97 m_sourceCode.remove(addResult.iterator); … … 143 143 144 144 JSTextPosition positionBeforeLastNewline; 145 RefPtr<ProgramNode> program = parse<ProgramNode>(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, JSNotFunctionKind,error, &positionBeforeLastNewline);145 RefPtr<ProgramNode> program = parse<ProgramNode>(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error, &positionBeforeLastNewline); 146 146 if (!program) { 147 147 RELEASE_ASSERT(error.m_type != ParserError::ErrorNone); -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r167297 r167313 220 220 macro(TypeError) \ 221 221 macro(undefined) \ 222 macro(BuiltinLog) \ 223 macro(IsConstructor) \ 224 macro(boundFunctionName) \ 225 macro(boundFunctionParameters) \ 226 macro(boundFunction) \ 227 macro(boundFunctionLength) \ 228 macro(prototypeForHasInstance) \ 229 macro(SetTypeErrorAccessor) 222 macro(BuiltinLog) 230 223 231 224 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/Completion.cpp
r167199 r167313 56 56 JSLockHolder lock(vm); 57 57 RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); 58 RefPtr<ProgramNode> programNode = parse<ProgramNode>(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, JSNotFunctionKind,error);58 RefPtr<ProgramNode> programNode = parse<ProgramNode>(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error); 59 59 return programNode; 60 60 } -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r167199 r167313 109 109 { 110 110 Base::finishCreation(vm, datePrototype->classInfo()->className); 111 putDirect PrototypePropertyWithoutTransitions(vm, datePrototype, DontEnum | DontDelete | ReadOnly);111 putDirectWithoutTransition(vm, vm.propertyNames->prototype, datePrototype, DontEnum | DontDelete | ReadOnly); 112 112 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(7), ReadOnly | DontEnum | DontDelete); 113 113 } -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r167199 r167313 43 43 Base::finishCreation(vm, errorPrototype->classInfo()->className); 44 44 // ECMA 15.11.3.1 Error.prototype 45 putDirect PrototypePropertyWithoutTransitions(vm, errorPrototype, DontEnum | DontDelete | ReadOnly);45 putDirectWithoutTransition(vm, vm.propertyNames->prototype, errorPrototype, DontEnum | DontDelete | ReadOnly); 46 46 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); 47 47 } -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r167199 r167313 448 448 VM* vm = &exec->vm(); 449 449 JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject(); 450 RefPtr<ProgramNode> programNode = parse<ProgramNode>(vm, m_source, 0, Identifier(), JSParseNormal, ProgramNode::isFunctionNode ? JSParseFunctionCode : JSParseProgramCode, JSNotFunctionKind,error);450 RefPtr<ProgramNode> programNode = parse<ProgramNode>(vm, m_source, 0, Identifier(), JSParseNormal, ProgramNode::isFunctionNode ? JSParseFunctionCode : JSParseProgramCode, error); 451 451 if (programNode) 452 452 return 0; -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r167199 r167313 48 48 { 49 49 Base::finishCreation(vm, functionPrototype->classInfo()->className); 50 putDirect PrototypePropertyWithoutTransitions(vm, functionPrototype, DontEnum | DontDelete | ReadOnly);50 putDirectWithoutTransition(vm, vm.propertyNames->prototype, functionPrototype, DontEnum | DontDelete | ReadOnly); 51 51 52 52 // Number of arguments for constructor -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r167199 r167313 26 26 #include "BuiltinNames.h" 27 27 #include "JSArray.h" 28 #include "JSBoundFunction.h" 28 29 #include "JSFunction.h" 29 30 #include "JSString.h" … … 40 41 41 42 static EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState*); 43 static EncodedJSValue JSC_HOST_CALL functionProtoFuncBind(ExecState*); 42 44 43 45 FunctionPrototype::FunctionPrototype(VM& vm, Structure* structure) … … 61 63 *applyFunction = putDirectBuiltinFunctionWithoutTransition(vm, globalObject, vm.propertyNames->builtinNames().applyPublicName(), functionPrototypeApplyCodeGenerator(vm), DontEnum); 62 64 *callFunction = putDirectBuiltinFunctionWithoutTransition(vm, globalObject, vm.propertyNames->builtinNames().callPublicName(), functionPrototypeCallCodeGenerator(vm), DontEnum); 63 64 putDirectBuiltinFunctionWithoutTransition(vm, globalObject, vm.propertyNames->builtinNames().bindPublicName(), functionPrototypeBindCodeGenerator(vm), DontEnum); 65 66 JSFunction* bindFunction = JSFunction::create(vm, globalObject, 1, vm.propertyNames->bind.string(), functionProtoFuncBind); 67 putDirectWithoutTransition(vm, vm.propertyNames->bind, bindFunction, DontEnum); 65 68 } 66 69 … … 119 122 } 120 123 124 // 15.3.4.5 Function.prototype.bind (thisArg [, arg1 [, arg2, ...]]) 125 EncodedJSValue JSC_HOST_CALL functionProtoFuncBind(ExecState* exec) 126 { 127 JSGlobalObject* globalObject = exec->callee()->globalObject(); 128 129 // Let Target be the this value. 130 JSValue target = exec->thisValue(); 131 132 // If IsCallable(Target) is false, throw a TypeError exception. 133 CallData callData; 134 CallType callType = getCallData(target, callData); 135 if (callType == CallTypeNone) 136 return throwVMTypeError(exec); 137 // Primitive values are not callable. 138 ASSERT(target.isObject()); 139 JSObject* targetObject = asObject(target); 140 VM& vm = exec->vm(); 141 142 // Let A be a new (possibly empty) internal list of all of the argument values provided after thisArg (arg1, arg2 etc), in order. 143 size_t numBoundArgs = exec->argumentCount() > 1 ? exec->argumentCount() - 1 : 0; 144 JSArray* boundArgs = JSArray::tryCreateUninitialized(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithUndecided), numBoundArgs); 145 if (!boundArgs) 146 return JSValue::encode(throwOutOfMemoryError(exec)); 147 148 for (size_t i = 0; i < numBoundArgs; ++i) 149 boundArgs->initializeIndex(vm, i, exec->argument(i + 1)); 150 151 // If the [[Class]] internal property of Target is "Function", then ... 152 // Else set the length own property of F to 0. 153 unsigned length = 0; 154 if (targetObject->inherits(JSFunction::info())) { 155 ASSERT(target.get(exec, exec->propertyNames().length).isNumber()); 156 // a. Let L be the length property of Target minus the length of A. 157 // b. Set the length own property of F to either 0 or L, whichever is larger. 158 unsigned targetLength = (unsigned)target.get(exec, exec->propertyNames().length).asNumber(); 159 if (targetLength > numBoundArgs) 160 length = targetLength - numBoundArgs; 161 } 162 163 JSString* name = target.get(exec, exec->propertyNames().name).toString(exec); 164 return JSValue::encode(JSBoundFunction::create(vm, globalObject, targetObject, exec->argument(0), boundArgs, length, name->value(exec))); 165 } 166 121 167 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
r167199 r167313 51 51 { 52 52 Base::finishCreation(vm, "ArrayBuffer"); 53 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);53 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 54 54 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly); 55 55 -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r167199 r167313 34 34 #include "GetterSetter.h" 35 35 #include "JSArray.h" 36 #include "JSBoundFunction.h" 36 37 #include "JSFunctionInlines.h" 37 38 #include "JSGlobalObject.h" … … 251 252 class RetrieveCallerFunctionFunctor { 252 253 public: 253 RetrieveCallerFunctionFunctor(ExecState* exec, JSFunction* functionObj) 254 : m_exec(exec) 255 , m_targetCallee(jsDynamicCast<JSObject*>(functionObj)) 254 RetrieveCallerFunctionFunctor(JSFunction* functionObj) 255 : m_targetCallee(jsDynamicCast<JSObject*>(functionObj)) 256 256 , m_hasFoundFrame(false) 257 257 , m_hasSkippedToCallerFrame(false) … … 266 266 JSObject* callee = visitor->callee(); 267 267 268 if (callee && callee-> hasOwnProperty(m_exec, m_exec->propertyNames().boundFunctionNamePrivateName))268 if (callee && callee->inherits(JSBoundFunction::info())) 269 269 return StackVisitor::Continue; 270 270 … … 284 284 285 285 private: 286 ExecState* m_exec;287 286 JSObject* m_targetCallee; 288 287 bool m_hasFoundFrame; … … 293 292 static JSValue retrieveCallerFunction(ExecState* exec, JSFunction* functionObj) 294 293 { 295 RetrieveCallerFunctionFunctor functor( exec,functionObj);294 RetrieveCallerFunctionFunctor functor(functionObj); 296 295 exec->iterate(functor); 297 296 return functor.result(); … … 330 329 { 331 330 JSFunction* thisObject = jsCast<JSFunction*>(object); 332 if (thisObject->isHost Function())331 if (thisObject->isHostOrBuiltinFunction()) 333 332 return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 334 if (thisObject->isBuiltinFunction()) { 335 if (propertyName == exec->propertyNames().caller) { 336 if (thisObject->jsExecutable()->isStrictMode()) { 337 bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 338 if (!result) { 339 thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec->vm()), DontDelete | DontEnum | Accessor); 340 result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 341 ASSERT(result); 342 } 343 return result; 344 } 345 slot.setCacheableCustom(thisObject, ReadOnly | DontEnum | DontDelete, callerGetter); 346 return true; 347 } 348 if (propertyName == exec->propertyNames().prototypeForHasInstancePrivateName) { 349 PropertySlot boundFunctionSlot(thisObject); 350 if (Base::getOwnPropertySlot(thisObject, exec, exec->propertyNames().boundFunctionPrivateName, boundFunctionSlot)) { 351 JSValue boundFunction = boundFunctionSlot.getValue(exec, exec->propertyNames().boundFunctionPrivateName); 352 PropertySlot boundPrototypeSlot(asObject(boundFunction)); 353 if (asObject(boundFunction)->getPropertySlot(exec, propertyName, boundPrototypeSlot)) { 354 slot.setValue(boundPrototypeSlot.slotBase(), boundPrototypeSlot.attributes(), boundPrototypeSlot.getValue(exec, propertyName)); 355 return true; 356 } 357 } 358 } 359 if (propertyName == exec->propertyNames().name) { 360 PropertySlot nameSlot(thisObject); 361 if (Base::getOwnPropertySlot(thisObject, exec, exec->vm().propertyNames->boundFunctionNamePrivateName, nameSlot)) { 362 slot.setValue(thisObject, DontEnum | DontDelete | ReadOnly, nameSlot.getValue(exec, exec->vm().propertyNames->boundFunctionNamePrivateName)); 363 return true; 364 } 365 } 366 if (propertyName == exec->propertyNames().length) { 367 PropertySlot lengthSlot(thisObject); 368 if (Base::getOwnPropertySlot(thisObject, exec, exec->vm().propertyNames->boundFunctionLengthPrivateName, lengthSlot)) { 369 slot.setValue(thisObject, DontEnum | DontDelete | ReadOnly, lengthSlot.getValue(exec, exec->vm().propertyNames->boundFunctionLengthPrivateName)); 370 return true; 371 } 372 } 373 374 return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 375 } 376 377 if (propertyName == exec->propertyNames().prototype || propertyName == exec->propertyNames().prototypeForHasInstancePrivateName) { 333 334 if (propertyName == exec->propertyNames().prototype) { 378 335 VM& vm = exec->vm(); 379 336 unsigned attributes; … … 382 339 JSObject* prototype = constructEmptyObject(exec); 383 340 prototype->putDirect(vm, exec->propertyNames().constructor, thisObject, DontEnum); 384 thisObject->putDirect PrototypeProperty(vm, prototype, DontDelete | DontEnum);341 thisObject->putDirect(vm, exec->propertyNames().prototype, prototype, DontDelete | DontEnum); 385 342 offset = thisObject->getDirectOffset(vm, exec->propertyNames().prototype, attributes); 386 343 ASSERT(isValidOffset(offset)); … … 434 391 { 435 392 JSFunction* thisObject = jsCast<JSFunction*>(object); 436 if (mode == IncludeDontEnumProperties) { 437 bool shouldIncludeJSFunctionProperties = !thisObject->isHostOrBuiltinFunction(); 438 if (!shouldIncludeJSFunctionProperties && thisObject->isBuiltinFunction()) { 439 PropertySlot boundFunctionSlot(thisObject); 440 shouldIncludeJSFunctionProperties = Base::getOwnPropertySlot(thisObject, exec, exec->propertyNames().boundFunctionPrivateName, boundFunctionSlot); 441 } 442 if (shouldIncludeJSFunctionProperties) { 443 VM& vm = exec->vm(); 444 // Make sure prototype has been reified. 445 PropertySlot slot(thisObject); 446 thisObject->methodTable(vm)->getOwnPropertySlot(thisObject, exec, vm.propertyNames->prototype, slot); 447 448 propertyNames.add(vm.propertyNames->arguments); 449 propertyNames.add(vm.propertyNames->caller); 450 propertyNames.add(vm.propertyNames->length); 451 propertyNames.add(vm.propertyNames->name); 452 } 393 if (!thisObject->isHostOrBuiltinFunction() && (mode == IncludeDontEnumProperties)) { 394 VM& vm = exec->vm(); 395 // Make sure prototype has been reified. 396 PropertySlot slot(thisObject); 397 thisObject->methodTable(vm)->getOwnPropertySlot(thisObject, exec, vm.propertyNames->prototype, slot); 398 399 propertyNames.add(vm.propertyNames->arguments); 400 propertyNames.add(vm.propertyNames->caller); 401 propertyNames.add(vm.propertyNames->length); 402 propertyNames.add(vm.propertyNames->name); 453 403 } 454 404 Base::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode); … … 470 420 thisObject->m_allocationProfileWatchpoint.fireAll(); 471 421 // Don't allow this to be cached, since a [[Put]] must clear m_allocationProfile. 472 PutPropertySlot dontCachePrototype(thisObject); 473 Base::put(thisObject, exec, propertyName, value, dontCachePrototype); 474 PutPropertySlot dontCachePrototypeForHasInstance(thisObject); 475 Base::put(thisObject, exec, exec->propertyNames().prototypeForHasInstancePrivateName, value, dontCachePrototypeForHasInstance); 422 PutPropertySlot dontCache(thisObject); 423 Base::put(thisObject, exec, propertyName, value, dontCache); 476 424 return; 477 425 } … … 518 466 thisObject->m_allocationProfile.clear(); 519 467 thisObject->m_allocationProfileWatchpoint.fireAll(); 520 if (!Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException)) 521 return false; 522 Base::defineOwnProperty(object, exec, exec->propertyNames().prototypeForHasInstancePrivateName, descriptor, throwException); 523 return true; 468 return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); 524 469 } 525 470 -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
r167199 r167313 44 44 { 45 45 Base::finishCreation(vm, name); 46 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);46 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 47 47 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(3), DontEnum | DontDelete | ReadOnly); 48 48 putDirectWithoutTransition(vm, vm.propertyNames->BYTES_PER_ELEMENT, jsNumber(ViewClass::elementSize), DontEnum | ReadOnly | DontDelete); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r167199 r167313 61 61 #include "JSArrayBufferPrototype.h" 62 62 #include "JSArrayIterator.h" 63 #include "JSBoundFunction.h" 63 64 #include "JSCInlines.h" 64 65 #include "JSCallbackConstructor.h" … … 278 279 m_functionPrototype.set(vm, this, FunctionPrototype::create(vm, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created. 279 280 m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get())); 281 m_boundFunctionStructure.set(vm, this, JSBoundFunction::createStructure(vm, this, m_functionPrototype.get())); 280 282 m_namedFunctionStructure.set(vm, this, Structure::addPropertyTransition(vm, m_functionStructure.get(), vm.propertyNames->name, DontDelete | ReadOnly | DontEnum, 0, m_functionNameOffset)); 281 283 m_internalFunctionStructure.set(vm, this, InternalFunction::createStructure(vm, this, m_functionPrototype.get())); … … 452 454 453 455 JSFunction* builtinLog = JSFunction::create(vm, this, 1, vm.propertyNames->emptyIdentifier.string(), globalFuncBuiltinLog); 454 JSFunction* setTypeErrorAccessor = JSFunction::create(vm, this, 2, vm.propertyNames->emptyIdentifier.string(), globalFuncSetTypeErrorAccessor);455 456 GlobalPropertyInfo staticGlobals[] = { 456 457 GlobalPropertyInfo(vm.propertyNames->NaN, jsNaN(), DontEnum | DontDelete | ReadOnly), … … 460 461 GlobalPropertyInfo(vm.propertyNames->ObjectPrivateName, objectConstructor, DontEnum | DontDelete | ReadOnly), 461 462 GlobalPropertyInfo(vm.propertyNames->TypeErrorPrivateName, m_typeErrorConstructor.get(), DontEnum | DontDelete | ReadOnly), 462 GlobalPropertyInfo(vm.propertyNames->BuiltinLogPrivateName, builtinLog, DontEnum | DontDelete | ReadOnly), 463 GlobalPropertyInfo(vm.propertyNames->SetTypeErrorAccessorPrivateName, setTypeErrorAccessor, DontEnum | DontDelete | ReadOnly) 463 GlobalPropertyInfo(vm.propertyNames->BuiltinLogPrivateName, builtinLog, DontEnum | DontDelete | ReadOnly) 464 464 }; 465 465 addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals)); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r167199 r167313 27 27 28 28 #include "CallFrame.h" 29 #include "GetterSetter.h"30 29 #include "Interpreter.h" 31 30 #include "JSFunction.h" … … 814 813 } 815 814 816 817 EncodedJSValue JSC_HOST_CALL globalFuncSetTypeErrorAccessor(ExecState* exec)818 {819 JSObject* target = jsDynamicCast<JSObject*>(exec->argument(0));820 JSValue propertyName = exec->argument(1);821 822 // Setting __proto__ of a primitive should have no effect.823 if (!target || !propertyName.isString())824 return JSValue::encode(jsUndefined());825 VM& vm = exec->vm();826 Identifier property(exec, asString(propertyName)->getString(exec));827 target->putDirectNonIndexAccessor(vm, vm.propertyNames->arguments, target->globalObject()->throwTypeErrorGetterSetter(vm), DontDelete | DontEnum | Accessor);828 return JSValue::encode(jsUndefined());829 }830 831 815 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
r167199 r167313 54 54 EncodedJSValue JSC_HOST_CALL globalFuncBuiltinLog(ExecState*); 55 55 56 EncodedJSValue JSC_HOST_CALL globalFuncSetTypeErrorAccessor(ExecState*);57 58 56 static const double mantissaOverflowLowerBound = 9007199254740992.0; 59 57 double parseIntOverflow(const LChar*, unsigned length, int radix); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r167199 r167313 2669 2669 return exec->vm().throwException(exec, createTypeError(exec, message)); 2670 2670 } 2671 2672 void JSObject::putDirectPrototypeProperty(VM& vm, JSValue value, int attributes) 2673 { 2674 putDirect(vm, vm.propertyNames->prototype, value, attributes); 2675 putDirect(vm, vm.propertyNames->prototypeForHasInstancePrivateName, value, attributes); 2676 } 2677 2678 void JSObject::putDirectPrototypePropertyWithoutTransitions(VM& vm, JSValue value, int attributes) 2679 { 2680 putDirectWithoutTransition(vm, vm.propertyNames->prototype, value, attributes); 2681 putDirectWithoutTransition(vm, vm.propertyNames->prototypeForHasInstancePrivateName, value, attributes); 2682 } 2683 2671 2684 2672 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r167199 r167313 933 933 } 934 934 935 JS_EXPORT_PRIVATE void putDirectPrototypeProperty(VM&, JSValue, int);936 void putDirectPrototypePropertyWithoutTransitions(VM&, JSValue, int);937 938 935 private: 939 936 friend class LLIntOffsetsExtractor; -
trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
r167199 r167313 87 87 { 88 88 Base::finishCreation(vm, "Promise"); 89 putDirect PrototypePropertyWithoutTransitions(vm, promisePrototype, DontEnum | DontDelete | ReadOnly);89 putDirectWithoutTransition(vm, vm.propertyNames->prototype, promisePrototype, DontEnum | DontDelete | ReadOnly); 90 90 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 91 91 } -
trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp
r167199 r167313 41 41 { 42 42 Base::finishCreation(vm, mapPrototype->classInfo()->className); 43 putDirect PrototypePropertyWithoutTransitions(vm, mapPrototype, DontEnum | DontDelete | ReadOnly);43 putDirectWithoutTransition(vm, vm.propertyNames->prototype, mapPrototype, DontEnum | DontDelete | ReadOnly); 44 44 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete); 45 45 } -
trunk/Source/JavaScriptCore/runtime/MapIteratorConstructor.cpp
r167199 r167313 40 40 { 41 41 Base::finishCreation(vm); 42 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);42 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 43 43 } 44 44 -
trunk/Source/JavaScriptCore/runtime/NameConstructor.cpp
r167199 r167313 45 45 { 46 46 Base::finishCreation(vm, prototype->classInfo()->className); 47 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);47 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 48 48 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); 49 49 } -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r167199 r167313 47 47 48 48 putDirect(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 49 putDirect PrototypeProperty(vm, prototype, DontDelete | ReadOnly | DontEnum);49 putDirect(vm, vm.propertyNames->prototype, prototype, DontDelete | ReadOnly | DontEnum); 50 50 m_errorStructure.set(vm, this, ErrorInstance::createStructure(vm, globalObject, prototype)); 51 51 ASSERT(m_errorStructure); -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r167199 r167313 67 67 68 68 // Number.Prototype 69 putDirect PrototypePropertyWithoutTransitions(vm, numberPrototype, DontEnum | DontDelete | ReadOnly);69 putDirectWithoutTransition(vm, vm.propertyNames->prototype, numberPrototype, DontEnum | DontDelete | ReadOnly); 70 70 71 71 // no. of arguments for constructor -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r167199 r167313 89 89 Base::finishCreation(vm, Identifier(&vm, "Object").string()); 90 90 // ECMA 15.2.3.1 91 putDirect PrototypePropertyWithoutTransitions(vm, objectPrototype, DontEnum | DontDelete | ReadOnly);91 putDirectWithoutTransition(vm, vm.propertyNames->prototype, objectPrototype, DontEnum | DontDelete | ReadOnly); 92 92 // no. of arguments for constructor 93 93 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r167199 r167313 96 96 97 97 // ECMA 15.10.5.1 RegExp.prototype 98 putDirect PrototypePropertyWithoutTransitions(vm, regExpPrototype, DontEnum | DontDelete | ReadOnly);98 putDirectWithoutTransition(vm, vm.propertyNames->prototype, regExpPrototype, DontEnum | DontDelete | ReadOnly); 99 99 100 100 // no. of arguments for constructor -
trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp
r167199 r167313 42 42 { 43 43 Base::finishCreation(vm, setPrototype->classInfo()->className); 44 putDirect PrototypePropertyWithoutTransitions(vm, setPrototype, DontEnum | DontDelete | ReadOnly);44 putDirectWithoutTransition(vm, vm.propertyNames->prototype, setPrototype, DontEnum | DontDelete | ReadOnly); 45 45 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete); 46 46 } -
trunk/Source/JavaScriptCore/runtime/SetIteratorConstructor.cpp
r167199 r167313 40 40 { 41 41 Base::finishCreation(vm); 42 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);42 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 43 43 } 44 44 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r167199 r167313 57 57 { 58 58 Base::finishCreation(vm, stringPrototype->classInfo()->className); 59 putDirect PrototypePropertyWithoutTransitions(vm, stringPrototype, ReadOnly | DontEnum | DontDelete);59 putDirectWithoutTransition(vm, vm.propertyNames->prototype, stringPrototype, ReadOnly | DontEnum | DontDelete); 60 60 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 61 61 } -
trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.cpp
r167199 r167313 40 40 { 41 41 Base::finishCreation(vm, prototype->classInfo()->className); 42 putDirect PrototypePropertyWithoutTransitions(vm, prototype, DontEnum | DontDelete | ReadOnly);42 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 43 43 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete); 44 44 } -
trunk/Source/WebCore/ChangeLog
r167308 r167313 1 2014-04-15 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r167199 and r167251. 4 https://bugs.webkit.org/show_bug.cgi?id=131678 5 6 Caused a DYEBench regression and does not seem to improve perf 7 on relevant websites (Requested by rniwa on #webkit). 8 9 Reverted changesets: 10 11 "Rewrite Function.bind as a builtin" 12 https://bugs.webkit.org/show_bug.cgi?id=131083 13 http://trac.webkit.org/changeset/167199 14 15 "Update test result" 16 http://trac.webkit.org/changeset/167251 17 1 18 2014-04-15 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 19 -
trunk/Source/WebCore/bindings/js/JSImageConstructor.cpp
r167199 r167313 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 , 2014Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 44 44 Base::finishCreation(globalObject); 45 45 ASSERT(inherits(info())); 46 putDirect PrototypeProperty(vm, JSHTMLImageElementPrototype::self(vm, globalObject), None);46 putDirect(vm, vm.propertyNames->prototype, JSHTMLImageElementPrototype::self(vm, globalObject), None); 47 47 } 48 48 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r167244 r167313 4527 4527 push(@$outputArray, " Base::finishCreation(vm);\n"); 4528 4528 push(@$outputArray, " ASSERT(inherits(info()));\n"); 4529 push(@$outputArray, " putDirect PrototypeProperty(vm, globalObject->prototype(), DontDelete | ReadOnly);\n");4529 push(@$outputArray, " putDirect(vm, vm.propertyNames->prototype, globalObject->prototype(), DontDelete | ReadOnly);\n"); 4530 4530 } elsif ($generatingNamedConstructor) { 4531 4531 push(@$outputArray, " Base::finishCreation(globalObject);\n"); 4532 4532 push(@$outputArray, " ASSERT(inherits(info()));\n"); 4533 push(@$outputArray, " putDirect PrototypeProperty(vm, ${className}Prototype::self(vm, globalObject), None);\n");4533 push(@$outputArray, " putDirect(vm, vm.propertyNames->prototype, ${className}Prototype::self(vm, globalObject), None);\n"); 4534 4534 } else { 4535 4535 push(@$outputArray, " Base::finishCreation(vm);\n"); 4536 4536 push(@$outputArray, " ASSERT(inherits(info()));\n"); 4537 push(@$outputArray, " putDirect PrototypeProperty(vm, ${protoClassName}::self(vm, globalObject), DontDelete | ReadOnly);\n");4537 push(@$outputArray, " putDirect(vm, vm.propertyNames->prototype, ${protoClassName}::self(vm, globalObject), DontDelete | ReadOnly);\n"); 4538 4538 } 4539 4539 push(@$outputArray, " putDirect(vm, vm.propertyNames->length, jsNumber(${leastConstructorLength}), ReadOnly | DontDelete | DontEnum);\n") if defined $leastConstructorLength; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
r167199 r167313 75 75 Base::finishCreation(vm); 76 76 ASSERT(inherits(info())); 77 putDirect PrototypeProperty(vm, JSTestActiveDOMObjectPrototype::self(vm, globalObject), DontDelete | ReadOnly);77 putDirect(vm, vm.propertyNames->prototype, JSTestActiveDOMObjectPrototype::self(vm, globalObject), DontDelete | ReadOnly); 78 78 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 79 79 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
r167199 r167313 71 71 Base::finishCreation(vm); 72 72 ASSERT(inherits(info())); 73 putDirect PrototypeProperty(vm, JSTestCustomNamedGetterPrototype::self(vm, globalObject), DontDelete | ReadOnly);73 putDirect(vm, vm.propertyNames->prototype, JSTestCustomNamedGetterPrototype::self(vm, globalObject), DontDelete | ReadOnly); 74 74 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 75 75 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
r167199 r167313 96 96 Base::finishCreation(vm); 97 97 ASSERT(inherits(info())); 98 putDirect PrototypeProperty(vm, JSTestEventConstructorPrototype::self(vm, globalObject), DontDelete | ReadOnly);98 putDirect(vm, vm.propertyNames->prototype, JSTestEventConstructorPrototype::self(vm, globalObject), DontDelete | ReadOnly); 99 99 putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 100 100 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
r167199 r167313 77 77 Base::finishCreation(vm); 78 78 ASSERT(inherits(info())); 79 putDirect PrototypeProperty(vm, JSTestEventTargetPrototype::self(vm, globalObject), DontDelete | ReadOnly);79 putDirect(vm, vm.propertyNames->prototype, JSTestEventTargetPrototype::self(vm, globalObject), DontDelete | ReadOnly); 80 80 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 81 81 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
r167199 r167313 70 70 Base::finishCreation(vm); 71 71 ASSERT(inherits(info())); 72 putDirect PrototypeProperty(vm, JSTestExceptionPrototype::self(vm, globalObject), DontDelete | ReadOnly);72 putDirect(vm, vm.propertyNames->prototype, JSTestExceptionPrototype::self(vm, globalObject), DontDelete | ReadOnly); 73 73 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 74 74 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
r167199 r167313 53 53 Base::finishCreation(vm); 54 54 ASSERT(inherits(info())); 55 putDirect PrototypeProperty(vm, JSTestGenerateIsReachablePrototype::self(vm, globalObject), DontDelete | ReadOnly);55 putDirect(vm, vm.propertyNames->prototype, JSTestGenerateIsReachablePrototype::self(vm, globalObject), DontDelete | ReadOnly); 56 56 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 57 57 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r167199 r167313 194 194 Base::finishCreation(vm); 195 195 ASSERT(inherits(info())); 196 putDirect PrototypeProperty(vm, JSTestInterfacePrototype::self(vm, globalObject), DontDelete | ReadOnly);196 putDirect(vm, vm.propertyNames->prototype, JSTestInterfacePrototype::self(vm, globalObject), DontDelete | ReadOnly); 197 197 putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 198 198 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r167199 r167313 57 57 Base::finishCreation(vm); 58 58 ASSERT(inherits(info())); 59 putDirect PrototypeProperty(vm, JSTestMediaQueryListListenerPrototype::self(vm, globalObject), DontDelete | ReadOnly);59 putDirect(vm, vm.propertyNames->prototype, JSTestMediaQueryListListenerPrototype::self(vm, globalObject), DontDelete | ReadOnly); 60 60 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 61 61 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
r167199 r167313 56 56 Base::finishCreation(vm); 57 57 ASSERT(inherits(info())); 58 putDirect PrototypeProperty(vm, JSTestNamedConstructorPrototype::self(vm, globalObject), DontDelete | ReadOnly);58 putDirect(vm, vm.propertyNames->prototype, JSTestNamedConstructorPrototype::self(vm, globalObject), DontDelete | ReadOnly); 59 59 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 60 60 } … … 99 99 Base::finishCreation(globalObject); 100 100 ASSERT(inherits(info())); 101 putDirect PrototypeProperty(vm, JSTestNamedConstructorPrototype::self(vm, globalObject), None);101 putDirect(vm, vm.propertyNames->prototype, JSTestNamedConstructorPrototype::self(vm, globalObject), None); 102 102 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 103 103 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
r167199 r167313 63 63 Base::finishCreation(vm); 64 64 ASSERT(inherits(info())); 65 putDirect PrototypeProperty(vm, JSTestNodePrototype::self(vm, globalObject), DontDelete | ReadOnly);65 putDirect(vm, vm.propertyNames->prototype, JSTestNodePrototype::self(vm, globalObject), DontDelete | ReadOnly); 66 66 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 67 67 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
r167251 r167313 65 65 Base::finishCreation(vm); 66 66 ASSERT(inherits(info())); 67 putDirect PrototypeProperty(vm, JSTestNondeterministicPrototype::self(vm, globalObject), DontDelete | ReadOnly);67 putDirect(vm, vm.propertyNames->prototype, JSTestNondeterministicPrototype::self(vm, globalObject), DontDelete | ReadOnly); 68 68 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 69 69 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r167199 r167313 243 243 Base::finishCreation(vm); 244 244 ASSERT(inherits(info())); 245 putDirect PrototypeProperty(vm, JSTestObjPrototype::self(vm, globalObject), DontDelete | ReadOnly);245 putDirect(vm, vm.propertyNames->prototype, JSTestObjPrototype::self(vm, globalObject), DontDelete | ReadOnly); 246 246 putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 247 247 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
r167199 r167313 122 122 Base::finishCreation(vm); 123 123 ASSERT(inherits(info())); 124 putDirect PrototypeProperty(vm, JSTestOverloadedConstructorsPrototype::self(vm, globalObject), DontDelete | ReadOnly);124 putDirect(vm, vm.propertyNames->prototype, JSTestOverloadedConstructorsPrototype::self(vm, globalObject), DontDelete | ReadOnly); 125 125 putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum); 126 126 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r167199 r167313 61 61 Base::finishCreation(vm); 62 62 ASSERT(inherits(info())); 63 putDirect PrototypeProperty(vm, JSTestSerializedScriptValueInterfacePrototype::self(vm, globalObject), DontDelete | ReadOnly);63 putDirect(vm, vm.propertyNames->prototype, JSTestSerializedScriptValueInterfacePrototype::self(vm, globalObject), DontDelete | ReadOnly); 64 64 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 65 65 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r167199 r167313 98 98 Base::finishCreation(vm); 99 99 ASSERT(inherits(info())); 100 putDirect PrototypeProperty(vm, JSTestTypedefsPrototype::self(vm, globalObject), DontDelete | ReadOnly);100 putDirect(vm, vm.propertyNames->prototype, JSTestTypedefsPrototype::self(vm, globalObject), DontDelete | ReadOnly); 101 101 putDirect(vm, vm.propertyNames->length, jsNumber(2), ReadOnly | DontDelete | DontEnum); 102 102 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
r167199 r167313 56 56 Base::finishCreation(vm); 57 57 ASSERT(inherits(info())); 58 putDirect PrototypeProperty(vm, JSattributePrototype::self(vm, globalObject), DontDelete | ReadOnly);58 putDirect(vm, vm.propertyNames->prototype, JSattributePrototype::self(vm, globalObject), DontDelete | ReadOnly); 59 59 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 60 60 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp
r167199 r167313 53 53 Base::finishCreation(vm); 54 54 ASSERT(inherits(info())); 55 putDirect PrototypeProperty(vm, JSreadonlyPrototype::self(vm, globalObject), DontDelete | ReadOnly);55 putDirect(vm, vm.propertyNames->prototype, JSreadonlyPrototype::self(vm, globalObject), DontDelete | ReadOnly); 56 56 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 57 57 }
Note: See TracChangeset
for help on using the changeset viewer.