WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
patch.diff (text/plain), 4.31 KB, created by
Saam Barati
on 2015-04-27 13:33:05 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2015-04-27 13:33:05 PDT
Size:
4.31 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 183399) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2015-04-27 Saam Barati <saambarati1@gmail.com> >+ >+ JSScope::abstractResolve does not always adhere to the global object's structure's request to not cache property accesses >+ https://bugs.webkit.org/show_bug.cgi?id=144265 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ abstractAccess used to check if the global object's structure disallows property >+ access caching *after* seeing if the property is in the global object's symbol table. >+ This check should happen *before* checking the symbol table because if the ordering >+ wasn't like this there is a chance we may cache an access that shouldn't be cached. >+ >+ * runtime/JSScope.cpp: >+ (JSC::abstractAccess): >+ > 2015-04-26 Ryosuke Niwa <rniwa@webkit.org> > > Class body ending with a semicolon throws a SyntaxError >Index: Source/JavaScriptCore/API/tests/testapi.c >=================================================================== >--- Source/JavaScriptCore/API/tests/testapi.c (revision 183299) >+++ Source/JavaScriptCore/API/tests/testapi.c (working copy) >@@ -960,6 +960,7 @@ static JSStaticValue globalObject_static > > static JSStaticFunction globalObject_staticFunctions[] = { > { "globalStaticFunction", globalObject_call, kJSPropertyAttributeNone }, >+ { "globalStaticFunction2", globalObject_call, kJSPropertyAttributeNone }, > { "gc", functionGC, kJSPropertyAttributeNone }, > { 0, 0, 0 } > }; >Index: Source/JavaScriptCore/API/tests/testapi.js >=================================================================== >--- Source/JavaScriptCore/API/tests/testapi.js (revision 183299) >+++ Source/JavaScriptCore/API/tests/testapi.js (working copy) >@@ -74,6 +74,20 @@ function globalStaticFunction() > > shouldBe("globalStaticValue", 3); > shouldBe("globalStaticFunction()", 4); >+shouldBe("this.globalStaticFunction()", 4); >+ >+function globalStaticFunction2() { >+ return 10; >+} >+shouldBe("globalStaticFunction2();", 10); >+this.globalStaticFunction2 = function() { return 20; } >+shouldBe("globalStaticFunction2();", 20); >+shouldBe("this.globalStaticFunction2();", 20); >+ >+function iAmNotAStaticFunction() { return 10; } >+shouldBe("iAmNotAStaticFunction();", 10); >+this.iAmNotAStaticFunction = function() { return 20; } >+shouldBe("iAmNotAStaticFunction();", 20); > > shouldBe("typeof MyObject", "function"); // our object implements 'call' > MyObject.cantFind = 1; >Index: Source/JavaScriptCore/runtime/JSScope.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/JSScope.cpp (revision 183299) >+++ Source/JavaScriptCore/runtime/JSScope.cpp (working copy) >@@ -72,6 +72,14 @@ static inline bool abstractAccess(ExecSt > } > > if (JSGlobalObject* globalObject = jsDynamicCast<JSGlobalObject*>(scope)) { >+ if (!globalObject->structure()->propertyAccessesAreCacheable() >+ || (globalObject->structure()->hasReadOnlyOrGetterSetterPropertiesExcludingProto() && getOrPut == Put)) { >+ // We know the property will be at global scope, but we don't know how to cache it. >+ ASSERT(!scope->next()); >+ op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, 0, 0, 0, 0); >+ return true; >+ } >+ > SymbolTableEntry entry = globalObject->symbolTable()->get(ident.impl()); > if (!entry.isNull()) { > if (getOrPut == Put && entry.isReadOnly()) { >@@ -87,10 +95,7 @@ static inline bool abstractAccess(ExecSt > } > > PropertySlot slot(globalObject); >- if (!globalObject->getOwnPropertySlot(globalObject, exec, ident, slot) >- || !slot.isCacheableValue() >- || !globalObject->structure()->propertyAccessesAreCacheable() >- || (globalObject->structure()->hasReadOnlyOrGetterSetterPropertiesExcludingProto() && getOrPut == Put)) { >+ if (!globalObject->getOwnPropertySlot(globalObject, exec, ident, slot) || !slot.isCacheableValue()) { > // We know the property will be at global scope, but we don't know how to cache it. > ASSERT(!scope->next()); > op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, 0, 0, 0, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
saam
:
review-
saam
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 144265
:
251758
|
251774
|
251797