WebKit Bugzilla
Attachment 341943 Details for
Bug 186295
: Add test for CoW conversions in the DFG/FTL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186295-20180604183200.patch (text/plain), 4.98 KB, created by
Keith Miller
on 2018-06-04 18:31:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Keith Miller
Created:
2018-06-04 18:31:59 PDT
Size:
4.98 KB
patch
obsolete
>Subversion Revision: 232376 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index b3878cef5efbf367d7a1b90057b005771edfdb03..28bda7dd014ba2df11361fd624497ef7772f2b64 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-04 Keith Miller <keith_miller@apple.com> >+ >+ Add test for CoW conresions in the DFG/FTL >+ https://bugs.webkit.org/show_bug.cgi?id=186295 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a function to $vm that returns a JSString containing the >+ dataLog dump of the indexingMode of an Object. >+ >+ * tools/JSDollarVM.cpp: >+ (JSC::functionIndexingMode): >+ (JSC::JSDollarVM::finishCreation): >+ > 2018-05-31 Keith Miller <keith_miller@apple.com> > > DFGArrayModes needs to know more about CoW arrays >diff --git a/Source/JavaScriptCore/tools/JSDollarVM.cpp b/Source/JavaScriptCore/tools/JSDollarVM.cpp >index 8d75484465f5561cdc77eed0fd59b4dc51d7ffaa..96204c6e9329e8d1add4d7a2734e37dd00d10639 100644 >--- a/Source/JavaScriptCore/tools/JSDollarVM.cpp >+++ b/Source/JavaScriptCore/tools/JSDollarVM.cpp >@@ -1366,6 +1366,18 @@ static EncodedJSValue JSC_HOST_CALL functionPrintStack(ExecState* exec) > return JSValue::encode(jsUndefined()); > } > >+// Gets the dataLog dump of the indexingMode of the passed value. >+// Usage: print("indexingMode = " + $vm.indexingMode(jsValue)) >+static EncodedJSValue JSC_HOST_CALL functionIndexingMode(ExecState* exec) >+{ >+ if (!exec->argument(0).isObject()) >+ return encodedJSUndefined(); >+ >+ WTF::StringPrintStream stream; >+ stream.print(IndexingTypeDump(exec->uncheckedArgument(0).getObject()->indexingMode())); >+ return JSValue::encode(jsString(exec, stream.toString())); >+} >+ > // Gets the dataLog dump of a given JS value as a string. > // Usage: print("value = " + $vm.value(jsValue)) > static EncodedJSValue JSC_HOST_CALL functionValue(ExecState* exec) >@@ -1811,6 +1823,7 @@ void JSDollarVM::finishCreation(VM& vm) > addFunction(vm, "printCallFrame", functionPrintCallFrame, 0); > addFunction(vm, "printStack", functionPrintStack, 0); > >+ addFunction(vm, "indexingMode", functionIndexingMode, 1); > addFunction(vm, "value", functionValue, 1); > addFunction(vm, "getpid", functionGetPID, 0); > >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 0f4b6ef2fd8217c1e4f3770719b940a0f5662602..0fd9d852e86ddd5eb1d43f92504d754abe39ae7c 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-04 Keith Miller <keith_miller@apple.com> >+ >+ Add test for CoW conresions in the DFG/FTL >+ https://bugs.webkit.org/show_bug.cgi?id=186295 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * stress/arrayprofile-should-not-convert-get-by-val-cow.js: Added. >+ (assertEq): >+ (withArrayArgInt32): >+ (withArrayLiteralInt32): >+ (withArrayArgDouble): >+ (withArrayLiteralDouble): >+ (withArrayArgContiguous): >+ (withArrayLiteralContiguous): >+ (test): >+ > 2018-05-31 Keith Miller <keith_miller@apple.com> > > Rebaseline test for change in Error.stack behavior. >diff --git a/JSTests/stress/arrayprofile-should-not-convert-get-by-val-cow.js b/JSTests/stress/arrayprofile-should-not-convert-get-by-val-cow.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bc59059f3511eb4113df7a7b33a1432cdb921e3f >--- /dev/null >+++ b/JSTests/stress/arrayprofile-should-not-convert-get-by-val-cow.js >@@ -0,0 +1,57 @@ >+function assertEq(a, b) { >+ if (a !== b) >+ throw new Error("values not the same: " + a + " and " + b); >+} >+ >+function withArrayArgInt32(i, array) { >+ let result = array[i]; >+ assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithInt32"); >+} >+noInline(withArrayArgInt32); >+ >+function withArrayLiteralInt32(i) { >+ let array = [0,1,2]; >+ let result = array[i]; >+ assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithInt32"); >+} >+noInline(withArrayLiteralInt32); >+ >+ >+function withArrayArgDouble(i, array) { >+ let result = array[i]; >+ assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithDouble"); >+} >+noInline(withArrayArgDouble); >+ >+function withArrayLiteralDouble(i) { >+ let array = [0,1.3145,2]; >+ let result = array[i]; >+ assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithDouble"); >+} >+noInline(withArrayLiteralDouble); >+ >+function withArrayArgContiguous(i, array) { >+ let result = array[i]; >+ assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithContiguous"); >+} >+noInline(withArrayArgContiguous); >+ >+function withArrayLiteralContiguous(i) { >+ let array = [0,"string",2]; >+ let result = array[i]; >+ assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithContiguous"); >+} >+noInline(withArrayLiteralContiguous); >+ >+function test() { >+ withArrayArgInt32(0, [0,1,2]); >+ withArrayArgDouble(0, [0,1.3145,2]); >+ withArrayArgContiguous(0, [0,"string",2]); >+ >+ withArrayLiteralInt32(0); >+ withArrayLiteralDouble(0); >+ withArrayLiteralContiguous(0); >+} >+ >+for (let i = 0; i < 10000; i++) >+ test();
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186295
:
341943
|
341944