diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / libraries / chain / thread_utils . cpp <nl> ppp b / libraries / chain / thread_utils . cpp <nl> namespace eosio { namespace chain { <nl> / / <nl> named_thread_pool : : named_thread_pool ( std : : string name_prefix , size_t num_threads ) <nl> : _thread_pool ( num_threads ) <nl> + , _ioc ( num_threads ) <nl> { <nl> _ioc_work . emplace ( boost : : asio : : make_work_guard ( _ioc ) ) ; <nl> for ( size_t i = 0 ; i < num_threads ; + + i ) { <nl>
|
Pass num_threads to io_context as a hint of # of threads
|
EOSIO/eos
|
1dc051608b0a02b04e4e596dc9077ed5cd3f351f
|
2020-02-03T14:45:17Z
|
mmm a / Documentation / Books / Makefile <nl> ppp b / Documentation / Books / Makefile <nl> newVersionNumber = $ ( shell cat . . / . . / VERSION ) <nl> # per book targets <nl> check - summary : <nl> @ echo " # # # # # checking summary for $ ( NAME ) " <nl> - @ find ppbooks / $ ( NAME ) - name \ * . md | sed - e " s ; ppbooks / $ ( NAME ) / ; ; " | grep - vf SummaryBlacklist . txt | sort > / tmp / is_md . txt <nl> + @ find ppbooks / $ ( NAME ) - name \ * . md | sed - e " s ; ppbooks / $ ( NAME ) / ; ; " | grep - vf SummaryBlacklist . txt | grep - v gitbook - plugin | sort > / tmp / is_md . txt <nl> @ cat $ ( NAME ) / SUMMARY . md | grep - v ' ^ * # ' | grep ' ( ' | sed - e " s ; . * ( ; ; " - e " s ; ) . * ; ; " | sort > / tmp / is_summary . txt <nl> @ if test " ` comm - 3 / tmp / is_md . txt / tmp / is_summary . txt | wc - l ` " - ne 0 ; then \ <nl> echo " not all files are mapped to the summary ! " ; \ <nl> build - book : <nl> fi <nl> cd ppbooks / $ ( NAME ) ; if ! test - L SUMMARY . md ; then ln - s . . / . . / $ ( NAME ) / SUMMARY . md . ; fi <nl> cd ppbooks / $ ( NAME ) ; if ! test - f HEADER . html ; then cp . . / . . / $ ( NAME ) / HEADER . html . ; fi <nl> - cd ppbooks / $ ( NAME ) ; if ! test - f book . json ; then cp . . / . . / $ ( NAME ) / book . json . ; fi <nl> + if test - z " $ { RELEASE_DIRECTORY } " ; then \ <nl> + if ! test - f ppbooks / $ ( NAME ) / book . json ; then cp $ ( NAME ) / book . json ppbooks / $ ( NAME ) ; fi ; \ <nl> + else \ <nl> + if ! test - f ppbooks / $ ( NAME ) / book . json ; then cat $ ( NAME ) / book . json | sed " s ; / devel ; / $ { RELEASE_DIRECTORY } ; " > ppbooks / $ ( NAME ) / book . json ; fi ; \ <nl> + fi <nl> cd ppbooks / $ ( NAME ) ; cp - a . . / . . / $ ( NAME ) / styles / * styles / <nl> WD = ` pwd ` ; \ <nl> for pic in ` find $ ( NAME ) - name \ * . png ` ; do \ <nl> build - book : <nl> rm - f . / books / $ ( NAME ) / HEADER . html <nl> python . . / Scripts / deprecated . py <nl> <nl> - # make book - check - markdown - leftovers <nl> + make book - check - markdown - leftovers <nl> <nl> clean - book : <nl> @ rm - rvf books / $ ( NAME ) <nl>
|
Fix checkers , and re - enable those since the incidents are now fixed .
|
arangodb/arangodb
|
5c432a2e77cbf9161c99e7c5f47ab8916da5f61c
|
2016-05-31T14:56:30Z
|
new file mode 100644 <nl> index 000000000000 . . f626f36f95c2 <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / androidtest - debug3 . bat <nl> <nl> + : : This script is used to finish a android automated compiler . <nl> + : : You should make sure have finished the environment setting . <nl> + : : Here are the environment variables you should set . <nl> + : : % ANT_HOME % % ANDROID_HOME % % JAVA_HOME % % CYGWIN % % GITBIN % % ANDROID_NDK % <nl> + : : Don ' t change it until you know what you do . <nl> + <nl> + : : In order to prevent the problem of permission , make the current user group get the ownership of project . <nl> + : : Set the current user name . <nl> + : : set _USERNAME = <nl> + <nl> + set _PROJECTNAME = TestCpp <nl> + cd . . \ . . <nl> + <nl> + : project <nl> + : : Copy build Configuration files to target directory <nl> + copy % cd % \ tools \ JenkinsScript \ ant . properties % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ build . xml % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ rootconfig . sh % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + <nl> + : : Modify the configuration files <nl> + cd samples \ % _PROJECTNAME % \ proj . android <nl> + rootconfig . sh % _PROJECTNAME % <nl> + cd . . <nl> + set _PROJECTLOCATION = % cd % <nl> + <nl> + : : A command line that make the current user get the ownrship of project . <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + <nl> + : : Use cygwin compile the source code . <nl> + cygpath " % _PROJECTLOCATION % \ proj . android \ build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + : : echo " % _PROJECTION % / proj . android / build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + call android update project - p proj . android <nl> + cd proj . android <nl> + <nl> + : : Make sure the original android build target is android - 8 <nl> + for / f " delims = " % % a in ( ' findstr / i " target = android - " ant . properties ' ) do set xx = % % a <nl> + echo % xx % <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " % xx % " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 8 ) . <nl> + call ant debug <nl> + set result8 = % ERROELEVEL % <nl> + <nl> + : : Change API level . ( API level : 10 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 8 " ( echo / target = android - 10 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 10 ) . <nl> + call ant debug <nl> + set result10 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 11 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 10 " ( echo / target = android - 11 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 11 ) . <nl> + call ant debug <nl> + set result11 = % ERRORlEVEL % <nl> + <nl> + : : Change API level . ( API level : 12 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 11 " ( echo / target = android - 12 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 12 ) . <nl> + call ant debug <nl> + set result12 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 13 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 12 " ( echo / target = android - 13 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 13 ) . <nl> + call ant debug <nl> + set result13 = % ERRORLEVEL % <nl> + <nl> + : : After all test versions completed , changed current API level to the original . ( API level : 8 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 13 " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Calculate the errorlevel and change build target . <nl> + cd . . \ . . \ . . <nl> + IF " % _PROJECTNAME % " = = " TestCpp " set / a testresult1 = ( result8 + result10 + result11 + result12 + result13 ) & & set _PROJECTNAME = HelloCpp & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloCpp " set / a testresult2 = ( result8 + result10 + result11 + result12 + result13 ) & & set _PROJECTNAME = HelloLua & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloLua " set / a testresult3 = ( result8 + result10 + result11 + result12 + result13 ) <nl> + set / a testresult = ( testresult1 + result2 + result3 ) <nl> + IF % testresult % NEQ 0 goto error <nl> + <nl> + goto success <nl> + <nl> + : error <nl> + echo Error . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df - x | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 1 <nl> + goto end <nl> + <nl> + : success <nl> + echo Success . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 0 <nl> + goto end <nl> + <nl> + : : End . <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . 4e07b7479b56 <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / androidtest - debug4 . bat <nl> <nl> + : : This script is used to finish a android automated compiler . <nl> + : : You should make sure have finished the environment setting . <nl> + : : Here are the environment variables you should set . <nl> + : : % ANT_HOME % % ANDROID_HOME % % JAVA_HOME % % CYGWIN % % GITBIN % % ANDROID_NDK % <nl> + : : Don ' t change it until you know what you do . <nl> + <nl> + : : In order to prevent the problem of permission , make the current user group get the ownership of project . <nl> + : : Set the current user name . <nl> + : : set _USERNAME = <nl> + <nl> + set _PROJECTNAME = TestCpp <nl> + cd . . \ . . <nl> + <nl> + : project <nl> + : : Copy build Configuration files to target directory <nl> + copy % cd % \ tools \ JenkinsScript \ ant . properties % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ build . xml % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ rootconfig . sh % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + <nl> + : : Modify the configuration files <nl> + cd samples \ % _PROJECTNAME % \ proj . android <nl> + rootconfig . sh % _PROJECTNAME % <nl> + cd . . <nl> + set _PROJECTLOCATION = % cd % <nl> + <nl> + : : A command line that make the current user get the ownrship of project . <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + <nl> + : : Use cygwin compile the source code . <nl> + cygpath " % _PROJECTLOCATION % \ proj . android \ build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + : : echo " % _PROJECTION % / proj . android / build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + call android update project - p proj . android <nl> + cd proj . android <nl> + <nl> + for / f " delims = " % % a in ( ' findstr / i " target = android - " ant . properties ' ) do set xx = % % a <nl> + echo % xx % <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " % xx % " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Change API level . ( API level : 14 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 8 " ( echo / target = android - 14 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 14 ) . <nl> + call ant debug <nl> + set result14 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 15 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 14 " ( echo / target = android - 15 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Android ant build ( debug , API level : 15 ) . <nl> + call ant debug <nl> + set result15 = % ERRORLEVEL % <nl> + <nl> + : : After all test versions completed , changed current API level to the original . ( API level : 8 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 15 " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Calculate the errorlevel and change build target . <nl> + cd . . / . . / . . <nl> + IF " % _PROJECTNAME % " = = " TestCpp " set / a testresult1 = ( result8 + result10 + result11 + result12 + result13 ) & & set _PROJECTNAME = HelloCpp & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloCpp " set / a testresult2 = ( result8 + result10 + result11 + result12 + result13 ) & & set _PROJECTNAME = HelloLua & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloLua " set / a testresult3 = ( result8 + result10 + result11 + result12 + result13 ) <nl> + set / a testresult = ( testresult1 + result2 + result3 ) <nl> + IF % testresult % NEQ 0 goto error <nl> + <nl> + goto success <nl> + <nl> + : error <nl> + echo Error . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df - x | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 1 <nl> + goto end <nl> + <nl> + : success <nl> + echo Success . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 0 <nl> + goto end <nl> + <nl> + : : End . <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . f84cb65cf7ad <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / androidtest - release3 . bat <nl> <nl> + : : This script is used to finish a android automated compiler . <nl> + : : You should make sure have finished the environment setting . <nl> + : : Here are the environment variables you should set . <nl> + : : % ANT_HOME % % ANDROID_HOME % % JAVA_HOME % % CYGWIN % % GITBIN % % ANDROID_NDK % <nl> + : : Don ' t change it until you know what you do . <nl> + <nl> + : : In order to prevent the problem of permission , make the current user group get the ownership of project . <nl> + : : Set the current user name . <nl> + : : set _USERNAME = <nl> + <nl> + set _PROJECTNAME = TestCpp <nl> + cd . . \ . . <nl> + <nl> + : project <nl> + : : Copy build Configuration files to target directory <nl> + copy % cd % \ tools \ JenkinsScript \ ant . properties % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ build . xml % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ rootconfig . sh % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + <nl> + : : Modify the configuration files <nl> + cd samples \ % _PROJECTNAME % \ proj . android <nl> + rootconfig . sh % _PROJECTNAME % <nl> + cd . . <nl> + set _PROJECTLOCATION = % cd % <nl> + <nl> + : : A command line that make the current user get the ownrship of project . <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + <nl> + : : Use cygwin compile the source code . <nl> + cygpath " % _PROJECTLOCATION % \ proj . android \ build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + : : echo " % _PROJECTION % / proj . android / build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + call android update project - p proj . android <nl> + cd proj . android <nl> + <nl> + : : Make sure the original android build target is android - 8 <nl> + for / f " delims = " % % a in ( ' findstr / i " target = android - " ant . properties ' ) do set xx = % % a <nl> + echo % xx % <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " % xx % " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 8 ) . <nl> + call ant release <nl> + set result8 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 10 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 8 " ( echo / target = android - 10 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 10 ) . <nl> + call ant release <nl> + set result10 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 11 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 10 " ( echo / target = android - 11 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 11 ) . <nl> + call ant release <nl> + set result11 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 12 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 11 " ( echo / target = android - 12 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 12 ) . <nl> + call ant release <nl> + set result12 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 13 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 12 " ( echo / target = android - 13 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 13 ) . <nl> + call ant release <nl> + set result13 = % ERRORLEVEL % <nl> + <nl> + : : After all test versions completed , changed current API level to the original . ( API level : 8 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 13 " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Calculate the errorlevel and change build target . <nl> + cd . . \ . . \ . . <nl> + IF " % _PROJECTNAME % " = = " TestCpp " set / a testresult1 = ( result8 + result10 + result11 + result12 + result13 ) & & set _PROJECTNAME = HelloCpp & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloCpp " set / a testresult2 = ( result8 + result10 + result11 + result12 + result13 ) & & set _PROJECTNAME = HelloLua & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloLua " set / a testresult3 = ( result8 + result10 + result11 + result12 + result13 ) <nl> + set / a testresult = ( testresult1 + result2 + result3 ) <nl> + IF % testresult % NEQ 0 goto error <nl> + <nl> + goto success <nl> + <nl> + : lis <nl> + if " % num % " = = " " goto : eof <nl> + if " % num : ~ - 1 % " = = " " set num = % num : ~ 0 , - 1 % & goto lis <nl> + echo % num % > > ant1 . properties <nl> + goto : eof <nl> + <nl> + : error <nl> + echo Error . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 1 <nl> + goto end <nl> + <nl> + : success <nl> + echo Success . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 0 <nl> + goto end <nl> + <nl> + : : End . <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . b9f1f37ca80d <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / androidtest - release4 . bat <nl> <nl> + : : This script is used to finish a android automated compiler . <nl> + : : You should make sure have finished the environment setting . <nl> + : : Here are the environment variables you should set . <nl> + : : % ANT_HOME % % ANDROID_HOME % % JAVA_HOME % % CYGWIN % % GITBIN % % ANDROID_NDK % <nl> + : : Don ' t change it until you know what you do . <nl> + <nl> + : : In order to prevent the problem of permission , make the current user group get the ownership of project . <nl> + : : Set the current user name . <nl> + : : set _USERNAME = <nl> + <nl> + set _PROJECTNAME = TestCpp <nl> + cd . . \ . . <nl> + <nl> + : project <nl> + copy % cd % \ tools \ JenkinsScript \ ant . properties % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ build . xml % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + copy % cd % \ tools \ JenkinsScript \ rootconfig . sh % cd % \ samples \ % _PROJECTNAME % \ proj . android <nl> + cd samples \ % _PROJECTNAME % \ proj . android <nl> + rootconfig . sh % _PROJECTNAME % <nl> + cd . . <nl> + set _PROJECTLOCATION = % cd % <nl> + <nl> + : : A command line that make the current user get the ownrship of project . <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + <nl> + : : Use cygwin compile the source code . <nl> + cygpath " % _PROJECTLOCATION % \ proj . android \ build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + : : echo " % _PROJECTION % / proj . android / build_native . sh " | call % CYGWIN % \ Cygwin . bat <nl> + <nl> + : : cacls proj . android \ * . * / T / E / C / P % _USERNAME % : F <nl> + call android update project - p proj . android <nl> + cd proj . android <nl> + <nl> + for / f " delims = " % % a in ( ' findstr / i " target = android - " ant . properties ' ) do set xx = % % a <nl> + echo % xx % <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " % xx % " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " anttmp . properties " <nl> + move anttmp . properties ant . properties <nl> + <nl> + : : Change API level . ( API level : 14 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 8 " ( echo / target = android - 14 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 14 ) . <nl> + call ant release <nl> + set result14 = % ERRORLEVEL % <nl> + <nl> + : : Change API level . ( API level : 15 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 14 " ( echo / target = android - 15 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + : : Android ant build ( release , API level : 15 ) . <nl> + call ant release <nl> + set result15 = % ERRORLEVEL % <nl> + <nl> + : : After all test versions completed , changed current API level to the original . ( API level : 8 ) <nl> + for / f " delims = " % % a in ( ant . properties ) do ( <nl> + if " % % a " = = " target = android - 15 " ( echo / target = android - 8 ) else echo / % % a <nl> + ) > > " ant1 . properties " <nl> + move ant1 . properties ant . properties <nl> + <nl> + for / f " delims = " % % a in ( ant . properties ) do set num = % % a & call : lis <nl> + move ant1 . properties ant . properties <nl> + <nl> + cd . . \ . . \ . . <nl> + IF " % _PROJECTNAME % " = = " TestCpp " set / a testresult1 = ( result14 + result15 ) & & set _PROJECTNAME = HelloCpp & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloCpp " set / a testresult2 = ( result14 + result15 ) & & set _PROJECTNAME = HelloLua & & goto project <nl> + IF " % _PROJECTNAME % " = = " HelloLua " set / a testresult3 = ( result14 + result15 ) <nl> + set / a testresult = ( testresult1 + result2 + result3 ) <nl> + IF % testresult % NEQ 0 goto error <nl> + <nl> + goto success <nl> + <nl> + : lis <nl> + if " % num % " = = " " goto : eof <nl> + if " % num : ~ - 1 % " = = " " set num = % num : ~ 0 , - 1 % & goto lis <nl> + echo % num % > > ant1 . properties <nl> + goto : eof <nl> + <nl> + : error <nl> + echo Error . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 1 <nl> + goto end <nl> + <nl> + : success <nl> + echo Success . <nl> + git checkout - f | % GITBIN % \ sh . exe - - login <nl> + git clean - df | % GITBIN % \ sh . exe - - login <nl> + pause <nl> + exit 0 <nl> + goto end <nl> + <nl> + : : End . <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . fab374d23638 <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / androidtestcommon . bat <nl> <nl> + echo off <nl> + rem = = = = = = = = = Basic parameters = = = = = = = = = = = = <nl> + rem jdk path <nl> + set JAVA_HOME = C : \ Program Files \ Java \ jdk1 . 6 . 0_31 <nl> + rem jdk version <nl> + set JDK_Version = 1 . 6 <nl> + rem sdk path <nl> + set AndroidHome = D : \ Windows7 \ android - sdk - windows <nl> + rem android version path <nl> + set AndroidVersion = \ platforms \ android - 8 <nl> + rem android project path <nl> + set AndroidProject = D : \ cocos2d - x \ tests \ proj . android <nl> + rem unsigned apk name <nl> + set unsign_apk = Tests . apk <nl> + rem signed apk name <nl> + set sign_apk = Tests - sign . apk <nl> + rem sign keystore <nl> + set apk_key = cdykeystore <nl> + set apk_keypass = 123456 <nl> + set apk_keystore = D : \ cdykeystore <nl> + <nl> + for % % x in ( " % AndroidProject % " ) do set AndroidProject = % % ~ sx <nl> + for % % x in ( " % JAVA_HOME % " ) do set JAVA_HOME = % % ~ sx <nl> + for % % x in ( " % AndroidHome % " ) do set AndroidHome = % % ~ sx <nl> + <nl> + rem jdk kit <nl> + set EXE_JAVA = % JAVA_HOME % \ bin \ java <nl> + set JAVAC = % JAVA_HOME % \ bin \ javac <nl> + set JAR = % JAVA_HOME % \ bin \ jar <nl> + set KeyTool = % JAVA_HOME % \ bin \ keytool <nl> + set Jarsigner = % JAVA_HOME % \ bin \ jarsigner <nl> + <nl> + rem sdk kit <nl> + set AndroidAAPT = % AndroidHome % \ platform - tools \ aapt . exe <nl> + set AndroidDx = % AndroidHome % \ platform - tools \ dx . bat <nl> + set AndroidApkBuilder = % AndroidHome % \ tools \ apkbuilder . bat <nl> + set AndroidJar = % AndroidHome % % AndroidVersion % \ android . jar <nl> + <nl> + rem android project directory <nl> + set AndroidProjectDrive = D : <nl> + set AndroidProjectRes = % AndroidProject % \ res <nl> + set AndroidProjectGen = % AndroidProject % \ gen <nl> + set AndroidProjectBin = % AndroidProject % \ bin <nl> + set AndroidProjectAsset = % AndroidProject % \ assets <nl> + set AndroidProjectLibs = % AndroidProject % \ libs <nl> + set AndroidProjectAndroidMainfest = % AndroidProject % \ AndroidManifest . xml <nl> + set AndroidProjectSrc = % AndroidProject % \ src \ org \ cocos2dx \ tests \ * . java <nl> + set AndroidProjectSrc = % AndroidProjectSrc % % AndroidProject % \ src \ org \ cocos2dx \ lib \ * . java <nl> + set AndroidProjectSrc = % AndroidProjectSrc % % AndroidProject % \ gen \ org \ cocos2dx \ tests \ * . java <nl> + <nl> + rem output file <nl> + set AndroidProjectClassDex = % AndroidProject % \ bin \ classes . dex <nl> + set AndroidProjectResources = % AndroidProject % \ bin \ resources . ap_ <nl> + set AndroidProjectApk = " % AndroidProject % \ bin \ % unsign_apk % " <nl> + set AndroidProjectSignApk = " % AndroidProject % \ bin \ % sign_apk % " <nl> + <nl> + mkdir % AndroidProject % \ gen <nl> + mkdir % AndroidProject % \ src \ org \ cocos2dx \ lib <nl> + mkdir % AndroidProject % \ bin <nl> + : : mkdir % AndroidProject % \ bin \ classes <nl> + xcopy D : \ cocos2d - x \ cocos2dx \ platform \ android \ java \ src_common \ org \ cocos2dx \ lib % AndroidProject % \ src \ org \ cocos2dx \ lib / s <nl> + <nl> + echo generate R . java file <nl> + % AndroidAAPT % package - f - m - J % AndroidProjectGen % - S % AndroidProjectRes % - I % AndroidJar % - M % AndroidProjectAndroidMainfest % <nl> + <nl> + echo generate class file <nl> + % JAVAC % - encoding UTF - 8 - target % JDK_Version % - bootclasspath % AndroidJar % - d % AndroidProjectBin % % AndroidProjectSrc % % AndroidProjectGen % \ org \ cocos2dx \ tests \ R . java <nl> + <nl> + echo generate dex file <nl> + echo on <nl> + % AndroidProjectDrive % <nl> + cd % AndroidProjectBin % <nl> + rem packaging the * . class file into * . jar file <nl> + % JAR % cvf % AndroidProjectBin % \ classes . jar * . * <nl> + cd % AndroidProject % <nl> + rem generate * . dex file <nl> + call % AndroidDx % - - dex - - output = % AndroidProjectClassDex % % AndroidProjectBin % \ classes . jar <nl> + <nl> + echo package resources files <nl> + % AndroidAAPT % package - f - M % AndroidProjectAndroidMainfest % - S % AndroidProjectRes % - A % AndroidProjectAsset % - I % AndroidJar % - F % AndroidProjectResources % <nl> + <nl> + echo generate unsigned apk file <nl> + call % AndroidApkBuilder % % AndroidProjectApk % - v - u - z % AndroidProjectResources % - f % AndroidProjectClassDex % - rf % AndroidProject % \ src - nf % AndroidProjectLibs % - rj % AndroidProjectLibs % <nl> + <nl> + echo generate signed apk file <nl> + % Jarsigner % - verbose - keystore % apk_keystore % - keypass % apk_keypass % - storepass % apk_keypass % - signedjar % AndroidProjectSignApk % % AndroidProjectApk % cdykeystore <nl> + <nl> + echo sign success ! <nl> + pause <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . de55aea4578d <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / ant . properties <nl> <nl> + # This file is used to override default values used by the Ant build system . <nl> + # <nl> + # This file must be checked in Version Control Systems , as it is <nl> + # integral to the build system of your project . <nl> + # This file is only used by the Ant script . <nl> + # You can use this to override default values such as <nl> + # ' source . dir ' for the location of your java source folder and <nl> + # ' out . dir ' for the location of your output folder . <nl> + # You can also use it define how the release builds are signed by declaring <nl> + # the following properties : <nl> + # ' key . store ' for the location of your keystore and <nl> + # ' key . alias ' for the name of the key to use . <nl> + # The password will be asked during the build when you use the ' release ' target . <nl> + key . store = C : / . android / debug . keystore <nl> + key . alias = androiddebugkey <nl> + key . store . password = android <nl> + key . alias . password = android <nl> + # proguard . config = proguard . cfg <nl> + # Project target . <nl> + target = android - 8 <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . dc1291ca26ee <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / build . xml <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < project name = " Tests " default = " help " > <nl> + <nl> + < ! - - The local . properties file is created and updated by the ' android ' tool . <nl> + It contains the path to the SDK . It should * NOT * be checked into <nl> + Version Control Systems . - - > <nl> + < loadproperties srcFile = " local . properties " / > <nl> + <nl> + < ! - - The ant . properties file can be created by you . It is only edited by the <nl> + ' android ' tool to add properties to it . <nl> + This is the place to change some Ant specific build properties . <nl> + Here are some properties you may want to change / update : <nl> + <nl> + source . dir <nl> + The name of the source directory . Default is ' src ' . <nl> + out . dir <nl> + The name of the output directory . Default is ' bin ' . <nl> + <nl> + For other overridable properties , look at the beginning of the rules <nl> + files in the SDK , at tools / ant / build . xml <nl> + <nl> + Properties related to the SDK location or the project target should <nl> + be updated using the ' android ' tool with the ' update ' action . <nl> + <nl> + This file is an integral part of the build system for your <nl> + application and should be checked into Version Control Systems . <nl> + <nl> + - - > <nl> + < property file = " ant . properties " / > <nl> + <nl> + < ! - - The project . properties file is created and updated by the ' android ' <nl> + tool , as well as ADT . <nl> + <nl> + This contains project specific properties such as project target , and library <nl> + dependencies . Lower level build properties are stored in ant . properties <nl> + ( or in . classpath for Eclipse projects ) . <nl> + <nl> + This file is an integral part of the build system for your <nl> + application and should be checked into Version Control Systems . - - > <nl> + < loadproperties srcFile = " project . properties " / > <nl> + <nl> + < ! - - quick check on sdk . dir - - > <nl> + < fail <nl> + message = " sdk . dir is missing . Make sure to generate local . properties using ' android update project ' " <nl> + unless = " sdk . dir " <nl> + / > <nl> + <nl> + <nl> + < ! - - extension targets . Uncomment the ones where you want to do custom work <nl> + in between standard targets - - > <nl> + <nl> + < target name = " - pre - build " > <nl> + < copy todir = " src / org / cocos2dx " > <nl> + < fileset dir = " . . \ . . \ . . \ cocos2dx \ platform \ android \ java \ src_common \ org \ cocos2dx " > <nl> + < include name = " lib / " / > <nl> + < / fileset > <nl> + < / copy > <nl> + < / target > <nl> + < target name = " - pre - compile " > <nl> + < path id = " android . target . classpath " > <nl> + < pathelement path = " $ { sdk . dir } / platforms / $ { target } / android . jar " / > <nl> + < pathelement path = " $ { sdk . dir } / platforms / $ { target } / data / layoutlib . jar " / > <nl> + < / path > <nl> + < / target > <nl> + <nl> + < ! - - <nl> + / * This is typically used for code obfuscation . <nl> + Compiled code location : $ { out . classes . absolute . dir } <nl> + If this is not done in place , override $ { out . dex . input . absolute . dir } * / <nl> + < target name = " - post - compile " > <nl> + < / target > <nl> + - - > <nl> + <nl> + < ! - - Import the actual build file . <nl> + <nl> + To customize existing targets , there are two options : <nl> + - Customize only one target : <nl> + - copy / paste the target into this file , * before * the <nl> + < import > task . <nl> + - customize it to your needs . <nl> + - Customize the whole content of build . xml <nl> + - copy / paste the content of the rules files ( minus the top node ) <nl> + into this file , replacing the < import > task . <nl> + - customize to your needs . <nl> + <nl> + * * * * * * * * * * * * * * * * * * * * * * * <nl> + * * * * * * IMPORTANT * * * * * * <nl> + * * * * * * * * * * * * * * * * * * * * * * * <nl> + In all cases you must update the value of version - tag below to read ' custom ' instead of an integer , <nl> + in order to avoid having your file be overridden by tools such as " android update project " <nl> + - - > <nl> + < ! - - version - tag : 1 - - > <nl> + < import file = " $ { sdk . dir } / tools / ant / build . xml " / > <nl> + <nl> + < / project > <nl> new file mode 100644 <nl> index 000000000000 . . 6c72629f233c <nl> mmm / dev / null <nl> ppp b / tools / JenkinsScript / rootconfig . sh <nl> <nl> + # ! / bin / bash <nl> + # Change the path expression of current path to cygwin path . <nl> + NDK_ROOT = $ ( $ CYGWIN / bin / cygpath . exe $ ANDROID_NDK ) <nl> + echo $ NDK_ROOT <nl> + CUR = $ ( pwd ) <nl> + cd . . / . . / . . <nl> + tmp = $ ( pwd ) <nl> + COCOS2DX = $ ( $ CYGWIN / bin / cygpath . exe $ tmp ) <nl> + echo $ COCOS2DX <nl> + <nl> + var1 = NDK_ROOT_LOCAL = <nl> + _NDK_ROOT = $ { var1 } $ { NDK_ROOT } <nl> + <nl> + var2 = COCOS2DX_ROOT_LOCAL = <nl> + _COCOS2DX_ROOT = $ { var2 } $ { COCOS2DX } <nl> + echo $ _NDK_ROOT <nl> + echo $ _COCOS2DX_ROOT <nl> + <nl> + # Modify the configuration files <nl> + sed - i ' 3 , 4d ' $ CUR / build_native . sh <nl> + sed - i ' 13d ' $ CUR / project . properties <nl> + sed - i " 3 i \ \ $ _NDK_ROOT " $ CUR / build_native . sh <nl> + sed - i " 4 i \ \ $ _COCOS2DX_ROOT " $ CUR / build_native . sh <nl> + <nl> + # Modify the project name <nl> + if [ $ 1 = TestCpp ] ; then <nl> + sed - i ' 2d ' $ CUR / build . xml <nl> + sed - i ' 2 i \ < project name = " Tests " default = " help " > ' $ CUR / build . xml <nl> + elif [ $ 1 = HelloCpp ] ; then <nl> + sed - i ' 2d ' $ CUR / build . xml <nl> + sed - i ' 2 i \ < project name = " HelloCpp " default = " help " > ' $ CUR / build . xml <nl> + else <nl> + sed - i ' 2d ' $ CUR / build . xml <nl> + sed - i ' 2 i \ < project name = " HelloLua " default = " help " > ' $ CUR / build . xml <nl> + fi <nl> \ No newline at end of file <nl>
|
Issue Add automatic testing tools
|
cocos2d/cocos2d-x
|
5dc604ebfc8c859c6277899a48fff69af156e9a3
|
2012-07-26T08:25:54Z
|
mmm a / NEWS . txt <nl> ppp b / NEWS . txt <nl> NEWS <nl> + Added support to lock lines in special angles with the Shift key , <nl> useful to draw in isometric views ( feature request # 1961397 ) . <nl> + Fixed bugs # 1958760 and # 1958932 . <nl> + + Fixed other bugs ( Flatten Layers , File Selector , etc . ) . <nl> <nl> 0 . 6b2 <nl> mmm - - <nl> mmm a / src / modules / tools . c <nl> ppp b / src / modules / tools . c <nl> void control_tool ( JWidget widget , Tool * tool , <nl> } <nl> <nl> if ( cel = = NULL ) { <nl> - / * int image_index ; * / <nl> - <nl> / * create the image * / <nl> cel_image = image_new ( sprite - > imgtype , sprite - > w , sprite - > h ) ; <nl> image_clear ( cel_image , 0 ) ; <nl> <nl> - / * add it to the stock * / <nl> - / * image_index = stock_add_image ( sprite - > stock , cel_image ) ; * / <nl> - <nl> / * create the cel * / <nl> cel = cel_new ( sprite - > frame , 0 ) ; <nl> layer_add_cel ( sprite - > layer , cel ) ; <nl> void control_tool ( JWidget widget , Tool * tool , <nl> cel_created = TRUE ; <nl> } <nl> <nl> - / * / \ * isn ' t a cel in the current frame / layer , we create a new one * \ / * / <nl> - / * if ( cel = = NULL ) { * / <nl> - / * cel_created = TRUE ; * / <nl> - / * cel = cel_new ( sprite - > frame , - 1 ) ; * / <nl> - / * } * / <nl> - <nl> - / * / \ * if we don ' t have an image to paint in , we create new image to paint in * \ / * / <nl> - / * if ( cel_image = = NULL ) { * / <nl> - / * cel_image_created = TRUE ; * / <nl> - / * } * / <nl> - / * / \ * if the cel is linked we make a copy of it ( so it can be unlinked ) * \ / * / <nl> - / * else if ( cel_is_link ( cel , sprite - > layer ) ) { * / <nl> - / * cel_image_created = TRUE ; * / <nl> - / * cel_image = image_new_copy ( cel_image ) ; * / <nl> - / * } * / <nl> - <nl> old_cel_x = cel - > x ; <nl> old_cel_y = cel - > y ; <nl> <nl> next_pts : ; <nl> image_copy ( tool_data . src_image , tool_data . dst_image , 0 , 0 ) ; <nl> } <nl> <nl> - / * displace region * / <nl> - / * if ( dirty - > mask ) * / <nl> - / * mask_move ( dirty - > mask , offset_x , offset_y ) ; * / <nl> - <nl> / * create the area which the trace will dirty * / <nl> if ( tool = = tools_list [ TOOL_BRUSH ] | | <nl> tool = = tools_list [ TOOL_CURVE ] ) { <nl> next_pts : ; <nl> else if ( tool - > draw_trace ) { <nl> tool - > draw_trace ( x1 , y1 , x2 , y2 , & tool_data ) ; <nl> } <nl> - <nl> - / * displace region * / <nl> - / * if ( dirty - > mask ) * / <nl> - / * mask_move ( dirty - > mask , - offset_x , - offset_y ) ; * / <nl> - <nl> - / * get the background which the trace will overlap * / <nl> - / * dirty_save_image_data ( dirty ) ; * / <nl> - <nl> - / * draw the trace * / <nl> - / * algo_dirty ( dirty , NULL , hline_proc ) ; * / <nl> } <nl> <nl> / * prepare * / <nl>
|
Removed some commented code in tools . c
|
aseprite/aseprite
|
102eaa8cf2d5fc57dd968b98b234a48d1815275d
|
2008-09-30T13:11:42Z
|
mmm a / stdlib / private / StdlibUnittest / StdlibUnittest . swift . gyb <nl> ppp b / stdlib / private / StdlibUnittest / StdlibUnittest . swift . gyb <nl> public final class TestSuite { <nl> case . single : <nl> return [ nil ] <nl> case . parameterized ( code : _ , count : let count ) : <nl> - return ( 0 . . < count ) . map { $ 0 } <nl> + return Array ( 0 . . < count ) <nl> } <nl> } <nl> } <nl> mmm a / stdlib / public / SDK / Foundation / Data . swift <nl> ppp b / stdlib / public / SDK / Foundation / Data . swift <nl> extension Data : CustomStringConvertible , CustomDebugStringConvertible , CustomRe <nl> <nl> / / Minimal size data is output as an array <nl> if nBytes < 64 { <nl> - children . append ( ( label : " bytes " , value : self [ 0 . . < nBytes ] . map { $ 0 } ) ) <nl> + children . append ( ( label : " bytes " , value : Array ( self [ 0 . . < nBytes ] ) ) ) <nl> } <nl> <nl> let m = Mirror ( self , children : children , displayStyle : Mirror . DisplayStyle . struct ) <nl> mmm a / stdlib / public / SDK / Foundation / IndexPath . swift <nl> ppp b / stdlib / public / SDK / Foundation / IndexPath . swift <nl> public struct IndexPath : ReferenceConvertible , Equatable , Hashable , MutableColl <nl> / / / Initialize with a sequence of integers . <nl> public init < ElementSequence : Sequence > ( indexes : ElementSequence ) <nl> where ElementSequence . Iterator . Element = = Element { <nl> - _indexes = indexes . map { $ 0 } <nl> + _indexes = Array ( indexes ) <nl> } <nl> <nl> / / / Initialize with an array literal . <nl> public struct IndexPath : ReferenceConvertible , Equatable , Hashable , MutableColl <nl> nsIndexPath . getIndexes ( elementPtr , range : NSMakeRange ( 0 , count ) ) <nl> <nl> let buffer = UnsafeBufferPointer ( start : elementPtr , count : count ) <nl> - _indexes = buffer . map { $ 0 } <nl> + _indexes = Array ( buffer ) <nl> } <nl> } <nl> <nl> mmm a / stdlib / public / SDK / Foundation / IndexSet . swift <nl> ppp b / stdlib / public / SDK / Foundation / IndexSet . swift <nl> extension IndexSet : CustomStringConvertible , CustomDebugStringConvertible , Cust <nl> <nl> public var customMirror : Mirror { <nl> var c : [ ( label : String ? , value : Any ) ] = [ ] <nl> - c . append ( ( label : " ranges " , value : rangeView . map { $ 0 } ) ) <nl> + c . append ( ( label : " ranges " , value : Array ( rangeView ) ) ) <nl> return Mirror ( self , children : c , displayStyle : Mirror . DisplayStyle . struct ) <nl> } <nl> } <nl> mmm a / stdlib / public / SDK / Foundation / URLComponents . swift <nl> ppp b / stdlib / public / SDK / Foundation / URLComponents . swift <nl> public struct URLComponents : ReferenceConvertible , Hashable , Equatable , _Mutabl <nl> / / / - note : If a name - value pair in a query is empty ( i . e . the query string starts with ' & ' , ends with ' & ' , or has " & & " within it ) , you get a ` URLQueryItem ` with a zero - length name and a nil value . If a query ' s name - value pair has nothing before the equals sign , you get a zero - length name . If a query ' s name - value pair has nothing after the equals sign , you get a zero - length value . If a query ' s name - value pair has no equals sign , the query name - value pair string is the name and you get a nil value . <nl> @ available ( OSX 10 . 10 , iOS 8 . 0 , * ) <nl> public var queryItems : [ URLQueryItem ] ? { <nl> - get { return _handle . map { $ 0 . queryItems ? . map { return $ 0 as URLQueryItem } } } <nl> - set { _applyMutation { $ 0 . queryItems = newValue ? . map { $ 0 } } } <nl> + get { return _handle . map { $ 0 . queryItems } } <nl> + set { _applyMutation { $ 0 . queryItems = newValue } } <nl> } <nl> <nl> public var hashValue : Int { <nl> mmm a / test / stdlib / ArrayBridge . swift . gyb <nl> ppp b / test / stdlib / ArrayBridge . swift . gyb <nl> tests . test ( " testMutableArray " ) { <nl> let a = m as NSArray as ! [ NSString ] <nl> <nl> / / Create distinct array storage with a copy of the elements in a <nl> - let aCopy = a . map { $ 0 } <nl> + let aCopy = Array ( a ) <nl> <nl> / / Modify the original mutable array <nl> m . add ( " goop " ) <nl> mmm a / validation - test / stdlib / String . swift <nl> ppp b / validation - test / stdlib / String . swift <nl> StringTests . test ( " String . replaceSubrange ( ) / characters / range " ) { <nl> var theString = test . original <nl> let c = test . original . characters <nl> let rangeToReplace = test . rangeSelection . range ( in : c ) <nl> - let newCharacters : [ Character ] = test . newElements . characters . map { $ 0 } <nl> + let newCharacters : [ Character ] = Array ( test . newElements . characters ) <nl> theString . replaceSubrange ( rangeToReplace , with : newCharacters ) <nl> expectEqual ( <nl> test . expected , <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
dba1887877631b815401f923813a3979d08c473e
|
2017-02-12T04:23:49Z
|
mmm a / include / grpcpp / impl / codegen / call . h <nl> ppp b / include / grpcpp / impl / codegen / call . h <nl> class WriteOptions { <nl> } ; <nl> <nl> namespace internal { <nl> + <nl> + class InternalInterceptorBatchMethods <nl> + : public experimental : : InterceptorBatchMethods { <nl> + public : <nl> + virtual ~ InternalInterceptorBatchMethods ( ) { } <nl> + <nl> + virtual void AddInterceptionHookPoint ( <nl> + experimental : : InterceptionHookPoints type ) = 0 ; <nl> + <nl> + virtual void SetSendMessage ( ByteBuffer * buf ) = 0 ; <nl> + <nl> + virtual void SetSendInitialMetadata ( <nl> + std : : multimap < grpc : : string , grpc : : string > * metadata ) = 0 ; <nl> + <nl> + virtual void SetSendStatus ( grpc_status_code * code , <nl> + grpc : : string * error_details , <nl> + grpc : : string * error_message ) = 0 ; <nl> + <nl> + virtual void SetSendTrailingMetadata ( <nl> + std : : multimap < grpc : : string , grpc : : string > * metadata ) = 0 ; <nl> + <nl> + virtual void SetRecvMessage ( void * message ) = 0 ; <nl> + <nl> + virtual void SetRecvInitialMetadata ( internal : : MetadataMap * map ) = 0 ; <nl> + <nl> + virtual void SetRecvStatus ( Status * status ) = 0 ; <nl> + <nl> + virtual void SetRecvTrailingMetadata ( internal : : MetadataMap * map ) = 0 ; <nl> + } ; <nl> + <nl> / / / Default argument for CallOpSet . I is unused by the class , but can be <nl> / / / used for generating multiple names for the same thing . <nl> template < int I > <nl> class CallNoOp { <nl> void AddOp ( grpc_op * ops , size_t * nops ) { } <nl> void FinishOp ( bool * status ) { } <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { } <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> + } <nl> } ; <nl> <nl> class CallOpSendInitialMetadata { <nl> class CallOpSendInitialMetadata { <nl> } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( ! send_ ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : PRE_SEND_INITIAL_METADATA ) ; <nl> class CallOpSendInitialMetadata { <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { } <nl> <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> } <nl> <nl> class CallOpSendMessage { <nl> void FinishOp ( bool * status ) { send_buf_ . Clear ( ) ; } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( ! send_buf_ . Valid ( ) ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : PRE_SEND_MESSAGE ) ; <nl> class CallOpSendMessage { <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { } <nl> <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> } <nl> <nl> class CallOpRecvMessage { <nl> } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> interceptor_methods - > SetRecvMessage ( message_ ) ; <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( ! got_message ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : POST_RECV_MESSAGE ) ; <nl> } <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> if ( message_ = = nullptr ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> class CallOpGenericRecvMessage { <nl> } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> interceptor_methods - > SetRecvMessage ( message_ ) ; <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( ! got_message ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : POST_RECV_MESSAGE ) ; <nl> } <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> if ( ! deserialize_ ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> class CallOpClientSendClose { <nl> void FinishOp ( bool * status ) { send_ = false ; } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( ! send_ ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : PRE_SEND_CLOSE ) ; <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { } <nl> <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> } <nl> <nl> class CallOpServerSendStatus { <nl> } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( ! send_status_available_ ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : PRE_SEND_STATUS ) ; <nl> class CallOpServerSendStatus { <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { } <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { } <nl> <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> } <nl> <nl> class CallOpRecvInitialMetadata { <nl> } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> interceptor_methods - > SetRecvInitialMetadata ( metadata_map_ ) ; <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( metadata_map_ = = nullptr ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : POST_RECV_INITIAL_METADATA ) ; <nl> metadata_map_ = nullptr ; <nl> } <nl> <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> if ( metadata_map_ = = nullptr ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> class CallOpClientRecvStatus { <nl> } <nl> <nl> void SetInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> interceptor_methods - > SetRecvStatus ( recv_status_ ) ; <nl> interceptor_methods - > SetRecvTrailingMetadata ( metadata_map_ ) ; <nl> } <nl> <nl> void SetFinishInterceptionHookPoint ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + InternalInterceptorBatchMethods * interceptor_methods ) { <nl> if ( recv_status_ = = nullptr ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> experimental : : InterceptionHookPoints : : POST_RECV_STATUS ) ; <nl> recv_status_ = nullptr ; <nl> } <nl> <nl> - void SetHijackingState ( <nl> - experimental : : InterceptorBatchMethods * interceptor_methods ) { <nl> + void SetHijackingState ( InternalInterceptorBatchMethods * interceptor_methods ) { <nl> hijacked_ = true ; <nl> if ( recv_status_ = = nullptr ) return ; <nl> interceptor_methods - > AddInterceptionHookPoint ( <nl> class CallOpSetInterface : public CompletionQueueTag { <nl> / / RPC . This should set hijacking state for each of the ops . <nl> virtual void SetHijackingState ( ) = 0 ; <nl> <nl> - / * Should be called after interceptors are done running * / <nl> + / / Should be called after interceptors are done running <nl> virtual void ContinueFillOpsAfterInterception ( ) = 0 ; <nl> <nl> - / * Should be called after interceptors are done running on the finalize result <nl> - * path * / <nl> + / / Should be called after interceptors are done running on the finalize result <nl> + / / path <nl> virtual void ContinueFinalizeResultAfterInterception ( ) = 0 ; <nl> } ; <nl> <nl> template < class Op1 = CallNoOp < 1 > , class Op2 = CallNoOp < 2 > , <nl> class Op5 = CallNoOp < 5 > , class Op6 = CallNoOp < 6 > > <nl> class CallOpSet ; <nl> <nl> - class InterceptorBatchMethodsImpl <nl> - : public experimental : : InterceptorBatchMethods { <nl> + class InterceptorBatchMethodsImpl : public InternalInterceptorBatchMethods { <nl> public : <nl> InterceptorBatchMethodsImpl ( ) { <nl> for ( auto i = 0 ; <nl> class InterceptorBatchMethodsImpl <nl> ProceedServer ( ) ; <nl> } <nl> <nl> - virtual void Hijack ( ) override { / * fill this * / <nl> - / * Only the client can hijack when sending down initial metadata * / <nl> + virtual void Hijack ( ) override { <nl> + / / Only the client can hijack when sending down initial metadata <nl> GPR_CODEGEN_ASSERT ( ! reverse_ & & ops_ ! = nullptr & & <nl> call_ - > client_rpc_info ( ) ! = nullptr ) ; <nl> auto * rpc_info = call_ - > client_rpc_info ( ) ; <nl> class InterceptorBatchMethodsImpl <nl> return recv_trailing_metadata_ - > map ( ) ; <nl> } <nl> <nl> - virtual void SetSendMessage ( ByteBuffer * buf ) override { send_message_ = buf ; } <nl> + virtual void SetSendMessage ( ByteBuffer * buf ) { send_message_ = buf ; } <nl> <nl> virtual void SetSendInitialMetadata ( <nl> - std : : multimap < grpc : : string , grpc : : string > * metadata ) override { <nl> + std : : multimap < grpc : : string , grpc : : string > * metadata ) { <nl> send_initial_metadata_ = metadata ; <nl> } <nl> <nl> virtual void SetSendStatus ( grpc_status_code * code , <nl> grpc : : string * error_details , <nl> - grpc : : string * error_message ) override { <nl> + grpc : : string * error_message ) { <nl> code_ = code ; <nl> error_details_ = error_details ; <nl> error_message_ = error_message ; <nl> } <nl> <nl> virtual void SetSendTrailingMetadata ( <nl> - std : : multimap < grpc : : string , grpc : : string > * metadata ) override { <nl> + std : : multimap < grpc : : string , grpc : : string > * metadata ) { <nl> send_trailing_metadata_ = metadata ; <nl> } <nl> <nl> - virtual void SetRecvMessage ( void * message ) override { <nl> - recv_message_ = message ; <nl> - } <nl> + virtual void SetRecvMessage ( void * message ) { recv_message_ = message ; } <nl> <nl> - virtual void SetRecvInitialMetadata ( internal : : MetadataMap * map ) override { <nl> + virtual void SetRecvInitialMetadata ( internal : : MetadataMap * map ) { <nl> recv_initial_metadata_ = map ; <nl> } <nl> <nl> - virtual void SetRecvStatus ( Status * status ) override { recv_status_ = status ; } <nl> + virtual void SetRecvStatus ( Status * status ) { recv_status_ = status ; } <nl> <nl> - virtual void SetRecvTrailingMetadata ( internal : : MetadataMap * map ) override { <nl> + virtual void SetRecvTrailingMetadata ( internal : : MetadataMap * map ) { <nl> recv_trailing_metadata_ = map ; <nl> } <nl> <nl> - / * Prepares for Post_recv operations * / <nl> + / / Prepares for Post_recv operations <nl> void SetReverse ( ) { <nl> reverse_ = true ; <nl> ClearHookPoints ( ) ; <nl> } <nl> <nl> - / * This needs to be set before interceptors are run * / <nl> + / / This needs to be set before interceptors are run <nl> void SetCall ( Call * call ) { call_ = call ; } <nl> <nl> void SetCallOpSetInterface ( CallOpSetInterface * ops ) { ops_ = ops ; } <nl> <nl> - / * Returns true if no interceptors are run . This should be used only by <nl> - subclasses of CallOpSetInterface . SetCall and SetCallOpSetInterface should <nl> - have been called before this . After all the interceptors are done running , <nl> - either ContinueFillOpsAfterInterception or <nl> - ContinueFinalizeOpsAfterInterception will be called . Note that neither of them <nl> - is invoked if there were no interceptors registered . <nl> - * / <nl> + / / Returns true if no interceptors are run . This should be used only by <nl> + / / subclasses of CallOpSetInterface . SetCall and SetCallOpSetInterface should <nl> + / / have been called before this . After all the interceptors are done running , <nl> + / / either ContinueFillOpsAfterInterception or <nl> + / / ContinueFinalizeOpsAfterInterception will be called . Note that neither of <nl> + / / them is invoked if there were no interceptors registered . <nl> bool RunInterceptors ( ) { <nl> auto * client_rpc_info = call_ - > client_rpc_info ( ) ; <nl> if ( client_rpc_info = = nullptr | | <nl> class InterceptorBatchMethodsImpl <nl> return false ; <nl> } <nl> <nl> - / * Returns true if no interceptors are run . Returns false otherwise if there <nl> - are interceptors registered . After the interceptors are done running \ a f will <nl> - be invoked . This is to be used only by BaseAsyncRequest and SyncRequest . * / <nl> + / / Returns true if no interceptors are run . Returns false otherwise if there <nl> + / / are interceptors registered . After the interceptors are done running \ a f <nl> + / / will <nl> + / / be invoked . This is to be used only by BaseAsyncRequest and SyncRequest . <nl> bool RunInterceptors ( std : : function < void ( void ) > f ) { <nl> GPR_CODEGEN_ASSERT ( reverse_ = = true ) ; <nl> GPR_CODEGEN_ASSERT ( call_ - > client_rpc_info ( ) = = nullptr ) ; <nl> class InterceptorBatchMethodsImpl <nl> auto * rpc_info = call_ - > client_rpc_info ( ) ; <nl> if ( rpc_info - > hijacked_ & & <nl> ( ! reverse_ & & curr_iteration_ = = rpc_info - > hijacked_interceptor_ + 1 ) ) { <nl> - / * We now need to provide hijacked recv ops to this interceptor * / <nl> + / / We now need to provide hijacked recv ops to this interceptor <nl> ClearHookPoints ( ) ; <nl> ops_ - > SetHijackingState ( ) ; <nl> rpc_info - > RunInterceptor ( this , curr_iteration_ - 1 ) ; <nl> return ; <nl> } <nl> if ( ! reverse_ ) { <nl> - / * We are going down the stack of interceptors * / <nl> + / / We are going down the stack of interceptors <nl> if ( curr_iteration_ < static_cast < long > ( rpc_info - > interceptors_ . size ( ) ) ) { <nl> if ( rpc_info - > hijacked_ & & <nl> curr_iteration_ > rpc_info - > hijacked_interceptor_ ) { <nl> - / * This is a hijacked RPC and we are done with hijacking * / <nl> + / / This is a hijacked RPC and we are done with hijacking <nl> ops_ - > ContinueFillOpsAfterInterception ( ) ; <nl> } else { <nl> rpc_info - > RunInterceptor ( this , curr_iteration_ ) ; <nl> } <nl> } else { <nl> - / * we are done running all the interceptors without any hijacking * / <nl> + / / we are done running all the interceptors without any hijacking <nl> ops_ - > ContinueFillOpsAfterInterception ( ) ; <nl> } <nl> } else { <nl> - / * We are going up the stack of interceptors * / <nl> + / / We are going up the stack of interceptors <nl> if ( curr_iteration_ > = 0 ) { <nl> - / * Continue running interceptors * / <nl> + / / Continue running interceptors <nl> rpc_info - > RunInterceptor ( this , curr_iteration_ ) ; <nl> } else { <nl> - / * we are done running all the interceptors without any hijacking * / <nl> + / / we are done running all the interceptors without any hijacking <nl> ops_ - > ContinueFinalizeResultAfterInterception ( ) ; <nl> } <nl> } <nl> class InterceptorBatchMethodsImpl <nl> } <nl> } else { <nl> curr_iteration_ - - ; <nl> - / * We are going up the stack of interceptors * / <nl> + / / We are going up the stack of interceptors <nl> if ( curr_iteration_ > = 0 ) { <nl> - / * Continue running interceptors * / <nl> + / / Continue running interceptors <nl> return rpc_info - > RunInterceptor ( this , curr_iteration_ ) ; <nl> } <nl> } <nl> - / * we are done running all the interceptors * / <nl> + / / we are done running all the interceptors <nl> if ( ops_ ) { <nl> ops_ - > ContinueFinalizeResultAfterInterception ( ) ; <nl> } <nl> class CallOpSet : public CallOpSetInterface , <nl> if ( RunInterceptors ( ) ) { <nl> ContinueFillOpsAfterInterception ( ) ; <nl> } else { <nl> - / * After the interceptors are run , ContinueFillOpsAfterInterception will <nl> - * be run * / <nl> + / / After the interceptors are run , ContinueFillOpsAfterInterception will <nl> + / / be run <nl> } <nl> } <nl> <nl> bool FinalizeResult ( void * * tag , bool * status ) override { <nl> if ( done_intercepting_ ) { <nl> - / * We have already finished intercepting and filling in the results . This <nl> - * round trip from the core needed to be made because interceptors were <nl> - * run * / <nl> + / / We have already finished intercepting and filling in the results . This <nl> + / / round trip from the core needed to be made because interceptors were <nl> + / / run <nl> * tag = return_tag_ ; <nl> g_core_codegen_interface - > grpc_call_unref ( call_ . call ( ) ) ; <nl> return true ; <nl> class CallOpSet : public CallOpSetInterface , <nl> return true ; <nl> } <nl> <nl> - / * Interceptors are going to be run , so we can ' t return the tag just yet . <nl> - After the interceptors are run , ContinueFinalizeResultAfterInterception * / <nl> + / / Interceptors are going to be run , so we can ' t return the tag just yet . <nl> + / / After the interceptors are run , ContinueFinalizeResultAfterInterception <nl> return false ; <nl> } <nl> <nl> class CallOpSet : public CallOpSetInterface , <nl> this - > Op6 : : SetHijackingState ( & interceptor_methods_ ) ; <nl> } <nl> <nl> - / * Should be called after interceptors are done running * / <nl> + / / Should be called after interceptors are done running <nl> void ContinueFillOpsAfterInterception ( ) override { <nl> static const size_t MAX_OPS = 6 ; <nl> grpc_op ops [ MAX_OPS ] ; <nl> class CallOpSet : public CallOpSetInterface , <nl> call_ . call ( ) , ops , nops , cq_tag ( ) , nullptr ) ) ; <nl> } <nl> <nl> - / * Should be called after interceptors are done running on the finalize result <nl> - * path * / <nl> + / / Should be called after interceptors are done running on the finalize result <nl> + / / path <nl> void ContinueFinalizeResultAfterInterception ( ) override { <nl> done_intercepting_ = true ; <nl> GPR_CODEGEN_ASSERT ( GRPC_CALL_OK = = <nl> class CallOpSet : public CallOpSetInterface , <nl> } <nl> <nl> private : <nl> - / * Returns true if no interceptors need to be run * / <nl> + / / Returns true if no interceptors need to be run <nl> bool RunInterceptors ( ) { <nl> this - > Op1 : : SetInterceptionHookPoint ( & interceptor_methods_ ) ; <nl> this - > Op2 : : SetInterceptionHookPoint ( & interceptor_methods_ ) ; <nl> class CallOpSet : public CallOpSetInterface , <nl> / / SetHijackingState , ContinueFinalizeResultAfterInterception ) ; <nl> return interceptor_methods_ . RunInterceptors ( ) ; <nl> } <nl> - / * Returns true if no interceptors need to be run * / <nl> + / / Returns true if no interceptors need to be run <nl> bool RunInterceptorsPostRecv ( ) { <nl> interceptor_methods_ . SetReverse ( ) ; <nl> this - > Op1 : : SetFinishInterceptionHookPoint ( & interceptor_methods_ ) ; <nl> mmm a / include / grpcpp / impl / codegen / client_interceptor . h <nl> ppp b / include / grpcpp / impl / codegen / client_interceptor . h <nl> class ClientContext ; <nl> class Channel ; <nl> <nl> namespace internal { <nl> - template < int I > <nl> - class CallNoOp ; <nl> + class InterceptorBatchMethodsImpl ; <nl> } <nl> <nl> namespace experimental { <nl> class ClientRpcInfo { <nl> grpc : : ClientContext * client_context ( ) { return ctx_ ; } <nl> <nl> public : <nl> - / * Runs interceptor at pos \ a pos . If \ a reverse is set , the interceptor order <nl> - * is the reverse * / <nl> + / / Runs interceptor at pos \ a pos . <nl> void RunInterceptor ( <nl> experimental : : InterceptorBatchMethods * interceptor_methods , <nl> unsigned int pos ) { <nl> class ClientRpcInfo { <nl> grpc : : ClientContext * ctx_ = nullptr ; <nl> const char * method_ = nullptr ; <nl> const grpc : : Channel * channel_ = nullptr ; <nl> - <nl> - public : <nl> std : : vector < std : : unique_ptr < experimental : : Interceptor > > interceptors_ ; <nl> bool hijacked_ = false ; <nl> int hijacked_interceptor_ = false ; <nl> + <nl> + friend class internal : : InterceptorBatchMethodsImpl ; <nl> } ; <nl> <nl> } / / namespace experimental <nl> mmm a / include / grpcpp / impl / codegen / interceptor . h <nl> ppp b / include / grpcpp / impl / codegen / interceptor . h <nl> class InterceptorBatchMethods { <nl> / / valid if the batch contains send_initial_metadata on the client side ) <nl> virtual void Hijack ( ) = 0 ; <nl> <nl> - virtual void AddInterceptionHookPoint ( InterceptionHookPoints type ) = 0 ; <nl> - <nl> + / / Returns a modifable ByteBuffer holding serialized form of the message to be <nl> + / / sent <nl> virtual ByteBuffer * GetSendMessage ( ) = 0 ; <nl> <nl> + / / Returns a modifiable multimap of the initial metadata to be sent <nl> virtual std : : multimap < grpc : : string , grpc : : string > * <nl> GetSendInitialMetadata ( ) = 0 ; <nl> <nl> + / / Returns the status to be sent <nl> virtual Status GetSendStatus ( ) = 0 ; <nl> <nl> + / / Modifies the status with \ a status <nl> virtual void ModifySendStatus ( const Status & status ) = 0 ; <nl> <nl> + / / Returns a modifiable multimap of the trailing metadata to be sent <nl> virtual std : : multimap < grpc : : string , grpc : : string > * <nl> GetSendTrailingMetadata ( ) = 0 ; <nl> <nl> + / / Returns a pointer to the modifiable received message . Note that the message <nl> + / / is already deserialized <nl> virtual void * GetRecvMessage ( ) = 0 ; <nl> <nl> + / / Returns a modifiable multimap of the received initial metadata <nl> virtual std : : multimap < grpc : : string_ref , grpc : : string_ref > * <nl> GetRecvInitialMetadata ( ) = 0 ; <nl> <nl> + / / Returns a modifiable view of the received status <nl> virtual Status * GetRecvStatus ( ) = 0 ; <nl> <nl> + / / Returns a modifiable multimap of the received trailing metadata <nl> virtual std : : multimap < grpc : : string_ref , grpc : : string_ref > * <nl> GetRecvTrailingMetadata ( ) = 0 ; <nl> - <nl> - virtual void SetSendMessage ( ByteBuffer * buf ) = 0 ; <nl> - <nl> - virtual void SetSendInitialMetadata ( <nl> - std : : multimap < grpc : : string , grpc : : string > * metadata ) = 0 ; <nl> - <nl> - virtual void SetSendStatus ( grpc_status_code * code , <nl> - grpc : : string * error_details , <nl> - grpc : : string * error_message ) = 0 ; <nl> - <nl> - virtual void SetSendTrailingMetadata ( <nl> - std : : multimap < grpc : : string , grpc : : string > * metadata ) = 0 ; <nl> - <nl> - virtual void SetRecvMessage ( void * message ) = 0 ; <nl> - <nl> - virtual void SetRecvInitialMetadata ( internal : : MetadataMap * map ) = 0 ; <nl> - <nl> - virtual void SetRecvStatus ( Status * status ) = 0 ; <nl> - <nl> - virtual void SetRecvTrailingMetadata ( internal : : MetadataMap * map ) = 0 ; <nl> } ; <nl> <nl> class Interceptor { <nl> mmm a / include / grpcpp / impl / codegen / server_interceptor . h <nl> ppp b / include / grpcpp / impl / codegen / server_interceptor . h <nl> namespace grpc { <nl> class ServerContext ; <nl> <nl> namespace internal { <nl> - template < int I > <nl> - class CallNoOp ; <nl> + class InterceptorBatchMethodsImpl ; <nl> } <nl> <nl> namespace experimental { <nl> class ServerRpcInfo { <nl> grpc : : ServerContext * server_context ( ) { return ctx_ ; } <nl> <nl> public : <nl> - / * Runs interceptor at pos \ a pos . If \ a reverse is set , the interceptor order <nl> - * is the reverse * / <nl> + / / Runs interceptor at pos \ a pos . <nl> void RunInterceptor ( <nl> experimental : : InterceptorBatchMethods * interceptor_methods , <nl> unsigned int pos ) { <nl> class ServerRpcInfo { <nl> private : <nl> grpc : : ServerContext * ctx_ = nullptr ; <nl> const char * method_ = nullptr ; <nl> - <nl> - public : <nl> std : : vector < std : : unique_ptr < experimental : : Interceptor > > interceptors_ ; <nl> + <nl> + friend class internal : : InterceptorBatchMethodsImpl ; <nl> } ; <nl> <nl> } / / namespace experimental <nl>
|
Don ' t expose internal functions . . Add a layer of indirection namely InternalInterceptorBatchMethods
|
grpc/grpc
|
52765e9cb1e18780fcd4701e91e019bf78c9b957
|
2018-10-20T00:07:05Z
|
mmm a / include / swift / AST / DiagnosticsSIL . def <nl> ppp b / include / swift / AST / DiagnosticsSIL . def <nl> <nl> - / / = = = - DiagnosticsSIL . def - Diagnostics Text mmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = - DiagnosticsSIL . def - Diagnostics Text mmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / KnownDecls . def <nl> ppp b / include / swift / AST / KnownDecls . def <nl> <nl> - / / = = = - - KnownDecls . def - Compiler declaration metaprogramming mmm - * - C + + - * - = = = / / <nl> + / / = = = - - KnownDecls . def - Compiler declaration metaprogramming mmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / ASTSectionImporter / ASTSectionImporter . h <nl> ppp b / include / swift / ASTSectionImporter / ASTSectionImporter . h <nl> <nl> - / / = = = mmm ASTSectionImporter . h - Import AST Section Modules mmm * - C + + - * - - = = = / / <nl> + / / = = = mmm ASTSectionImporter . h - Import AST Section Modules mmm - - * - C + + - * - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / FileSystem . h <nl> ppp b / include / swift / Basic / FileSystem . h <nl> <nl> - / / = = = mmm FileSystem . h - Extra helpers for manipulating files - - * - C + + - * - = = = / / <nl> + / / = = = mmm FileSystem . h - Extra helpers for manipulating files mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / ClangImporter / ClangImporter . h <nl> ppp b / include / swift / ClangImporter / ClangImporter . h <nl> <nl> - / / = = = mmm ClangImporter . h - Import Clang Modules mmmmmmmmmmmm - - * - C + + - * - - = = = / / <nl> + / / = = = mmm ClangImporter . h - Import Clang Modules mmmmmmmmmmmmmmm - * - C + + - * - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Runtime / HeapObject . h <nl> ppp b / include / swift / Runtime / HeapObject . h <nl> <nl> - / / = = = mmm HeapObject . h - Swift Language Allocation ABI mmmmmmmmmmmmmmm * - C + + - * - - = = = / / <nl> + / / = = = mmm HeapObject . h - Swift Language Allocation ABI mmmmmmmmm - * - C + + - * - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SIL / DynamicCasts . h <nl> ppp b / include / swift / SIL / DynamicCasts . h <nl> <nl> - / / = = = mmm DynamicCasts . h - SIL dynamic - cast utilities mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DynamicCasts . h - SIL dynamic - cast utilities mmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / ColdBlockInfo . h <nl> ppp b / include / swift / SILOptimizer / Analysis / ColdBlockInfo . h <nl> <nl> - / / = = = - - ColdBlockInfo . h - Fast / slow path analysis for the SIL CFG - * - C + + - * - - = = = / / <nl> + / / = = = - - ColdBlockInfo . h - Fast / slow path analysis for the SIL CFG - * - C + + - * - = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / AST / DiagnosticEngine . cpp <nl> ppp b / lib / AST / DiagnosticEngine . cpp <nl> <nl> - / / = = = - DiagnosticEngine . cpp - Diagnostic Display Engine mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = - DiagnosticEngine . cpp - Diagnostic Display Engine mmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / AST / USRGeneration . cpp <nl> ppp b / lib / AST / USRGeneration . cpp <nl> <nl> - / / = = = mmm USRGeneration . cpp - Routines for USR generation mmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm USRGeneration . cpp - Routines for USR generation mmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / Cache . cpp <nl> ppp b / lib / Basic / Cache . cpp <nl> <nl> - / / = = = mmm Cache . cpp - Caching mechanism implementation mmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm Cache . cpp - Caching mechanism implementation mmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / Darwin / Cache - Mac . cpp <nl> ppp b / lib / Basic / Darwin / Cache - Mac . cpp <nl> <nl> - / / = = = mmm Cache - Mac . cpp - Caching mechanism implementation mmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm Cache - Mac . cpp - Caching mechanism implementation mmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / ThreadSafeRefCounted . cpp <nl> ppp b / lib / Basic / ThreadSafeRefCounted . cpp <nl> <nl> - / / = = = mmm ThreadSafeRefCounted . cpp - Thread - safe Refcounting Base mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm ThreadSafeRefCounted . cpp - Thread - safe Refcounting Base mmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / UUID . cpp <nl> ppp b / lib / Basic / UUID . cpp <nl> <nl> - / / = = = mmm UUID . cpp - UUID generation mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm UUID . cpp - UUID generation mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / ClangImporter / MacroTable . def <nl> ppp b / lib / ClangImporter / MacroTable . def <nl> <nl> - / / = = = mmm MacroTable . def - Macros suppressed during import - * - C + + - * - = = = / / <nl> + / / = = = mmm MacroTable . def - Macros suppressed during import mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IRGen / DebugTypeInfo . cpp <nl> ppp b / lib / IRGen / DebugTypeInfo . cpp <nl> <nl> - / / = = = mmm DebugTypeInfo . cpp - Type Info for Debugging mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DebugTypeInfo . cpp - Type Info for Debugging mmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IRGen / GenClass . h <nl> ppp b / lib / IRGen / GenClass . h <nl> <nl> - / / = = = mmm GenClass . h - Swift IR generation for classes mmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm GenClass . h - Swift IR generation for classes mmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IRGen / GenType . cpp <nl> ppp b / lib / IRGen / GenType . cpp <nl> <nl> - / / = = = mmm GenType . cpp - Swift IR Generation For Types mmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm GenType . cpp - Swift IR Generation For Types mmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IRGen / IRGenDebugInfo . cpp <nl> ppp b / lib / IRGen / IRGenDebugInfo . cpp <nl> <nl> - / / = = = mmm IRGenDebugInfo . cpp - Debug Info Supportmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm IRGenDebugInfo . cpp - Debug Info Supportmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / LLVMPasses / LLVMARCOpts . cpp <nl> ppp b / lib / LLVMPasses / LLVMARCOpts . cpp <nl> <nl> - / / = = = mmm LLVMARCOpts . cpp - LLVM Reference Counting Optimizations mmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm LLVMARCOpts . cpp - LLVM Reference Counting Optimizations mmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Markup / LineList . cpp <nl> ppp b / lib / Markup / LineList . cpp <nl> <nl> - / / = = = mmm LineList . cpp - Data structures for Markup parsing mmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm LineList . cpp - Data structures for Markup parsing mmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Markup / Markup . cpp <nl> ppp b / lib / Markup / Markup . cpp <nl> <nl> - / / = = = mmm Markup . cpp - Markup mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm Markup . cpp - Markup mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SIL / SILInstructions . cpp <nl> ppp b / lib / SIL / SILInstructions . cpp <nl> <nl> - / / = = = mmm SILInstructions . cpp - Instructions for SIL code mmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm SILInstructions . cpp - Instructions for SIL code mmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SIL / SILWitnessTable . cpp <nl> ppp b / lib / SIL / SILWitnessTable . cpp <nl> <nl> - / / = = = mmm SILWitnessTable . cpp - Defines the SILWitnessTable class mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm SILWitnessTable . cpp - Defines the SILWitnessTable class mmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILGen / ManagedValue . h <nl> ppp b / lib / SILGen / ManagedValue . h <nl> <nl> - / / = = = mmm ManagedValue . h - Exploded RValue Representation mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm ManagedValue . h - Exploded RValue Representation mmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILGen / SILGenForeignError . cpp <nl> ppp b / lib / SILGen / SILGenForeignError . cpp <nl> <nl> - / / = = = mmm SILGenForeignError . cpp - Error - handling code emission mmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm SILGenForeignError . cpp - Error - handling code emission mmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / ColdBlockInfo . cpp <nl> ppp b / lib / SILOptimizer / Analysis / ColdBlockInfo . cpp <nl> <nl> - / / = = = mmm - - ColdBlockInfo . cpp - Fast / slow path analysis for the SIL CFG mmmmmm - = = = / / <nl> + / / = = = mmm - - ColdBlockInfo . cpp - Fast / slow path analysis for the SIL CFG mmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / ValueTracking . cpp <nl> ppp b / lib / SILOptimizer / Analysis / ValueTracking . cpp <nl> <nl> - / / = = = - - ValueTracking . cpp - SIL Value Tracking Analysis mmmmmmmmm - * - C + + - * - - = = = / / <nl> + / / = = = - - ValueTracking . cpp - SIL Value Tracking Analysis mmmmmm - - * - C + + - * - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / ExternalDefsToDecls . cpp <nl> ppp b / lib / SILOptimizer / IPO / ExternalDefsToDecls . cpp <nl> <nl> - / / = = = mmm ExternalDefsToDecls . cpp - external defs to decls mmm = = = / / <nl> + / / = = = mmm ExternalDefsToDecls . cpp - external defs to decls mmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / LetPropertiesOpts . cpp <nl> ppp b / lib / SILOptimizer / IPO / LetPropertiesOpts . cpp <nl> <nl> - / / = = = mmmmmmmmm - LetPropertiesOpts . cpp - Optimize let properties mmmmmmmmmmmm = = = / / <nl> + / / = = = mmmmmmmmm - LetPropertiesOpts . cpp - Optimize let properties mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / LoopTransforms / LoopRotate . cpp <nl> ppp b / lib / SILOptimizer / LoopTransforms / LoopRotate . cpp <nl> <nl> - / / = = = mmmmmmmmm LoopRotate . cpp - Loop structure simplify - * - C + + - * mmmmmm - = = = / / <nl> + / / = = = mmmmmmmmm LoopRotate . cpp - Loop structure simplify - * - C + + - * mmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / LoopInfoPrinter . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / LoopInfoPrinter . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm LoopInfoPrinter . cpp - Print SIL Loop Info - * - C + + - * mmmmmm - = = = / / <nl> + / / = = = mmmmmmmmmmmm LoopInfoPrinter . cpp - Print SIL Loop Info - * - C + + - * mmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Utils / SILSSAUpdater . cpp <nl> ppp b / lib / SILOptimizer / Utils / SILSSAUpdater . cpp <nl> <nl> - / / = = = mmmmmm SILSSAUpdater . cpp - Unstructured SSA Update Tool mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmmmmm SILSSAUpdater . cpp - Unstructured SSA Update Tool mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Sema / TypeCheckRequest . cpp <nl> ppp b / lib / Sema / TypeCheckRequest . cpp <nl> <nl> - / / = = = mmm TypeCheckRequest . cpp - Type Checking Request mmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm TypeCheckRequest . cpp - Type Checking Request mmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / stdlib / private / SwiftPrivateDarwinExtras / Subprocess . swift <nl> ppp b / stdlib / private / SwiftPrivateDarwinExtras / Subprocess . swift <nl> <nl> - / / = = = mmm Subprocess . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm Subprocess . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / stdlib / private / SwiftPrivateDarwinExtras / SwiftPrivateDarwinExtras . swift <nl> ppp b / stdlib / private / SwiftPrivateDarwinExtras / SwiftPrivateDarwinExtras . swift <nl> <nl> - / / = = = mmm SwiftPrivateDarwinExtras . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm SwiftPrivateDarwinExtras . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / stdlib / public / runtime / HeapObject . cpp <nl> ppp b / stdlib / public / runtime / HeapObject . cpp <nl> <nl> - / / = = = mmm HeapObject . cpp - Swift Language ABI Allocation Support mmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm HeapObject . cpp - Swift Language ABI Allocation Support mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / test / 1_stdlib / NewArray . swift . gyb <nl> ppp b / test / 1_stdlib / NewArray . swift . gyb <nl> <nl> % # - * - mode : swift - * - <nl> - / / = = = mmm NewArray . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm NewArray . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / SourceKit / include / SourceKit / Support / FuzzyStringMatcher . h <nl> ppp b / tools / SourceKit / include / SourceKit / Support / FuzzyStringMatcher . h <nl> <nl> - / / = = = mmm FuzzyStringMatcher . h - mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = / / <nl> + / / = = = mmm FuzzyStringMatcher . h - mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / SourceKit / lib / SwiftLang / SwiftEditorInterfaceGen . cpp <nl> ppp b / tools / SourceKit / lib / SwiftLang / SwiftEditorInterfaceGen . cpp <nl> <nl> - / / = = = mmm SwiftEditorInterfaceGen . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm SwiftEditorInterfaceGen . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / swift - ide - test / KnownObjCMethods . def <nl> ppp b / tools / swift - ide - test / KnownObjCMethods . def <nl> <nl> - / / = = = mmm KnownObjCMethods . def - Designated Initializers mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm KnownObjCMethods . def - Designated Initializers mmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl>
|
Fix alignment as requested by @ gribozavr in
|
apple/swift
|
cd7d8dfaffc9a89bda9c0401188d8067686f6a83
|
2015-12-21T07:54:24Z
|
mmm a / src / containers / archive / buffer_group_stream . cc <nl> ppp b / src / containers / archive / buffer_group_stream . cc <nl> int64_t buffer_group_read_stream_t : : read ( void * p , int64_t n ) { <nl> <nl> return original_n - n ; <nl> } <nl> + <nl> + buffer_group_write_stream_t : : buffer_group_write_stream_t ( const buffer_group_t * group ) <nl> + : group_ ( group ) , bufnum_ ( 0 ) , bufpos_ ( 0 ) { } <nl> + <nl> + buffer_group_write_stream_t : : ~ buffer_group_write_stream_t ( ) { } <nl> + <nl> + int64_t buffer_group_write_stream_t : : write ( const void * p , int64_t n ) { <nl> + const char * v = static_cast < const char * > ( p ) ; <nl> + const int64_t original_n = n ; <nl> + <nl> + while ( bufnum_ < group_ - > num_buffers ( ) & & n > 0 ) { <nl> + buffer_group_t : : buffer_t buf = group_ - > get_buffer ( bufnum_ ) ; <nl> + int64_t bytes_to_copy = std : : min ( buf . size - bufpos_ , n ) ; <nl> + memcpy ( static_cast < char * > ( buf . data ) + bufpos_ , v , bytes_to_copy ) ; <nl> + n - = bytes_to_copy ; <nl> + v + = bytes_to_copy ; <nl> + bufpos_ + = bytes_to_copy ; <nl> + <nl> + if ( bufpos_ = = buf . size ) { <nl> + + + bufnum_ ; <nl> + bufpos_ = 0 ; <nl> + } <nl> + } <nl> + <nl> + return n = = 0 ? original_n : - 1 ; <nl> + } <nl> + <nl> + <nl> + <nl> mmm a / src / containers / archive / buffer_group_stream . hpp <nl> ppp b / src / containers / archive / buffer_group_stream . hpp <nl> <nl> # include " errors . hpp " <nl> <nl> class const_buffer_group_t ; <nl> + class buffer_group_t ; <nl> <nl> class buffer_group_read_stream_t : public read_stream_t { <nl> public : <nl> class buffer_group_read_stream_t : public read_stream_t { <nl> DISABLE_COPYING ( buffer_group_read_stream_t ) ; <nl> } ; <nl> <nl> + class buffer_group_write_stream_t : public write_stream_t { <nl> + public : <nl> + explicit buffer_group_write_stream_t ( const buffer_group_t * group ) ; <nl> + virtual ~ buffer_group_write_stream_t ( ) ; <nl> + <nl> + virtual MUST_USE int64_t write ( const void * p , int64_t n ) ; <nl> + <nl> + private : <nl> + const buffer_group_t * group_ ; <nl> + size_t bufnum_ ; <nl> + int64_t bufpos_ ; <nl> + <nl> + DISABLE_COPYING ( buffer_group_write_stream_t ) ; <nl> + } ; <nl> + <nl> <nl> <nl> # endif / / CONTAINERS_ARCHIVE_BUFFER_GROUP_STREAM_HPP_ <nl>
|
Added buffer_group_write_stream_t type .
|
rethinkdb/rethinkdb
|
aaa32f8cf090ff022dccc68d0a0249e20892a088
|
2013-09-15T05:13:40Z
|
mmm a / include / swift / SILOptimizer / PassManager / Passes . def <nl> ppp b / include / swift / SILOptimizer / PassManager / Passes . def <nl> PASS ( GlobalOpt , " global - opt " , <nl> " Global variable optimizations " ) <nl> PASS ( GlobalPropertyOpt , " global - property - opt " , <nl> " Optimize properties " ) <nl> + PASS ( GuaranteedARCOpts , " guaranteed - arc - opts " , <nl> + " Guaranteed ARC optimizations " ) <nl> PASS ( HighLevelCSE , " high - level - cse " , <nl> " Common subexpression elimination on High - level SIL " ) <nl> PASS ( HighLevelLICM , " high - level - licm " , <nl> mmm a / lib / SILOptimizer / Mandatory / CMakeLists . txt <nl> ppp b / lib / SILOptimizer / Mandatory / CMakeLists . txt <nl> <nl> set ( MANDATORY_SOURCES <nl> Mandatory / DefiniteInitialization . cpp <nl> - Mandatory / MandatoryInlining . cpp <nl> Mandatory / DIMemoryUseCollector . cpp <nl> Mandatory / DataflowDiagnostics . cpp <nl> Mandatory / DiagnoseUnreachable . cpp <nl> + Mandatory / GuaranteedARCOpts . cpp <nl> + Mandatory / MandatoryInlining . cpp <nl> Mandatory / PredictableMemOpt . cpp <nl> Mandatory / ConstantPropagation . cpp <nl> PARENT_SCOPE ) <nl> new file mode 100644 <nl> index 000000000000 . . ddf8e17c066d <nl> mmm / dev / null <nl> ppp b / lib / SILOptimizer / Mandatory / GuaranteedARCOpts . cpp <nl> <nl> + / / = = = mmm GuaranteedARCOpts . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2016 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See http : / / swift . org / LICENSE . txt for license information <nl> + / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + # define DEBUG_TYPE " sil - guaranteed - arc - opts " <nl> + # include " swift / SILOptimizer / PassManager / Passes . h " <nl> + # include " swift / SILOptimizer / PassManager / Transforms . h " <nl> + # include " swift / SIL / SILVisitor . h " <nl> + <nl> + using namespace swift ; <nl> + <nl> + namespace { <nl> + <nl> + struct GuaranteedARCOptsVisitor <nl> + : SILInstructionVisitor < GuaranteedARCOptsVisitor , bool > { <nl> + bool visitValueBase ( ValueBase * V ) { return false ; } <nl> + bool visitDestroyAddrInst ( DestroyAddrInst * DAI ) ; <nl> + bool visitStrongReleaseInst ( StrongReleaseInst * SRI ) ; <nl> + bool visitDestroyValueInst ( DestroyValueInst * DVI ) ; <nl> + bool visitReleaseValueInst ( ReleaseValueInst * RVI ) ; <nl> + } ; <nl> + <nl> + } / / end anonymous namespace <nl> + <nl> + static SILBasicBlock : : reverse_iterator <nl> + getPrevReverseIterator ( SILInstruction * I ) { <nl> + auto Iter = std : : next ( I - > getIterator ( ) ) ; <nl> + return std : : next ( SILBasicBlock : : reverse_iterator ( Iter ) ) ; <nl> + } <nl> + <nl> + bool GuaranteedARCOptsVisitor : : visitDestroyAddrInst ( DestroyAddrInst * DAI ) { <nl> + SILValue Operand = DAI - > getOperand ( ) ; <nl> + <nl> + for ( auto II = getPrevReverseIterator ( DAI ) , IE = DAI - > getParent ( ) - > rend ( ) ; <nl> + II ! = IE ; ) { <nl> + auto * Inst = & * II ; <nl> + + + II ; <nl> + <nl> + if ( auto * CA = dyn_cast < CopyAddrInst > ( Inst ) ) { <nl> + if ( CA - > getSrc ( ) = = Operand & & ! CA - > isTakeOfSrc ( ) ) { <nl> + CA - > setIsTakeOfSrc ( IsTake ) ; <nl> + DAI - > eraseFromParent ( ) ; <nl> + return true ; <nl> + } <nl> + } <nl> + <nl> + / / destroy_addrs commonly exist in a block of dealloc_stack ' s , which don ' t <nl> + / / affect take - ability . <nl> + if ( isa < DeallocStackInst > ( Inst ) ) <nl> + continue ; <nl> + <nl> + / / This code doesn ' t try to prove tricky validity constraints about whether <nl> + / / it is safe to push the destroy_addr past interesting instructions . <nl> + if ( Inst - > mayHaveSideEffects ( ) ) <nl> + break ; <nl> + } <nl> + <nl> + / / If we didn ' t find a copy_addr to fold this into , emit the destroy_addr . <nl> + return false ; <nl> + } <nl> + <nl> + static bool couldReduceStrongRefcount ( SILInstruction * Inst ) { <nl> + / / Simple memory accesses cannot reduce refcounts . <nl> + if ( isa < LoadInst > ( Inst ) | | isa < StoreInst > ( Inst ) | | <nl> + isa < RetainValueInst > ( Inst ) | | isa < UnownedRetainInst > ( Inst ) | | <nl> + isa < UnownedReleaseInst > ( Inst ) | | isa < StrongRetainUnownedInst > ( Inst ) | | <nl> + isa < StoreWeakInst > ( Inst ) | | isa < StrongRetainInst > ( Inst ) | | <nl> + isa < AllocStackInst > ( Inst ) | | isa < DeallocStackInst > ( Inst ) ) <nl> + return false ; <nl> + <nl> + / / Assign and copyaddr of trivial types cannot drop refcounts , and ' inits ' <nl> + / / never can either . Nontrivial ones can though , because the overwritten <nl> + / / value drops a retain . We would have to do more alias analysis to be able <nl> + / / to safely ignore one of those . <nl> + if ( auto * AI = dyn_cast < AssignInst > ( Inst ) ) { <nl> + SILType StoredType = AI - > getOperand ( 0 ) - > getType ( ) ; <nl> + if ( StoredType . isTrivial ( Inst - > getModule ( ) ) | | <nl> + StoredType . is < ReferenceStorageType > ( ) ) <nl> + return false ; <nl> + } <nl> + <nl> + if ( auto * CAI = dyn_cast < CopyAddrInst > ( Inst ) ) { <nl> + / / Initializations can only increase refcounts . <nl> + if ( CAI - > isInitializationOfDest ( ) ) <nl> + return false ; <nl> + <nl> + SILType StoredType = CAI - > getOperand ( 0 ) - > getType ( ) . getObjectType ( ) ; <nl> + if ( StoredType . isTrivial ( Inst - > getModule ( ) ) | | <nl> + StoredType . is < ReferenceStorageType > ( ) ) <nl> + return false ; <nl> + } <nl> + <nl> + / / This code doesn ' t try to prove tricky validity constraints about whether <nl> + / / it is safe to push the release past interesting instructions . <nl> + return Inst - > mayHaveSideEffects ( ) ; <nl> + } <nl> + <nl> + bool GuaranteedARCOptsVisitor : : visitStrongReleaseInst ( StrongReleaseInst * SRI ) { <nl> + SILValue Operand = SRI - > getOperand ( ) ; <nl> + / / Release on a functionref is a noop . <nl> + if ( isa < FunctionRefInst > ( Operand ) ) { <nl> + SRI - > eraseFromParent ( ) ; <nl> + return true ; <nl> + } <nl> + <nl> + / / Check to see if the instruction immediately before the insertion point is a <nl> + / / strong_retain of the specified operand . If so , we can zap the pair . <nl> + for ( auto II = getPrevReverseIterator ( SRI ) , IE = SRI - > getParent ( ) - > rend ( ) ; <nl> + II ! = IE ; ) { <nl> + auto * Inst = & * II ; <nl> + + + II ; <nl> + <nl> + if ( auto * SRA = dyn_cast < StrongRetainInst > ( Inst ) ) { <nl> + if ( SRA - > getOperand ( ) = = Operand ) { <nl> + SRA - > eraseFromParent ( ) ; <nl> + SRI - > eraseFromParent ( ) ; <nl> + return true ; <nl> + } <nl> + / / Skip past unrelated retains . <nl> + continue ; <nl> + } <nl> + <nl> + / / Scan past simple instructions that cannot reduce strong refcounts . <nl> + if ( couldReduceStrongRefcount ( Inst ) ) <nl> + break ; <nl> + } <nl> + <nl> + / / If we didn ' t find a retain to fold this into , return false . <nl> + return false ; <nl> + } <nl> + <nl> + bool GuaranteedARCOptsVisitor : : visitDestroyValueInst ( DestroyValueInst * DVI ) { <nl> + SILValue Operand = DVI - > getOperand ( ) ; <nl> + for ( auto II = getPrevReverseIterator ( DVI ) , IE = DVI - > getParent ( ) - > rend ( ) ; <nl> + II ! = IE ; ) { <nl> + auto * Inst = & * II ; <nl> + + + II ; <nl> + <nl> + if ( auto * CVI = dyn_cast < CopyValueInst > ( Inst ) ) { <nl> + if ( SILValue ( CVI ) = = Operand | | CVI - > getOperand ( ) = = Operand ) { <nl> + CVI - > replaceAllUsesWith ( CVI - > getOperand ( ) ) ; <nl> + CVI - > eraseFromParent ( ) ; <nl> + DVI - > eraseFromParent ( ) ; <nl> + return true ; <nl> + } <nl> + / / Skip past unrelated retains . <nl> + continue ; <nl> + } <nl> + <nl> + / / Scan past simple instructions that cannot reduce refcounts . <nl> + if ( couldReduceStrongRefcount ( Inst ) ) <nl> + break ; <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + bool GuaranteedARCOptsVisitor : : visitReleaseValueInst ( ReleaseValueInst * RVI ) { <nl> + SILValue Operand = RVI - > getOperand ( ) ; <nl> + <nl> + for ( auto II = getPrevReverseIterator ( RVI ) , IE = RVI - > getParent ( ) - > rend ( ) ; <nl> + II ! = IE ; ) { <nl> + auto * Inst = & * II ; <nl> + + + II ; <nl> + <nl> + if ( auto * SRA = dyn_cast < RetainValueInst > ( Inst ) ) { <nl> + if ( SRA - > getOperand ( ) = = Operand ) { <nl> + SRA - > eraseFromParent ( ) ; <nl> + RVI - > eraseFromParent ( ) ; <nl> + return true ; <nl> + } <nl> + / / Skip past unrelated retains . <nl> + continue ; <nl> + } <nl> + <nl> + / / Scan past simple instructions that cannot reduce refcounts . <nl> + if ( couldReduceStrongRefcount ( Inst ) ) <nl> + break ; <nl> + } <nl> + <nl> + / / If we didn ' t find a retain to fold this into , emit the release . <nl> + return false ; <nl> + } <nl> + <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / Top Level Entrypoint <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + namespace { <nl> + <nl> + struct GuaranteedARCOpts : SILFunctionTransform { <nl> + void run ( ) override { <nl> + GuaranteedARCOptsVisitor Visitor ; <nl> + <nl> + bool MadeChange = false ; <nl> + SILFunction * F = getFunction ( ) ; <nl> + for ( auto & BB : * F ) { <nl> + for ( auto II = BB . begin ( ) , IE = BB . end ( ) ; II ! = IE ; ) { <nl> + SILInstruction * I = & * II ; <nl> + + + II ; <nl> + MadeChange | = Visitor . visit ( I ) ; <nl> + } <nl> + } <nl> + <nl> + if ( MadeChange ) { <nl> + invalidateAnalysis ( SILAnalysis : : InvalidationKind : : Instructions ) ; <nl> + } <nl> + } <nl> + <nl> + StringRef getName ( ) override { return " Guaranteed ARC Opts " ; } <nl> + } ; <nl> + <nl> + } / / end swift namespace <nl> + <nl> + SILTransform * swift : : createGuaranteedARCOpts ( ) { <nl> + return new GuaranteedARCOpts ( ) ; <nl> + } <nl> mmm a / lib / SILOptimizer / PassManager / Passes . cpp <nl> ppp b / lib / SILOptimizer / PassManager / Passes . cpp <nl> bool swift : : runSILDiagnosticPasses ( SILModule & Module ) { <nl> PM . addMandatoryInlining ( ) ; <nl> PM . addPredictableMemoryOptimizations ( ) ; <nl> PM . addDiagnosticConstantPropagation ( ) ; <nl> + PM . addGuaranteedARCOpts ( ) ; <nl> PM . addDiagnoseUnreachable ( ) ; <nl> PM . addEmitDFDiagnostics ( ) ; <nl> / / Canonical swift requires all non cond_br critical edges to be split . <nl> mmm a / test / DebugInfo / return . swift <nl> ppp b / test / DebugInfo / return . swift <nl> public func ifelseexpr ( ) - > Int64 { <nl> x . x - = 1 <nl> } <nl> / / CHECK : @ swift_rt_swift_release to void ( % C6return1X * ) * ) ( % C6return1X * [ [ X ] ] ) <nl> - / / CHECK : @ swift_rt_swift_release to void ( % C6return1X * ) * ) ( % C6return1X * [ [ X ] ] ) <nl> / / CHECK - SAME : , ! dbg ! [ [ RELEASE : . * ] ] <nl> <nl> / / The ret instruction should be in the same scope as the return expression . <nl> mmm a / test / IRGen / boxed_existential . sil <nl> ppp b / test / IRGen / boxed_existential . sil <nl> <nl> <nl> import Swift <nl> <nl> + sil @ error_user : $ @ convention ( thin ) ( @ owned Error ) - > ( ) <nl> + <nl> / / CHECK - LABEL : define { { ( protected ) ? } } void @ retain_release_boxed_existential ( % swift . error * ) <nl> - sil @ retain_release_boxed_existential : $ @ convention ( thin ) ( Error ) - > ( ) { <nl> + sil @ retain_release_boxed_existential : $ @ convention ( thin ) ( @ owned Error ) - > ( ) { <nl> entry ( % e : $ Error ) : <nl> / / CHECK - objc : @ swift_errorRetain <nl> / / CHECK - native : @ swift_rt_swift_retain <nl> strong_retain % e : $ Error <nl> + % 1 = function_ref @ error_user : $ @ convention ( thin ) ( @ owned Error ) - > ( ) <nl> + apply % 1 ( % e ) : $ @ convention ( thin ) ( @ owned Error ) - > ( ) <nl> / / CHECK - objc : @ swift_errorRelease <nl> / / CHECK - native : @ swift_rt_swift_release <nl> strong_release % e : $ Error <nl> mmm a / test / IRGen / enum_value_semantics . sil <nl> ppp b / test / IRGen / enum_value_semantics . sil <nl> enum SinglePayloadNontrivial { <nl> case c <nl> } <nl> <nl> + sil @ single_payload_nontrivial_user : $ @ convention ( thin ) ( @ owned SinglePayloadNontrivial ) - > ( ) <nl> + <nl> enum MultiPayloadTrivial { <nl> case payload1 ( Builtin . Int64 ) <nl> case payload2 ( Builtin . Int32 , Builtin . Int32 ) <nl> enum GenericFixedLayout < T > { <nl> / / CHECK : % swift . type * * null <nl> / / CHECK : } > <nl> <nl> - sil @ single_payload_nontrivial_copy_destroy : $ ( SinglePayloadNontrivial ) - > ( ) { <nl> + sil @ single_payload_nontrivial_copy_destroy : $ ( @ owned SinglePayloadNontrivial ) - > ( ) { <nl> bb0 ( % 0 : $ SinglePayloadNontrivial ) : <nl> retain_value % 0 : $ SinglePayloadNontrivial <nl> + % 1 = function_ref @ single_payload_nontrivial_user : $ @ convention ( thin ) ( @ owned SinglePayloadNontrivial ) - > ( ) <nl> + apply % 1 ( % 0 ) : $ @ convention ( thin ) ( @ owned SinglePayloadNontrivial ) - > ( ) <nl> release_value % 0 : $ SinglePayloadNontrivial <nl> % v = tuple ( ) <nl> return % v : $ ( ) <nl> mmm a / test / IRGen / objc . swift <nl> ppp b / test / IRGen / objc . swift <nl> class Octogenarian : Contrarian { <nl> @ objc override func eviscerate ( ) { } <nl> } <nl> <nl> + @ _silgen_name ( " unknown " ) <nl> + func unknown ( _ x : id ) - > id <nl> + <nl> / / CHECK : define hidden % objc_object * @ _TF4objc5test0 { { . * } } ( % objc_object * ) <nl> / / CHECK - NOT : call { { . * } } @ swift_unknownRetain <nl> / / CHECK : call { { . * } } @ swift_unknownRetain <nl> class Octogenarian : Contrarian { <nl> func test0 ( _ arg : id ) - > id { <nl> var x : id <nl> x = arg <nl> + unknown ( x ) <nl> var y = x <nl> return y <nl> } <nl> new file mode 100644 <nl> index 000000000000 . . 7f61b17eaa06 <nl> mmm / dev / null <nl> ppp b / test / SILOptimizer / guaranteed_arc_opts . sil <nl> <nl> + / / RUN : % target - sil - opt - guaranteed - arc - opts % s | % FileCheck % s <nl> + <nl> + sil_stage raw <nl> + <nl> + import Builtin <nl> + <nl> + sil @ kraken : $ @ convention ( thin ) ( ) - > ( ) <nl> + <nl> + / / CHECK - LABEL : sil @ copyvalue_test1 : $ @ convention ( thin ) ( Builtin . NativeObject , Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : bb0 ( [ [ ARG1 : % . * ] ] : $ Builtin . NativeObject , [ [ ARG2 : % . * ] ] : $ Builtin . NativeObject ) : <nl> + / / CHECK - NOT : copy_value [ [ ARG1 ] ] <nl> + / / CHECK : copy_value [ [ ARG2 ] ] <nl> + / / CHECK - NOT : destroy_value [ [ ARG1 ] ] <nl> + sil @ copyvalue_test1 : $ @ convention ( thin ) ( Builtin . NativeObject , Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject , % 1 : $ Builtin . NativeObject ) : <nl> + % 2 = copy_value % 0 : $ Builtin . NativeObject <nl> + copy_value % 1 : $ Builtin . NativeObject <nl> + destroy_value % 2 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ copyvalue_test2 : $ @ convention ( thin ) ( Builtin . NativeObject , @ in Builtin . Int32 ) - > Builtin . NativeObject { <nl> + / / CHECK : bb0 ( [ [ ARG1 : % . * ] ] : $ Builtin . NativeObject <nl> + / / CHECK - NOT : copy_value <nl> + / / CHECK - NOT : destroy_value <nl> + / / CHECK : return [ [ ARG1 ] ] <nl> + sil @ copyvalue_test2 : $ @ convention ( thin ) ( Builtin . NativeObject , @ in Builtin . Int32 ) - > Builtin . NativeObject { <nl> + bb0 ( % 0 : $ Builtin . NativeObject , % 1 : $ * Builtin . Int32 ) : <nl> + % 2 = copy_value % 0 : $ Builtin . NativeObject <nl> + % 3 = integer_literal $ Builtin . Int32 , 0 <nl> + store % 3 to [ trivial ] % 1 : $ * Builtin . Int32 <nl> + destroy_value % 0 : $ Builtin . NativeObject <nl> + return % 2 : $ Builtin . NativeObject <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ copyvalue_test3 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : copy_value <nl> + / / CHECK : destroy_value <nl> + sil @ copyvalue_test3 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject ) : <nl> + copy_value % 0 : $ Builtin . NativeObject <nl> + % 1 = function_ref @ kraken : $ @ convention ( thin ) ( ) - > ( ) <nl> + apply % 1 ( ) : $ @ convention ( thin ) ( ) - > ( ) <nl> + destroy_value % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ copyvalue_test4 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : destroy_value <nl> + sil @ copyvalue_test4 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject ) : <nl> + destroy_value % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . cda4fc28d426 <nl> mmm / dev / null <nl> ppp b / test / SILOptimizer / guaranteed_arc_opts_qualified . sil <nl> <nl> + / / RUN : % target - sil - opt - assume - parsing - unqualified - ownership - sil - guaranteed - arc - opts % s | % FileCheck % s <nl> + <nl> + sil_stage raw <nl> + <nl> + import Builtin <nl> + <nl> + sil @ kraken : $ @ convention ( thin ) ( ) - > ( ) <nl> + <nl> + / / CHECK - LABEL : sil @ retainvalue_test1 : $ @ convention ( thin ) ( Builtin . NativeObject , Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : bb0 ( [ [ ARG1 : % . * ] ] : $ Builtin . NativeObject , [ [ ARG2 : % . * ] ] : $ Builtin . NativeObject ) : <nl> + / / CHECK - NOT : retain_value [ [ ARG1 ] ] <nl> + / / CHECK : retain_value [ [ ARG2 ] ] <nl> + / / CHECK - NOT : release_value [ [ ARG1 ] ] <nl> + sil @ retainvalue_test1 : $ @ convention ( thin ) ( Builtin . NativeObject , Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject , % 1 : $ Builtin . NativeObject ) : <nl> + retain_value % 0 : $ Builtin . NativeObject <nl> + retain_value % 1 : $ Builtin . NativeObject <nl> + release_value % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ retainvalue_test2 : $ @ convention ( thin ) ( Builtin . NativeObject , @ in Builtin . Int32 ) - > ( ) { <nl> + / / CHECK - NOT : retain_value <nl> + / / CHECK - NOT : release_value <nl> + sil @ retainvalue_test2 : $ @ convention ( thin ) ( Builtin . NativeObject , @ in Builtin . Int32 ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject , % 1 : $ * Builtin . Int32 ) : <nl> + retain_value % 0 : $ Builtin . NativeObject <nl> + % 2 = integer_literal $ Builtin . Int32 , 0 <nl> + store % 2 to % 1 : $ * Builtin . Int32 <nl> + release_value % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ retainvalue_test3 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : retain_value <nl> + / / CHECK : release_value <nl> + sil @ retainvalue_test3 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject ) : <nl> + retain_value % 0 : $ Builtin . NativeObject <nl> + % 1 = function_ref @ kraken : $ @ convention ( thin ) ( ) - > ( ) <nl> + apply % 1 ( ) : $ @ convention ( thin ) ( ) - > ( ) <nl> + release_value % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ retainvalue_test4 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : release_value <nl> + sil @ retainvalue_test4 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject ) : <nl> + release_value % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ strongretain_test1 : $ @ convention ( thin ) ( Builtin . NativeObject , Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : bb0 ( [ [ ARG1 : % . * ] ] : $ Builtin . NativeObject , [ [ ARG2 : % . * ] ] : $ Builtin . NativeObject ) : <nl> + / / CHECK - NOT : strong_retain [ [ ARG1 ] ] <nl> + / / CHECK : strong_retain [ [ ARG2 ] ] <nl> + / / CHECK - NOT : strong_release [ [ ARG1 ] ] <nl> + sil @ strongretain_test1 : $ @ convention ( thin ) ( Builtin . NativeObject , Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject , % 1 : $ Builtin . NativeObject ) : <nl> + strong_retain % 0 : $ Builtin . NativeObject <nl> + strong_retain % 1 : $ Builtin . NativeObject <nl> + strong_release % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ strongretain_test2 : $ @ convention ( thin ) ( Builtin . NativeObject , @ in Builtin . Int32 ) - > ( ) { <nl> + / / CHECK - NOT : strong_retain <nl> + / / CHECK - NOT : strong_release <nl> + sil @ strongretain_test2 : $ @ convention ( thin ) ( Builtin . NativeObject , @ in Builtin . Int32 ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject , % 1 : $ * Builtin . Int32 ) : <nl> + strong_retain % 0 : $ Builtin . NativeObject <nl> + % 2 = integer_literal $ Builtin . Int32 , 0 <nl> + store % 2 to % 1 : $ * Builtin . Int32 <nl> + strong_release % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ strongretain_test3 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : strong_retain <nl> + / / CHECK : strong_release <nl> + sil @ strongretain_test3 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject ) : <nl> + strong_retain % 0 : $ Builtin . NativeObject <nl> + % 1 = function_ref @ kraken : $ @ convention ( thin ) ( ) - > ( ) <nl> + apply % 1 ( ) : $ @ convention ( thin ) ( ) - > ( ) <nl> + strong_release % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ strongretain_test4 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : strong_release <nl> + sil @ strongretain_test4 : $ @ convention ( thin ) ( Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ Builtin . NativeObject ) : <nl> + strong_release % 0 : $ Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ copyaddr_test1 : $ @ convention ( thin ) ( @ in Builtin . NativeObject ) - > @ out Builtin . NativeObject { <nl> + / / CHECK : bb0 ( [ [ ARG1 : % . * ] ] : $ * Builtin . NativeObject , [ [ ARG2 : % . * ] ] : $ * Builtin . NativeObject ) : <nl> + / / CHECK : copy_addr [ take ] { { % . * } } to { { % . * } } <nl> + / / CHECK - NOT : destroy_addr [ [ ARG1 ] ] <nl> + sil @ copyaddr_test1 : $ @ convention ( thin ) ( @ in Builtin . NativeObject ) - > @ out Builtin . NativeObject { <nl> + bb0 ( % 0 : $ * Builtin . NativeObject , % 1 : $ * Builtin . NativeObject ) : <nl> + copy_addr % 1 to % 0 : $ * Builtin . NativeObject <nl> + destroy_addr % 1 : $ * Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ copyaddr_test2 : $ @ convention ( thin ) ( @ in Builtin . NativeObject ) - > @ out Builtin . NativeObject { <nl> + / / CHECK : copy_addr <nl> + / / CHECK : destroy_addr <nl> + sil @ copyaddr_test2 : $ @ convention ( thin ) ( @ in Builtin . NativeObject ) - > @ out Builtin . NativeObject { <nl> + bb0 ( % 0 : $ * Builtin . NativeObject , % 1 : $ * Builtin . NativeObject ) : <nl> + copy_addr % 1 to % 0 : $ * Builtin . NativeObject <nl> + % 2 = function_ref @ kraken : $ @ convention ( thin ) ( ) - > ( ) <nl> + apply % 2 ( ) : $ @ convention ( thin ) ( ) - > ( ) <nl> + destroy_addr % 1 : $ * Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil @ copyaddr_test3 : $ @ convention ( thin ) ( @ in Builtin . NativeObject ) - > ( ) { <nl> + / / CHECK : destroy_addr <nl> + sil @ copyaddr_test3 : $ @ convention ( thin ) ( @ in Builtin . NativeObject ) - > ( ) { <nl> + bb0 ( % 0 : $ * Builtin . NativeObject ) : <nl> + destroy_addr % 0 : $ * Builtin . NativeObject <nl> + % 9999 = tuple ( ) <nl> + return % 9999 : $ ( ) <nl> + } <nl>
|
Merge pull request from gottesmm / add_mandatorycfg_mandatoryarc_pass
|
apple/swift
|
8800c8c55cd4d73537d8262b1d1bbd4fcc7a4086
|
2016-11-02T18:51:44Z
|
mmm a / Telegram / SourceFiles / main / main_domain . cpp <nl> ppp b / Telegram / SourceFiles / main / main_domain . cpp <nl> not_null < Main : : Account * > Domain : : add ( MTP : : Environment environment ) { <nl> return account ; <nl> } <nl> <nl> + void Domain : : addActivated ( MTP : : Environment environment ) { <nl> + if ( accounts ( ) . size ( ) < Main : : Domain : : kMaxAccounts ) { <nl> + activate ( add ( environment ) ) ; <nl> + } else { <nl> + for ( auto & [ index , account ] : accounts ( ) ) { <nl> + if ( ! account - > sessionExists ( ) <nl> + & & account - > mtp ( ) . environment ( ) = = environment ) { <nl> + activate ( account . get ( ) ) ; <nl> + break ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> void Domain : : watchSession ( not_null < Account * > account ) { <nl> account - > sessionValue ( <nl> ) | rpl : : filter ( [ = ] ( Session * session ) { <nl> mmm a / Telegram / SourceFiles / main / main_domain . h <nl> ppp b / Telegram / SourceFiles / main / main_domain . h <nl> class Domain final { <nl> <nl> [ [ nodiscard ] ] not_null < Main : : Account * > add ( MTP : : Environment environment ) ; <nl> void activate ( not_null < Main : : Account * > account ) ; <nl> + void addActivated ( MTP : : Environment environment ) ; <nl> <nl> / / Interface for Storage : : Domain . <nl> void accountAddedInStorage ( AccountWithIndex accountWithIndex ) ; <nl> mmm a / Telegram / SourceFiles / settings / settings_common . cpp <nl> ppp b / Telegram / SourceFiles / settings / settings_common . cpp <nl> For license and copyright information please follow this link : <nl> # include " settings / settings_privacy_security . h " <nl> # include " settings / settings_folders . h " <nl> # include " settings / settings_calls . h " <nl> + # include " core / application . h " <nl> # include " ui / wrap / padding_wrap . h " <nl> # include " ui / wrap / vertical_layout . h " <nl> # include " ui / widgets / labels . h " <nl> For license and copyright information please follow this link : <nl> # include " lang / lang_keys . h " <nl> # include " mainwindow . h " <nl> # include " main / main_session . h " <nl> + # include " main / main_domain . h " <nl> # include " styles / style_layers . h " <nl> # include " styles / style_settings . h " <nl> <nl> void FillMenu ( <nl> tr : : lng_settings_bg_theme_create ( tr : : now ) , <nl> [ = ] { window - > show ( Box ( Window : : Theme : : CreateBox , window ) ) ; } ) ; <nl> } else { <nl> + const auto & list = Core : : App ( ) . domain ( ) . accounts ( ) ; <nl> + if ( list . size ( ) < : : Main : : Domain : : kMaxAccounts ) { <nl> + addAction ( tr : : lng_menu_add_account ( tr : : now ) , [ = ] { <nl> + Core : : App ( ) . domain ( ) . addActivated ( MTP : : Environment { } ) ; <nl> + } ) ; <nl> + } <nl> if ( ! controller - > session ( ) . supportMode ( ) ) { <nl> addAction ( <nl> tr : : lng_settings_information ( tr : : now ) , <nl> mmm a / Telegram / SourceFiles / window / window_main_menu . cpp <nl> ppp b / Telegram / SourceFiles / window / window_main_menu . cpp <nl> not_null < Ui : : SlideWrap < Ui : : RippleButton > * > MainMenu : : setupAddAccount ( <nl> } , button - > lifetime ( ) ) ; <nl> <nl> const auto add = [ = ] ( MTP : : Environment environment ) { <nl> - auto & domain = Core : : App ( ) . domain ( ) ; <nl> - if ( domain . accounts ( ) . size ( ) < Main : : Domain : : kMaxAccounts ) { <nl> - domain . activate ( domain . add ( environment ) ) ; <nl> - } else { <nl> - for ( auto & [ index , account ] : domain . accounts ( ) ) { <nl> - if ( ! account - > sessionExists ( ) <nl> - & & account - > mtp ( ) . environment ( ) = = environment ) { <nl> - domain . activate ( account . get ( ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> + Core : : App ( ) . domain ( ) . addActivated ( environment ) ; <nl> } ; <nl> <nl> button - > setAcceptBoth ( true ) ; <nl>
|
Add account from settings three - dot menu .
|
telegramdesktop/tdesktop
|
5cc7c2b6c6ecdce1ab4067549c4e7acd299dd5d5
|
2020-06-30T17:16:05Z
|
mmm a / core / doc_data . h <nl> ppp b / core / doc_data . h <nl> class DocData { <nl> struct ConstantDoc { <nl> String name ; <nl> String value ; <nl> - bool is_value_valid ; <nl> + bool is_value_valid = false ; <nl> String enumeration ; <nl> String description ; <nl> bool operator < ( const ConstantDoc & p_const ) const { <nl> mmm a / editor / animation_bezier_editor . h <nl> ppp b / editor / animation_bezier_editor . h <nl> class AnimationBezierTrackEdit : public Control { <nl> Vector2 menu_insert_key ; <nl> <nl> struct AnimMoveRestore { <nl> - int track ; <nl> - float time ; <nl> + int track = 0 ; <nl> + float time = 0 ; <nl> Variant key ; <nl> - float transition ; <nl> + float transition = 0 ; <nl> } ; <nl> <nl> AnimationTrackEditor * editor ; <nl> mmm a / editor / animation_track_editor . cpp <nl> ppp b / editor / animation_track_editor . cpp <nl> class AnimationTrackKeyEdit : public Object { <nl> GDCLASS ( AnimationTrackKeyEdit , Object ) ; <nl> <nl> public : <nl> - bool setting ; <nl> + bool setting = false ; <nl> <nl> bool _hide_script_from_inspector ( ) { <nl> return true ; <nl> class AnimationTrackKeyEdit : public Object { <nl> } <nl> } <nl> <nl> - UndoRedo * undo_redo ; <nl> + UndoRedo * undo_redo = nullptr ; <nl> Ref < Animation > animation ; <nl> - int track ; <nl> - float key_ofs ; <nl> - Node * root_path ; <nl> + int track = - 1 ; <nl> + float key_ofs = 0 ; <nl> + Node * root_path = nullptr ; <nl> <nl> PropertyInfo hint ; <nl> NodePath base ; <nl> - bool use_fps ; <nl> + bool use_fps = false ; <nl> <nl> void notify_change ( ) { <nl> _change_notify ( ) ; <nl> class AnimationTrackKeyEdit : public Object { <nl> use_fps = p_enable ; <nl> _change_notify ( ) ; <nl> } <nl> - <nl> - AnimationTrackKeyEdit ( ) { <nl> - use_fps = false ; <nl> - key_ofs = 0 ; <nl> - track = - 1 ; <nl> - setting = false ; <nl> - root_path = nullptr ; <nl> - } <nl> } ; <nl> <nl> class AnimationMultiTrackKeyEdit : public Object { <nl> GDCLASS ( AnimationMultiTrackKeyEdit , Object ) ; <nl> <nl> public : <nl> - bool setting ; <nl> + bool setting = false ; <nl> <nl> bool _hide_script_from_inspector ( ) { <nl> return true ; <nl> class AnimationMultiTrackKeyEdit : public Object { <nl> Map < int , NodePath > base_map ; <nl> PropertyInfo hint ; <nl> <nl> - Node * root_path ; <nl> + Node * root_path = nullptr ; <nl> <nl> - bool use_fps ; <nl> + bool use_fps = false ; <nl> <nl> - UndoRedo * undo_redo ; <nl> + UndoRedo * undo_redo = nullptr ; <nl> <nl> void notify_change ( ) { <nl> _change_notify ( ) ; <nl> class AnimationMultiTrackKeyEdit : public Object { <nl> use_fps = p_enable ; <nl> _change_notify ( ) ; <nl> } <nl> - <nl> - AnimationMultiTrackKeyEdit ( ) { <nl> - use_fps = false ; <nl> - setting = false ; <nl> - root_path = nullptr ; <nl> - } <nl> } ; <nl> <nl> void AnimationTimelineEdit : : _zoom_changed ( double ) { <nl> void AnimationTrackEditor : : _move_selection ( float p_offset ) { <nl> } <nl> <nl> struct _AnimMoveRestore { <nl> - int track ; <nl> - float time ; <nl> + int track = 0 ; <nl> + float time = 0 ; <nl> Variant key ; <nl> - float transition ; <nl> + float transition = 0 ; <nl> } ; <nl> / / used for undo / redo <nl> <nl> mmm a / editor / animation_track_editor . h <nl> ppp b / editor / animation_track_editor . h <nl> class AnimationTrackEditGroup : public Control { <nl> Ref < Texture2D > icon ; <nl> String node_name ; <nl> NodePath node ; <nl> - Node * root ; <nl> - AnimationTimelineEdit * timeline ; <nl> + Node * root = nullptr ; <nl> + AnimationTimelineEdit * timeline = nullptr ; <nl> <nl> void _zoom_changed ( ) ; <nl> <nl> class AnimationTrackEditor : public VBoxContainer { <nl> struct InsertData { <nl> Animation : : TrackType type ; <nl> NodePath path ; <nl> - int track_idx ; <nl> + int track_idx = 0 ; <nl> Variant value ; <nl> String query ; <nl> - bool advance ; <nl> + bool advance = false ; <nl> } ; / * insert_data ; * / <nl> <nl> Label * insert_confirm_text ; <nl> class AnimationTrackEditor : public VBoxContainer { <nl> / / selection <nl> <nl> struct SelectedKey { <nl> - int track ; <nl> - int key ; <nl> + int track = 0 ; <nl> + int key = 0 ; <nl> bool operator < ( const SelectedKey & p_key ) const { return track = = p_key . track ? key < p_key . key : track < p_key . track ; } ; <nl> } ; <nl> <nl> struct KeyInfo { <nl> - float pos ; <nl> + float pos = 0 ; <nl> } ; <nl> <nl> Map < SelectedKey , KeyInfo > selection ; <nl> class AnimationTrackEditor : public VBoxContainer { <nl> struct TrackClipboard { <nl> NodePath full_path ; <nl> NodePath base_path ; <nl> - Animation : : TrackType track_type ; <nl> - Animation : : InterpolationType interp_type ; <nl> - Animation : : UpdateMode update_mode ; <nl> - bool loop_wrap ; <nl> - bool enabled ; <nl> + Animation : : TrackType track_type = Animation : : TrackType : : TYPE_ANIMATION ; <nl> + Animation : : InterpolationType interp_type = Animation : : InterpolationType : : INTERPOLATION_CUBIC ; <nl> + Animation : : UpdateMode update_mode = Animation : : UpdateMode : : UPDATE_CAPTURE ; <nl> + bool loop_wrap = false ; <nl> + bool enabled = false ; <nl> <nl> struct Key { <nl> - float time ; <nl> - float transition ; <nl> + float time = 0 ; <nl> + float transition = 0 ; <nl> Variant value ; <nl> } ; <nl> Vector < Key > keys ; <nl> mmm a / editor / audio_stream_preview . h <nl> ppp b / editor / audio_stream_preview . h <nl> class AudioStreamPreviewGenerator : public Node { <nl> Ref < AudioStreamPreview > preview ; <nl> Ref < AudioStream > base_stream ; <nl> Ref < AudioStreamPlayback > playback ; <nl> - volatile bool generating ; <nl> + volatile bool generating = false ; <nl> ObjectID id ; <nl> - Thread * thread ; <nl> + Thread * thread = nullptr ; <nl> } ; <nl> <nl> Map < ObjectID , Preview > previews ; <nl> mmm a / editor / code_editor . cpp <nl> ppp b / editor / code_editor . cpp <nl> GotoLineDialog : : GotoLineDialog ( ) { <nl> register_text_enter ( line ) ; <nl> text_editor = nullptr ; <nl> <nl> + line_label = nullptr ; <nl> + <nl> set_hide_on_ok ( false ) ; <nl> } <nl> <nl> mmm a / editor / debugger / editor_profiler . h <nl> ppp b / editor / debugger / editor_profiler . h <nl> class EditorProfiler : public VBoxContainer { <nl> <nl> public : <nl> struct Metric { <nl> - bool valid ; <nl> + bool valid = false ; <nl> <nl> - int frame_number ; <nl> - float frame_time ; <nl> - float idle_time ; <nl> - float physics_time ; <nl> - float physics_frame_time ; <nl> + int frame_number = 0 ; <nl> + float frame_time = 0 ; <nl> + float idle_time = 0 ; <nl> + float physics_time = 0 ; <nl> + float physics_frame_time = 0 ; <nl> <nl> struct Category { <nl> StringName signature ; <nl> String name ; <nl> - float total_time ; / / total for category <nl> + float total_time = 0 ; / / total for category <nl> <nl> struct Item { <nl> StringName signature ; <nl> String name ; <nl> String script ; <nl> - int line ; <nl> - float self ; <nl> - float total ; <nl> - int calls ; <nl> + int line = 0 ; <nl> + float self = 0 ; <nl> + float total = 0 ; <nl> + int calls = 0 ; <nl> } ; <nl> <nl> Vector < Item > items ; <nl> class EditorProfiler : public VBoxContainer { <nl> <nl> Map < StringName , Category * > category_ptrs ; <nl> Map < StringName , Category : : Item * > item_ptrs ; <nl> - <nl> - Metric ( ) { <nl> - valid = false ; <nl> - frame_number = 0 ; <nl> - } <nl> } ; <nl> <nl> enum DisplayMode { <nl> mmm a / editor / debugger / editor_visual_profiler . h <nl> ppp b / editor / debugger / editor_visual_profiler . h <nl> class EditorVisualProfiler : public VBoxContainer { <nl> <nl> public : <nl> struct Metric { <nl> - bool valid ; <nl> + bool valid = false ; <nl> <nl> - uint64_t frame_number ; <nl> + uint64_t frame_number = 0 ; <nl> <nl> struct Area { <nl> String name ; <nl> class EditorVisualProfiler : public VBoxContainer { <nl> } ; <nl> <nl> Vector < Area > areas ; <nl> - <nl> - Metric ( ) { <nl> - valid = false ; <nl> - } <nl> } ; <nl> <nl> enum DisplayTimeMode { <nl> mmm a / editor / dependency_editor . cpp <nl> ppp b / editor / dependency_editor . cpp <nl> DependencyErrorDialog : : DependencyErrorDialog ( ) { <nl> vb - > add_child ( text ) ; <nl> text - > set_text ( TTR ( " Which action should be taken ? " ) ) ; <nl> <nl> + mode = Mode : : MODE_RESOURCE ; <nl> + <nl> fdep = add_button ( TTR ( " Fix Dependencies " ) , true , " fixdeps " ) ; <nl> <nl> set_title ( TTR ( " Errors loading ! " ) ) ; <nl> mmm a / editor / editor_atlas_packer . h <nl> ppp b / editor / editor_atlas_packer . h <nl> class EditorAtlasPacker { <nl> struct Chart { <nl> Vector < Vector2 > vertices ; <nl> struct Face { <nl> - int vertex [ 3 ] ; <nl> + int vertex [ 3 ] = { 0 } ; <nl> } ; <nl> Vector < Face > faces ; <nl> - bool can_transpose ; <nl> + bool can_transpose = false ; <nl> <nl> Vector2 final_offset ; <nl> - bool transposed ; <nl> + bool transposed = false ; <nl> } ; <nl> <nl> private : <nl> struct PlottedBitmap { <nl> - int chart_index ; <nl> + int chart_index = 0 ; <nl> Vector2i offset ; <nl> - int area ; <nl> + int area = 0 ; <nl> Vector < int > top_heights ; <nl> Vector < int > bottom_heights ; <nl> - bool transposed ; <nl> + bool transposed = false ; <nl> <nl> Vector2 final_pos ; <nl> <nl> mmm a / editor / editor_audio_buses . h <nl> ppp b / editor / editor_audio_buses . h <nl> class EditorAudioBus : public PanelContainer { <nl> static const int CHANNELS_MAX = 4 ; <nl> <nl> struct { <nl> - bool prev_active ; <nl> + bool prev_active = false ; <nl> <nl> - float peak_l ; <nl> - float peak_r ; <nl> + float peak_l = 0 ; <nl> + float peak_r = 0 ; <nl> <nl> - TextureProgress * vu_l ; <nl> - TextureProgress * vu_r ; <nl> + TextureProgress * vu_l = nullptr ; <nl> + TextureProgress * vu_r = nullptr ; <nl> } channel [ CHANNELS_MAX ] ; <nl> <nl> OptionButton * send ; <nl> class EditorAudioMeterNotches : public Control { <nl> <nl> private : <nl> struct AudioNotch { <nl> - float relative_position ; <nl> - float db_value ; <nl> - bool render_db_value ; <nl> + float relative_position = 0 ; <nl> + float db_value = 0 ; <nl> + bool render_db_value = false ; <nl> <nl> _FORCE_INLINE_ AudioNotch ( float r_pos , float db_v , bool rndr_val ) { <nl> relative_position = r_pos ; <nl> mmm a / editor / editor_autoload_settings . h <nl> ppp b / editor / editor_autoload_settings . h <nl> class EditorAutoloadSettings : public VBoxContainer { <nl> struct AutoLoadInfo { <nl> String name ; <nl> String path ; <nl> - bool is_singleton ; <nl> - bool in_editor ; <nl> - int order ; <nl> - Node * node ; <nl> + bool is_singleton = false ; <nl> + bool in_editor = false ; <nl> + int order = 0 ; <nl> + Node * node = nullptr ; <nl> <nl> bool operator = = ( const AutoLoadInfo & p_info ) const { <nl> return order = = p_info . order ; <nl> } <nl> - <nl> - AutoLoadInfo ( ) { <nl> - is_singleton = false ; <nl> - in_editor = false ; <nl> - node = nullptr ; <nl> - } <nl> } ; <nl> <nl> List < AutoLoadInfo > autoload_cache ; <nl> mmm a / editor / editor_data . h <nl> ppp b / editor / editor_data . h <nl> class EditorHistory { <nl> REF ref ; <nl> ObjectID object ; <nl> String property ; <nl> - bool inspector_only ; <nl> + bool inspector_only = false ; <nl> } ; <nl> <nl> struct History { <nl> Vector < Obj > path ; <nl> - int level ; <nl> + int level = 0 ; <nl> } ; <nl> friend class EditorData ; <nl> <nl> class EditorData { <nl> } ; <nl> <nl> struct EditedScene { <nl> - Node * root ; <nl> + Node * root = nullptr ; <nl> String path ; <nl> Dictionary editor_states ; <nl> List < Node * > selection ; <nl> Vector < EditorHistory : : History > history_stored ; <nl> - int history_current ; <nl> + int history_current = 0 ; <nl> Dictionary custom_state ; <nl> - uint64_t version ; <nl> + uint64_t version = 0 ; <nl> NodePath live_edit_root ; <nl> } ; <nl> <nl> mmm a / editor / editor_export . h <nl> ppp b / editor / editor_export . h <nl> class EditorExportPlatform : public Reference { <nl> <nl> private : <nl> struct SavedData { <nl> - uint64_t ofs ; <nl> - uint64_t size ; <nl> - bool encrypted ; <nl> + uint64_t ofs = 0 ; <nl> + uint64_t size = 0 ; <nl> + bool encrypted = false ; <nl> Vector < uint8_t > md5 ; <nl> CharString path_utf8 ; <nl> <nl> class EditorExportPlatform : public Reference { <nl> } ; <nl> <nl> struct PackData { <nl> - FileAccess * f ; <nl> + FileAccess * f = nullptr ; <nl> Vector < SavedData > file_ofs ; <nl> - EditorProgress * ep ; <nl> - Vector < SharedObject > * so_files ; <nl> + EditorProgress * ep = nullptr ; <nl> + Vector < SharedObject > * so_files = nullptr ; <nl> } ; <nl> <nl> struct ZipData { <nl> - void * zip ; <nl> - EditorProgress * ep ; <nl> + void * zip = nullptr ; <nl> + EditorProgress * ep = nullptr ; <nl> } ; <nl> <nl> struct FeatureContainers { <nl> class EditorExportPlugin : public Reference { <nl> struct ExtraFile { <nl> String path ; <nl> Vector < uint8_t > data ; <nl> - bool remap ; <nl> + bool remap = false ; <nl> } ; <nl> Vector < ExtraFile > extra_files ; <nl> bool skipped ; <nl> mmm a / editor / editor_file_system . h <nl> ppp b / editor / editor_file_system . h <nl> class EditorFileSystemDirectory : public Object { <nl> struct FileInfo { <nl> String file ; <nl> StringName type ; <nl> - uint64_t modified_time ; <nl> - uint64_t import_modified_time ; <nl> - bool import_valid ; <nl> + uint64_t modified_time = 0 ; <nl> + uint64_t import_modified_time = 0 ; <nl> + bool import_valid = false ; <nl> String import_group_file ; <nl> Vector < String > deps ; <nl> - bool verified ; / / used for checking changes <nl> + bool verified = false ; / / used for checking changes <nl> String script_class_name ; <nl> String script_class_extends ; <nl> String script_class_icon_path ; <nl> class EditorFileSystem : public Node { <nl> ACTION_FILE_RELOAD <nl> } ; <nl> <nl> - Action action ; <nl> - EditorFileSystemDirectory * dir ; <nl> + Action action = ACTION_NONE ; <nl> + EditorFileSystemDirectory * dir = nullptr ; <nl> String file ; <nl> - EditorFileSystemDirectory * new_dir ; <nl> - EditorFileSystemDirectory : : FileInfo * new_file ; <nl> - <nl> - ItemAction ( ) { <nl> - action = ACTION_NONE ; <nl> - dir = nullptr ; <nl> - new_dir = nullptr ; <nl> - new_file = nullptr ; <nl> - } <nl> + EditorFileSystemDirectory * new_dir = nullptr ; <nl> + EditorFileSystemDirectory : : FileInfo * new_file = nullptr ; <nl> } ; <nl> <nl> bool use_threads ; <nl> class EditorFileSystem : public Node { <nl> / * Used for reading the filesystem cache file * / <nl> struct FileCache { <nl> String type ; <nl> - uint64_t modification_time ; <nl> - uint64_t import_modification_time ; <nl> + uint64_t modification_time = 0 ; <nl> + uint64_t import_modification_time = 0 ; <nl> Vector < String > deps ; <nl> - bool import_valid ; <nl> + bool import_valid = false ; <nl> String import_group_file ; <nl> String script_class_name ; <nl> String script_class_extends ; <nl> class EditorFileSystem : public Node { <nl> HashMap < String , FileCache > file_cache ; <nl> <nl> struct ScanProgress { <nl> - float low ; <nl> - float hi ; <nl> - mutable EditorProgressBG * progress ; <nl> + float low = 0 ; <nl> + float hi = 0 ; <nl> + mutable EditorProgressBG * progress = nullptr ; <nl> void update ( int p_current , int p_total ) const ; <nl> ScanProgress get_sub ( int p_current , int p_total ) const ; <nl> } ; <nl> class EditorFileSystem : public Node { <nl> <nl> struct ImportFile { <nl> String path ; <nl> - int order ; <nl> + int order = 0 ; <nl> bool operator < ( const ImportFile & p_if ) const { <nl> return order < p_if . order ; <nl> } <nl> mmm a / editor / editor_help_search . h <nl> ppp b / editor / editor_help_search . h <nl> class EditorHelpSearch : : Runner : public Reference { <nl> <nl> struct ClassMatch { <nl> DocData : : ClassDoc * doc ; <nl> - bool name ; <nl> + bool name = false ; <nl> Vector < DocData : : MethodDoc * > methods ; <nl> Vector < DocData : : MethodDoc * > signals ; <nl> Vector < DocData : : ConstantDoc * > constants ; <nl> class EditorHelpSearch : : Runner : public Reference { <nl> Ref < Texture2D > empty_icon ; <nl> Color disabled_color ; <nl> <nl> - Map < String , DocData : : ClassDoc > : : Element * iterator_doc ; <nl> + Map < String , DocData : : ClassDoc > : : Element * iterator_doc = nullptr ; <nl> Map < String , ClassMatch > matches ; <nl> - Map < String , ClassMatch > : : Element * iterator_match ; <nl> - TreeItem * root_item ; <nl> + Map < String , ClassMatch > : : Element * iterator_match = nullptr ; <nl> + TreeItem * root_item = nullptr ; <nl> Map < String , TreeItem * > class_items ; <nl> - TreeItem * matched_item ; <nl> + TreeItem * matched_item = nullptr ; <nl> <nl> bool _is_class_disabled_by_feature_profile ( const StringName & p_class ) ; <nl> <nl> mmm a / editor / editor_inspector . cpp <nl> ppp b / editor / editor_inspector . cpp <nl> EditorProperty : : EditorProperty ( ) { <nl> selected_focusable = - 1 ; <nl> label_reference = nullptr ; <nl> bottom_editor = nullptr ; <nl> + delete_hover = false ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / editor / editor_inspector . h <nl> ppp b / editor / editor_inspector . h <nl> class EditorInspectorPlugin : public Reference { <nl> <nl> friend class EditorInspector ; <nl> struct AddedEditor { <nl> - Control * property_editor ; <nl> + Control * property_editor = nullptr ; <nl> Vector < String > properties ; <nl> String label ; <nl> } ; <nl> mmm a / editor / editor_node . h <nl> ppp b / editor / editor_node . h <nl> class EditorNode : public Node { <nl> String path ; <nl> List < String > args ; <nl> String output ; <nl> - Thread * execute_output_thread ; <nl> + Thread * execute_output_thread = nullptr ; <nl> Mutex execute_output_mutex ; <nl> - int exitcode ; <nl> - volatile bool done ; <nl> + int exitcode = 0 ; <nl> + volatile bool done = false ; <nl> } ; <nl> <nl> private : <nl> class EditorNode : public Node { <nl> <nl> struct BottomPanelItem { <nl> String name ; <nl> - Control * control ; <nl> - Button * button ; <nl> + Control * control = nullptr ; <nl> + Button * button = nullptr ; <nl> } ; <nl> <nl> Vector < BottomPanelItem > bottom_panel_items ; <nl> class EditorNode : public Node { <nl> struct ExportDefer { <nl> String preset ; <nl> String path ; <nl> - bool debug ; <nl> - bool pack_only ; <nl> + bool debug = false ; <nl> + bool pack_only = false ; <nl> } export_defer ; <nl> <nl> bool cmdline_export_mode ; <nl> mmm a / editor / editor_properties . h <nl> ppp b / editor / editor_properties . h <nl> <nl> <nl> class EditorPropertyNil : public EditorProperty { <nl> GDCLASS ( EditorPropertyNil , EditorProperty ) ; <nl> - LineEdit * text ; <nl> + LineEdit * text = nullptr ; <nl> <nl> public : <nl> virtual void update_property ( ) override ; <nl> mmm a / editor / editor_resource_preview . h <nl> ppp b / editor / editor_resource_preview . h <nl> class EditorResourcePreview : public Node { <nl> struct Item { <nl> Ref < Texture2D > preview ; <nl> Ref < Texture2D > small_preview ; <nl> - int order ; <nl> - uint32_t last_hash ; <nl> - uint64_t modified_time ; <nl> + int order = 0 ; <nl> + uint32_t last_hash = 0 ; <nl> + uint64_t modified_time = 0 ; <nl> } ; <nl> <nl> int order ; <nl> mmm a / editor / editor_sectioned_inspector . cpp <nl> ppp b / editor / editor_sectioned_inspector . cpp <nl> <nl> class SectionedInspectorFilter : public Object { <nl> GDCLASS ( SectionedInspectorFilter , Object ) ; <nl> <nl> - Object * edited ; <nl> + Object * edited = nullptr ; <nl> String section ; <nl> - bool allow_sub ; <nl> + bool allow_sub = false ; <nl> <nl> bool _set ( const StringName & p_name , const Variant & p_value ) { <nl> if ( ! edited ) { <nl> class SectionedInspectorFilter : public Object { <nl> edited = p_edited ; <nl> _change_notify ( ) ; <nl> } <nl> - <nl> - SectionedInspectorFilter ( ) { <nl> - edited = nullptr ; <nl> - } <nl> } ; <nl> <nl> void SectionedInspector : : _bind_methods ( ) { <nl> mmm a / editor / editor_settings . cpp <nl> ppp b / editor / editor_settings . cpp <nl> void EditorSettings : : _initial_set ( const StringName & p_name , const Variant & p_val <nl> <nl> struct _EVCSort { <nl> String name ; <nl> - Variant : : Type type ; <nl> - int order ; <nl> - bool save ; <nl> - bool restart_if_changed ; <nl> + Variant : : Type type = Variant : : Type : : NIL ; <nl> + int order = 0 ; <nl> + bool save = false ; <nl> + bool restart_if_changed = false ; <nl> <nl> bool operator < ( const _EVCSort & p_vcs ) const { return order < p_vcs . order ; } <nl> } ; <nl> Ref < Shortcut > ED_GET_SHORTCUT ( const String & p_path ) { <nl> } <nl> <nl> struct ShortcutMapping { <nl> - const char * path ; <nl> - uint32_t keycode ; <nl> + const char * path = nullptr ; <nl> + uint32_t keycode = 0 ; <nl> } ; <nl> <nl> Ref < Shortcut > ED_SHORTCUT ( const String & p_path , const String & p_name , uint32_t p_keycode ) { <nl> mmm a / editor / editor_settings . h <nl> ppp b / editor / editor_settings . h <nl> class EditorSettings : public Resource { <nl> <nl> public : <nl> struct Plugin { <nl> - EditorPlugin * instance ; <nl> + EditorPlugin * instance = nullptr ; <nl> String path ; <nl> String name ; <nl> String author ; <nl> String version ; <nl> String description ; <nl> - bool installs ; <nl> + bool installs = false ; <nl> String script ; <nl> Vector < String > install_files ; <nl> } ; <nl> mmm a / editor / fileserver / editor_file_server . h <nl> ppp b / editor / fileserver / editor_file_server . h <nl> class EditorFileServer : public Object { <nl> } ; <nl> <nl> struct ClientData { <nl> - Thread * thread ; <nl> + Thread * thread = nullptr ; <nl> Ref < StreamPeerTCP > connection ; <nl> Map < int , FileAccess * > files ; <nl> - EditorFileServer * efs ; <nl> - bool quit ; <nl> + EditorFileServer * efs = nullptr ; <nl> + bool quit = false ; <nl> } ; <nl> <nl> Ref < TCP_Server > server ; <nl> mmm a / editor / filesystem_dock . h <nl> ppp b / editor / filesystem_dock . h <nl> class FileSystemDock : public VBoxContainer { <nl> String path ; <nl> StringName type ; <nl> Vector < String > sources ; <nl> - bool import_broken ; <nl> - uint64_t modified_time ; <nl> + bool import_broken = false ; <nl> + uint64_t modified_time = 0 ; <nl> <nl> bool operator < ( const FileInfo & fi ) const { <nl> return NaturalNoCaseComparator ( ) ( name , fi . name ) ; <nl> mmm a / editor / find_in_files . cpp <nl> ppp b / editor / find_in_files . cpp <nl> static bool find_next ( const String & line , String pattern , int from , bool match_c <nl> } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - FindInFiles : : FindInFiles ( ) { <nl> - _searching = false ; <nl> - _whole_words = true ; <nl> - _match_case = true ; <nl> - } <nl> <nl> void FindInFiles : : set_search_text ( String p_pattern ) { <nl> _pattern = p_pattern ; <nl> mmm a / editor / find_in_files . h <nl> ppp b / editor / find_in_files . h <nl> class FindInFiles : public Node { <nl> static const char * SIGNAL_RESULT_FOUND ; <nl> static const char * SIGNAL_FINISHED ; <nl> <nl> - FindInFiles ( ) ; <nl> - <nl> void set_search_text ( String p_pattern ) ; <nl> void set_whole_words ( bool p_whole_word ) ; <nl> void set_match_case ( bool p_match_case ) ; <nl> class FindInFiles : public Node { <nl> String _pattern ; <nl> Set < String > _extension_filter ; <nl> String _root_dir ; <nl> - bool _whole_words ; <nl> - bool _match_case ; <nl> + bool _whole_words = true ; <nl> + bool _match_case = true ; <nl> <nl> / / State <nl> - bool _searching ; <nl> + bool _searching = false ; <nl> String _current_dir ; <nl> Vector < PackedStringArray > _folders_stack ; <nl> Vector < String > _files_to_scan ; <nl> - int _initial_files_count ; <nl> + int _initial_files_count = 0 ; <nl> } ; <nl> <nl> class LineEdit ; <nl> class FindInFilesPanel : public Control { <nl> void _on_replace_all_clicked ( ) ; <nl> <nl> struct Result { <nl> - int line_number ; <nl> - int begin ; <nl> - int end ; <nl> - int begin_trimmed ; <nl> + int line_number = 0 ; <nl> + int begin = 0 ; <nl> + int end = 0 ; <nl> + int begin_trimmed = 0 ; <nl> } ; <nl> <nl> void apply_replaces_in_file ( String fpath , const Vector < Result > & locations , String new_text ) ; <nl> mmm a / editor / import / collada . h <nl> ppp b / editor / import / collada . h <nl> class Collada { <nl> String name ; <nl> struct Source { <nl> Vector < float > array ; <nl> - int stride ; <nl> + int stride = 0 ; <nl> } ; <nl> <nl> Map < String , Source > sources ; <nl> class Collada { <nl> struct Primitives { <nl> struct SourceRef { <nl> String source ; <nl> - int offset ; <nl> + int offset = 0 ; <nl> } ; <nl> <nl> String material ; <nl> Map < String , SourceRef > sources ; <nl> Vector < float > polygons ; <nl> Vector < float > indices ; <nl> - int count ; <nl> - int vertex_size ; <nl> + int count = 0 ; <nl> + int vertex_size = 0 ; <nl> } ; <nl> <nl> Vector < Primitives > primitives ; <nl> class Collada { <nl> struct Source { <nl> Vector < String > sarray ; <nl> Vector < float > array ; <nl> - int stride ; <nl> + int stride = 0 ; <nl> } ; <nl> <nl> Map < String , Source > sources ; <nl> class Collada { <nl> struct Weights { <nl> struct SourceRef { <nl> String source ; <nl> - int offset ; <nl> + int offset = 0 ; <nl> } ; <nl> <nl> String material ; <nl> Map < String , SourceRef > sources ; <nl> Vector < float > sets ; <nl> Vector < float > indices ; <nl> - int count ; <nl> + int count = 0 ; <nl> } weights ; <nl> <nl> Map < String , Transform > bone_rest_map ; <nl> class Collada { <nl> Color color ; <nl> int uid = 0 ; <nl> struct Weight { <nl> - int bone_idx ; <nl> - float weight ; <nl> + int bone_idx = 0 ; <nl> + float weight = 0 ; <nl> bool operator < ( const Weight w ) const { return weight > w . weight ; } / / heaviest first <nl> } ; <nl> <nl> class Collada { <nl> } ; <nl> <nl> String id ; <nl> - Op op ; <nl> + Op op = OP_ROTATE ; <nl> Vector < float > data ; <nl> } ; <nl> <nl> class Collada { <nl> } ; <nl> <nl> struct NodeGeometry : public Node { <nl> - bool controller ; <nl> + bool controller = false ; <nl> String source ; <nl> <nl> struct Material { <nl> class Collada { <nl> TYPE_MATRIX <nl> } ; <nl> <nl> - float time ; <nl> + float time = 0 ; <nl> Vector < float > data ; <nl> Point2 in_tangent ; <nl> Point2 out_tangent ; <nl> class Collada { <nl> <nl> float unit_scale = 1 . 0 ; <nl> Vector3 : : Axis up_axis = Vector3 : : AXIS_Y ; <nl> - bool z_up ; <nl> + bool z_up = false ; <nl> <nl> struct Version { <nl> - int major , minor , rev ; <nl> + int major = 0 , minor = 0 , rev = 0 ; <nl> <nl> bool operator < ( const Version & p_ver ) const { return ( major = = p_ver . major ) ? ( ( minor = = p_ver . minor ) ? ( rev < p_ver . rev ) : minor < p_ver . minor ) : major < p_ver . major ; } <nl> Version ( int p_major = 0 , int p_minor = 0 , int p_rev = 0 ) { <nl> mmm a / editor / import / editor_import_collada . cpp <nl> ppp b / editor / import / editor_import_collada . cpp <nl> <nl> <nl> struct ColladaImport { <nl> Collada collada ; <nl> - Node3D * scene ; <nl> + Node3D * scene = nullptr ; <nl> <nl> Vector < Ref < Animation > > animations ; <nl> <nl> struct NodeMap { <nl> / / String path ; <nl> - Node3D * node ; <nl> - int bone ; <nl> + Node3D * node = nullptr ; <nl> + int bone = - 1 ; <nl> List < int > anim_tracks ; <nl> - <nl> - NodeMap ( ) { <nl> - node = nullptr ; <nl> - bone = - 1 ; <nl> - } <nl> } ; <nl> <nl> - bool found_ambient ; <nl> + bool found_ambient = false ; <nl> Color ambient ; <nl> - bool found_directional ; <nl> - bool force_make_tangents ; <nl> - bool apply_mesh_xform_to_vertices ; <nl> - bool use_mesh_builtin_materials ; <nl> - float bake_fps ; <nl> + bool found_directional = false ; <nl> + bool force_make_tangents = false ; <nl> + bool apply_mesh_xform_to_vertices = true ; <nl> + bool use_mesh_builtin_materials = false ; <nl> + float bake_fps = 15 ; <nl> <nl> Map < String , NodeMap > node_map ; / / map from collada node to engine node <nl> Map < String , String > node_name_map ; / / map from collada node to engine node <nl> struct ColladaImport { <nl> Vector < String > missing_textures ; <nl> <nl> void _pre_process_lights ( Collada : : Node * p_node ) ; <nl> - <nl> - ColladaImport ( ) { <nl> - found_ambient = false ; <nl> - found_directional = false ; <nl> - force_make_tangents = false ; <nl> - apply_mesh_xform_to_vertices = true ; <nl> - bake_fps = 15 ; <nl> - } <nl> } ; <nl> <nl> Error ColladaImport : : _populate_skeleton ( Skeleton3D * p_skeleton , Collada : : Node * p_node , int & r_bone , int p_parent ) { <nl> mmm a / editor / import / editor_scene_importer_gltf . h <nl> ppp b / editor / import / editor_scene_importer_gltf . h <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> GLTFNodeIndex fake_joint_parent = - 1 ; <nl> <nl> GLTFLightIndex light = - 1 ; <nl> - <nl> - GLTFNode ( ) { } <nl> } ; <nl> <nl> struct GLTFBufferView { <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> int byte_stride = 0 ; <nl> bool indices = false ; <nl> / / matrices need to be transformed to this <nl> - <nl> - GLTFBufferView ( ) { } <nl> } ; <nl> <nl> struct GLTFAccessor { <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> int component_type = 0 ; <nl> bool normalized = false ; <nl> int count = 0 ; <nl> - GLTFType type ; <nl> + GLTFType type = GLTFType : : TYPE_SCALAR ; <nl> float min = 0 ; <nl> float max = 0 ; <nl> int sparse_count = 0 ; <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> int sparse_indices_component_type = 0 ; <nl> int sparse_values_buffer_view = 0 ; <nl> int sparse_values_byte_offset = 0 ; <nl> - <nl> - GLTFAccessor ( ) { } <nl> } ; <nl> struct GLTFTexture { <nl> GLTFImageIndex src_image ; <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> <nl> / / Set of unique bone names for the skeleton <nl> Set < String > unique_names ; <nl> - <nl> - GLTFSkeleton ( ) { } <nl> } ; <nl> <nl> struct GLTFSkin { <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> / / The Actual Skin that will be created as a mapping between the IBM ' s of this skin <nl> / / to the generated skeleton for the mesh instances . <nl> Ref < Skin > godot_skin ; <nl> - <nl> - GLTFSkin ( ) { } <nl> } ; <nl> <nl> struct GLTFMesh { <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> float fov_size = 64 ; <nl> float zfar = 500 ; <nl> float znear = 0 . 1 ; <nl> - <nl> - GLTFCamera ( ) { } <nl> } ; <nl> <nl> struct GLTFLight { <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> float range = Math_INF ; <nl> float inner_cone_angle = 0 . 0f ; <nl> float outer_cone_angle = Math_PI / 4 . 0 ; <nl> - <nl> - GLTFLight ( ) { } <nl> } ; <nl> <nl> struct GLTFAnimation { <nl> class EditorSceneImporterGLTF : public EditorSceneImporter { <nl> <nl> struct GLTFState { <nl> Dictionary json ; <nl> - int major_version ; <nl> - int minor_version ; <nl> + int major_version = 0 ; <nl> + int minor_version = 0 ; <nl> Vector < uint8_t > glb_data ; <nl> <nl> - bool use_named_skin_binds ; <nl> + bool use_named_skin_binds = false ; <nl> <nl> Vector < GLTFNode * > nodes ; <nl> Vector < Vector < uint8_t > > buffers ; <nl> mmm a / editor / import / resource_importer_texture . h <nl> ppp b / editor / import / resource_importer_texture . h <nl> class ResourceImporterTexture : public ResourceImporter { <nl> <nl> Mutex mutex ; <nl> struct MakeInfo { <nl> - int flags ; <nl> + int flags = 0 ; <nl> String normal_path_for_roughness ; <nl> - RS : : TextureDetectRoughnessChannel channel_for_roughness ; <nl> - MakeInfo ( ) { <nl> - flags = 0 ; <nl> - channel_for_roughness = RS : : TEXTURE_DETECT_ROUGNHESS_R ; <nl> - } <nl> + RS : : TextureDetectRoughnessChannel channel_for_roughness = RS : : TEXTURE_DETECT_ROUGNHESS_R ; <nl> } ; <nl> <nl> Map < StringName , MakeInfo > make_flags ; <nl> mmm a / editor / import / resource_importer_texture_atlas . h <nl> ppp b / editor / import / resource_importer_texture_atlas . h <nl> class ResourceImporterTextureAtlas : public ResourceImporter { <nl> <nl> struct PackData { <nl> Rect2 region ; <nl> - bool is_mesh ; <nl> + bool is_mesh = false ; <nl> Vector < int > chart_pieces ; / / one for region , many for mesh <nl> Vector < Vector < Vector2 > > chart_vertices ; / / for mesh <nl> Ref < Image > image ; <nl> mmm a / editor / multi_node_edit . h <nl> ppp b / editor / multi_node_edit . h <nl> class MultiNodeEdit : public Reference { <nl> <nl> List < NodePath > nodes ; <nl> struct PLData { <nl> - int uses ; <nl> + int uses = 0 ; <nl> PropertyInfo info ; <nl> } ; <nl> <nl> mmm a / editor / plugins / animation_player_editor_plugin . h <nl> ppp b / editor / plugins / animation_player_editor_plugin . h <nl> class AnimationPlayerEditor : public VBoxContainer { <nl> int current_option ; <nl> <nl> struct BlendEditor { <nl> - AcceptDialog * dialog ; <nl> - Tree * tree ; <nl> - OptionButton * next ; <nl> + AcceptDialog * dialog = nullptr ; <nl> + Tree * tree = nullptr ; <nl> + OptionButton * next = nullptr ; <nl> <nl> } blend_editor ; <nl> <nl> class AnimationPlayerEditor : public VBoxContainer { <nl> / / Onion skinning . <nl> struct { <nl> / / Settings . <nl> - bool enabled ; <nl> - bool past ; <nl> - bool future ; <nl> - int steps ; <nl> - bool differences_only ; <nl> - bool force_white_modulate ; <nl> - bool include_gizmos ; <nl> + bool enabled = false ; <nl> + bool past = false ; <nl> + bool future = false ; <nl> + int steps = 0 ; <nl> + bool differences_only = false ; <nl> + bool force_white_modulate = false ; <nl> + bool include_gizmos = false ; <nl> <nl> int get_needed_capture_count ( ) const { <nl> / / ' Differences only ' needs a capture of the present . <nl> class AnimationPlayerEditor : public VBoxContainer { <nl> } <nl> <nl> / / Rendering . <nl> - int64_t last_frame ; <nl> - int can_overlay ; <nl> + int64_t last_frame = 0 ; <nl> + int can_overlay = 0 ; <nl> Size2 capture_size ; <nl> Vector < RID > captures ; <nl> Vector < bool > captures_valid ; <nl> mmm a / editor / plugins / animation_state_machine_editor . h <nl> ppp b / editor / plugins / animation_state_machine_editor . h <nl> class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { <nl> Vector2 to ; <nl> AnimationNodeStateMachineTransition : : SwitchMode mode ; <nl> StringName advance_condition_name ; <nl> - bool advance_condition_state ; <nl> - bool disabled ; <nl> - bool auto_advance ; <nl> - float width ; <nl> + bool advance_condition_state = false ; <nl> + bool disabled = false ; <nl> + bool auto_advance = false ; <nl> + float width = 0 ; <nl> } ; <nl> <nl> Vector < TransitionLine > transition_lines ; <nl> mmm a / editor / plugins / asset_library_editor_plugin . h <nl> ppp b / editor / plugins / asset_library_editor_plugin . h <nl> class EditorAssetLibraryItemDescription : public ConfirmationDialog { <nl> PanelContainer * previews_bg ; <nl> <nl> struct Preview { <nl> - int id ; <nl> - bool is_video ; <nl> + int id = 0 ; <nl> + bool is_video = false ; <nl> String video_link ; <nl> - Button * button ; <nl> + Button * button = nullptr ; <nl> Ref < Texture2D > image ; <nl> } ; <nl> <nl> class EditorAssetLibrary : public PanelContainer { <nl> } ; <nl> <nl> struct ImageQueue { <nl> - bool active ; <nl> - int queue_id ; <nl> - ImageType image_type ; <nl> - int image_index ; <nl> + bool active = false ; <nl> + int queue_id = 0 ; <nl> + ImageType image_type = ImageType : : IMAGE_QUEUE_ICON ; <nl> + int image_index = 0 ; <nl> String image_url ; <nl> - HTTPRequest * request ; <nl> + HTTPRequest * request = nullptr ; <nl> ObjectID target ; <nl> } ; <nl> <nl> mmm a / editor / plugins / canvas_item_editor_plugin . h <nl> ppp b / editor / plugins / canvas_item_editor_plugin . h <nl> class CanvasItemEditor : public VBoxContainer { <nl> MenuOption last_option ; <nl> <nl> struct _SelectResult { <nl> - CanvasItem * item ; <nl> - float z_index ; <nl> - bool has_z ; <nl> + CanvasItem * item = nullptr ; <nl> + float z_index = 0 ; <nl> + bool has_z = true ; <nl> _FORCE_INLINE_ bool operator < ( const _SelectResult & p_rr ) const { <nl> return has_z & & p_rr . has_z ? p_rr . z_index < z_index : p_rr . has_z ; <nl> } <nl> class CanvasItemEditor : public VBoxContainer { <nl> Transform2D xform ; <nl> float length = 0 . f ; <nl> uint64_t last_pass = 0 ; <nl> - <nl> - BoneList ( ) { } <nl> } ; <nl> <nl> uint64_t bone_last_frame ; <nl> class CanvasItemEditor : public VBoxContainer { <nl> struct PoseClipboard { <nl> Vector2 pos ; <nl> Vector2 scale ; <nl> - float rot ; <nl> + float rot = 0 ; <nl> ObjectID id ; <nl> } ; <nl> List < PoseClipboard > pose_clipboard ; <nl> mmm a / editor / plugins / collision_shape_2d_editor_plugin . cpp <nl> ppp b / editor / plugins / collision_shape_2d_editor_plugin . cpp <nl> CollisionShape2DEditor : : CollisionShape2DEditor ( EditorNode * p_editor ) { <nl> <nl> edit_handle = - 1 ; <nl> pressed = false ; <nl> + <nl> + shape_type = 0 ; <nl> } <nl> <nl> void CollisionShape2DEditorPlugin : : edit ( Object * p_obj ) { <nl> mmm a / editor / plugins / editor_preview_plugins . h <nl> ppp b / editor / plugins / editor_preview_plugins . h <nl> class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator { <nl> RID light2 ; <nl> RID light_instance2 ; <nl> RID camera ; <nl> - mutable volatile bool preview_done ; <nl> + mutable volatile bool preview_done = false ; <nl> <nl> void _preview_done ( const Variant & p_udata ) ; <nl> <nl> class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator { <nl> RID light2 ; <nl> RID light_instance2 ; <nl> RID camera ; <nl> - mutable volatile bool preview_done ; <nl> + mutable volatile bool preview_done = false ; <nl> <nl> void _preview_done ( const Variant & p_udata ) ; <nl> <nl> class EditorFontPreviewPlugin : public EditorResourcePreviewGenerator { <nl> RID viewport_texture ; <nl> RID canvas ; <nl> RID canvas_item ; <nl> - mutable volatile bool preview_done ; <nl> + mutable volatile bool preview_done = false ; <nl> <nl> void _preview_done ( const Variant & p_udata ) ; <nl> <nl> mmm a / editor / plugins / mesh_library_editor_plugin . cpp <nl> ppp b / editor / plugins / mesh_library_editor_plugin . cpp <nl> MeshLibraryEditorPlugin : : MeshLibraryEditorPlugin ( EditorNode * p_node ) { <nl> mesh_library_editor - > set_anchors_and_margins_preset ( Control : : PRESET_TOP_WIDE ) ; <nl> mesh_library_editor - > set_end ( Point2 ( 0 , 22 ) ) ; <nl> mesh_library_editor - > hide ( ) ; <nl> + <nl> + editor = nullptr ; <nl> } <nl> mmm a / editor / plugins / node_3d_editor_plugin . h <nl> ppp b / editor / plugins / node_3d_editor_plugin . h <nl> class EditorNode3DGizmo : public Node3DGizmo { <nl> Ref < Material > material ; <nl> Ref < SkinReference > skin_reference ; <nl> RID skeleton ; <nl> - bool billboard ; <nl> - bool unscaled ; <nl> - bool can_intersect ; <nl> - bool extra_margin ; <nl> - Instance ( ) { <nl> - billboard = false ; <nl> - unscaled = false ; <nl> - can_intersect = false ; <nl> - extra_margin = false ; <nl> - } <nl> + bool billboard = false ; <nl> + bool unscaled = false ; <nl> + bool can_intersect = false ; <nl> + bool extra_margin = false ; <nl> <nl> void create_instance ( Node3D * p_base , bool p_hidden = false ) ; <nl> } ; <nl> class EditorNode3DGizmo : public Node3DGizmo { <nl> <nl> struct Handle { <nl> Vector3 pos ; <nl> - bool billboard ; <nl> + bool billboard = false ; <nl> } ; <nl> <nl> Vector < Vector3 > handles ; <nl> class Node3DEditorViewport : public Control { <nl> Label * fps_label ; <nl> <nl> struct _RayResult { <nl> - Node3D * item ; <nl> - float depth ; <nl> - int handle ; <nl> + Node3D * item = nullptr ; <nl> + float depth = 0 ; <nl> + int handle = 0 ; <nl> _FORCE_INLINE_ bool operator < ( const _RayResult & p_rr ) const { return depth < p_rr . depth ; } <nl> } ; <nl> <nl> class Node3DEditorViewport : public Control { <nl> Vector3 click_ray_pos ; <nl> Vector3 center ; <nl> Vector3 orig_gizmo_pos ; <nl> - int edited_gizmo ; <nl> + int edited_gizmo = 0 ; <nl> Point2 mouse_pos ; <nl> - bool snap ; <nl> + bool snap = false ; <nl> Ref < EditorNode3DGizmo > gizmo ; <nl> - int gizmo_handle ; <nl> + int gizmo_handle = 0 ; <nl> Variant gizmo_initial_value ; <nl> Vector3 gizmo_initial_pos ; <nl> } _edit ; <nl> class Node3DEditor : public VBoxContainer { <nl> AABB preview_bounds ; <nl> <nl> struct Gizmo { <nl> - bool visible ; <nl> - float scale ; <nl> + bool visible = false ; <nl> + float scale = 0 ; <nl> Transform transform ; <nl> } gizmo ; <nl> <nl> mmm a / editor / plugins / path_3d_editor_plugin . cpp <nl> ppp b / editor / plugins / path_3d_editor_plugin . cpp <nl> void Path3DGizmo : : redraw ( ) { <nl> Path3DGizmo : : Path3DGizmo ( Path3D * p_path ) { <nl> path = p_path ; <nl> set_spatial_node ( p_path ) ; <nl> + orig_in_length = 0 ; <nl> + orig_out_length = 0 ; <nl> } <nl> <nl> bool Path3DEditorPlugin : : forward_spatial_gui_input ( Camera3D * p_camera , const Ref < InputEvent > & p_event ) { <nl> mmm a / editor / plugins / script_editor_plugin . cpp <nl> ppp b / editor / plugins / script_editor_plugin . cpp <nl> static bool _is_built_in_script ( Script * p_script ) { <nl> <nl> class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache { <nl> struct Cache { <nl> - uint64_t time_loaded ; <nl> + uint64_t time_loaded = 0 ; <nl> RES cache ; <nl> } ; <nl> <nl> Map < String , Cache > cached ; <nl> <nl> public : <nl> - uint64_t max_time_cache ; <nl> - int max_cache_size ; <nl> + uint64_t max_time_cache = 5 * 60 * 1000 ; / / minutes , five <nl> + int max_cache_size = 128 ; <nl> <nl> void cleanup ( ) { <nl> List < Map < String , Cache > : : Element * > to_clean ; <nl> class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache { <nl> return E - > get ( ) . cache ; <nl> } <nl> <nl> - EditorScriptCodeCompletionCache ( ) { <nl> - max_cache_size = 128 ; <nl> - max_time_cache = 5 * 60 * 1000 ; / / minutes , five <nl> - } <nl> - <nl> virtual ~ EditorScriptCodeCompletionCache ( ) { } <nl> } ; <nl> <nl> struct _ScriptEditorItemData { <nl> String name ; <nl> String sort_key ; <nl> Ref < Texture2D > icon ; <nl> - int index ; <nl> + int index = 0 ; <nl> String tooltip ; <nl> - bool used ; <nl> - int category ; <nl> - Node * ref ; <nl> + bool used = false ; <nl> + int category = 0 ; <nl> + Node * ref = nullptr ; <nl> <nl> bool operator < ( const _ScriptEditorItemData & id ) const { <nl> if ( category = = id . category ) { <nl> mmm a / editor / plugins / script_editor_plugin . h <nl> ppp b / editor / plugins / script_editor_plugin . h <nl> class ScriptEditor : public PanelContainer { <nl> Vector < Ref < EditorSyntaxHighlighter > > syntax_highlighters ; <nl> <nl> struct ScriptHistory { <nl> - Control * control ; <nl> + Control * control = nullptr ; <nl> Variant state ; <nl> } ; <nl> <nl> mmm a / editor / plugins / shader_editor_plugin . cpp <nl> ppp b / editor / plugins / shader_editor_plugin . cpp <nl> ShaderEditorPlugin : : ShaderEditorPlugin ( EditorNode * p_node ) { <nl> shader_editor - > set_custom_minimum_size ( Size2 ( 0 , 300 ) * EDSCALE ) ; <nl> button = editor - > add_bottom_panel_item ( TTR ( " Shader " ) , shader_editor ) ; <nl> button - > hide ( ) ; <nl> + <nl> + _2d = false ; <nl> } <nl> <nl> ShaderEditorPlugin : : ~ ShaderEditorPlugin ( ) { <nl> mmm a / editor / plugins / skeleton_3d_editor_plugin . cpp <nl> ppp b / editor / plugins / skeleton_3d_editor_plugin . cpp <nl> void BoneTransformEditor : : _update_transform_properties ( Transform tform ) { <nl> } <nl> <nl> BoneTransformEditor : : BoneTransformEditor ( Skeleton3D * p_skeleton ) : <nl> - skeleton ( p_skeleton ) , <nl> - key_button ( nullptr ) , <nl> - enabled_checkbox ( nullptr ) , <nl> - keyable ( false ) , <nl> - toggle_enabled ( false ) , <nl> - updating ( false ) { <nl> + skeleton ( p_skeleton ) { <nl> undo_redo = EditorNode : : get_undo_redo ( ) ; <nl> } <nl> <nl> mmm a / editor / plugins / skeleton_3d_editor_plugin . h <nl> ppp b / editor / plugins / skeleton_3d_editor_plugin . h <nl> class EditorPropertyVector3 ; <nl> class BoneTransformEditor : public VBoxContainer { <nl> GDCLASS ( BoneTransformEditor , VBoxContainer ) ; <nl> <nl> - EditorInspectorSection * section ; <nl> + EditorInspectorSection * section = nullptr ; <nl> <nl> - EditorPropertyVector3 * translation_property ; <nl> - EditorPropertyVector3 * rotation_property ; <nl> - EditorPropertyVector3 * scale_property ; <nl> - EditorInspectorSection * transform_section ; <nl> - EditorPropertyTransform * transform_property ; <nl> + EditorPropertyVector3 * translation_property = nullptr ; <nl> + EditorPropertyVector3 * rotation_property = nullptr ; <nl> + EditorPropertyVector3 * scale_property = nullptr ; <nl> + EditorInspectorSection * transform_section = nullptr ; <nl> + EditorPropertyTransform * transform_property = nullptr ; <nl> <nl> Rect2 background_rects [ 5 ] ; <nl> <nl> class BoneTransformEditor : public VBoxContainer { <nl> <nl> UndoRedo * undo_redo ; <nl> <nl> - Button * key_button ; <nl> - CheckBox * enabled_checkbox ; <nl> + Button * key_button = nullptr ; <nl> + CheckBox * enabled_checkbox = nullptr ; <nl> <nl> - bool keyable ; <nl> - bool toggle_enabled ; <nl> - bool updating ; <nl> + bool keyable = false ; <nl> + bool toggle_enabled = false ; <nl> + bool updating = false ; <nl> <nl> String label ; <nl> <nl> class Skeleton3DEditor : public VBoxContainer { <nl> struct BoneInfo { <nl> PhysicalBone3D * physical_bone = nullptr ; <nl> Transform relative_rest ; / / Relative to skeleton node <nl> - BoneInfo ( ) { } <nl> } ; <nl> <nl> EditorNode * editor ; <nl> class Skeleton3DEditor : public VBoxContainer { <nl> <nl> Skeleton3D * skeleton ; <nl> <nl> - Tree * joint_tree ; <nl> - BoneTransformEditor * rest_editor ; <nl> - BoneTransformEditor * pose_editor ; <nl> - BoneTransformEditor * custom_pose_editor ; <nl> + Tree * joint_tree = nullptr ; <nl> + BoneTransformEditor * rest_editor = nullptr ; <nl> + BoneTransformEditor * pose_editor = nullptr ; <nl> + BoneTransformEditor * custom_pose_editor = nullptr ; <nl> <nl> - MenuButton * options ; <nl> - EditorFileDialog * file_dialog ; <nl> + MenuButton * options = nullptr ; <nl> + EditorFileDialog * file_dialog = nullptr ; <nl> <nl> - UndoRedo * undo_redo ; <nl> + UndoRedo * undo_redo = nullptr ; <nl> <nl> void _on_click_option ( int p_option ) ; <nl> void _file_selected ( const String & p_file ) ; <nl> <nl> - EditorFileDialog * file_export_lib ; <nl> + EditorFileDialog * file_export_lib = nullptr ; <nl> <nl> void update_joint_tree ( ) ; <nl> void update_editors ( ) ; <nl> mmm a / editor / plugins / tile_map_editor_plugin . cpp <nl> ppp b / editor / plugins / tile_map_editor_plugin . cpp <nl> void TileMapEditor : : _sbox_input ( const Ref < InputEvent > & p_ie ) { <nl> / / In modern C + + this could have been inside its body . <nl> namespace { <nl> struct _PaletteEntry { <nl> - int id ; <nl> + int id = 0 ; <nl> String name ; <nl> <nl> bool operator < ( const _PaletteEntry & p_rhs ) const { <nl> mmm a / editor / plugins / tile_map_editor_plugin . h <nl> ppp b / editor / plugins / tile_map_editor_plugin . h <nl> class TileMapEditor : public VBoxContainer { <nl> bool yf = false ; <nl> bool tr = false ; <nl> Vector2 ac ; <nl> - <nl> - CellOp ( ) { } <nl> } ; <nl> <nl> Map < Point2i , CellOp > paint_undo ; <nl> class TileMapEditor : public VBoxContainer { <nl> bool flip_v = false ; <nl> bool transpose = false ; <nl> Point2i autotile_coord ; <nl> - <nl> - TileData ( ) { } <nl> } ; <nl> <nl> List < TileData > copydata ; <nl> mmm a / editor / plugins / visual_shader_editor_plugin . cpp <nl> ppp b / editor / plugins / visual_shader_editor_plugin . cpp <nl> <nl> <nl> struct FloatConstantDef { <nl> String name ; <nl> - float value ; <nl> + float value = 0 ; <nl> String desc ; <nl> } ; <nl> <nl> void VisualShaderNodePortPreview : : _notification ( int p_what ) { <nl> void VisualShaderNodePortPreview : : _bind_methods ( ) { <nl> } <nl> <nl> - VisualShaderNodePortPreview : : VisualShaderNodePortPreview ( ) { <nl> - } <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> String VisualShaderConversionPlugin : : converts_to ( ) const { <nl> mmm a / editor / plugins / visual_shader_editor_plugin . h <nl> ppp b / editor / plugins / visual_shader_editor_plugin . h <nl> class VisualShaderGraphPlugin : public Reference { <nl> <nl> private : <nl> struct InputPort { <nl> - Button * default_input_button ; <nl> + Button * default_input_button = nullptr ; <nl> } ; <nl> <nl> struct Port { <nl> - TextureButton * preview_button ; <nl> + TextureButton * preview_button = nullptr ; <nl> } ; <nl> <nl> struct Link { <nl> - VisualShader : : Type type ; <nl> - VisualShaderNode * visual_node ; <nl> - GraphNode * graph_node ; <nl> - bool preview_visible ; <nl> - int preview_pos ; <nl> + VisualShader : : Type type = VisualShader : : Type : : TYPE_MAX ; <nl> + VisualShaderNode * visual_node = nullptr ; <nl> + GraphNode * graph_node = nullptr ; <nl> + bool preview_visible = 0 ; <nl> + int preview_pos = 0 ; <nl> Map < int , InputPort > input_ports ; <nl> Map < int , Port > output_ports ; <nl> - VBoxContainer * preview_box ; <nl> - LineEdit * uniform_name ; <nl> - OptionButton * const_op ; <nl> - CodeEdit * expression_edit ; <nl> - CurveEditor * curve_editor ; <nl> + VBoxContainer * preview_box = nullptr ; <nl> + LineEdit * uniform_name = nullptr ; <nl> + OptionButton * const_op = nullptr ; <nl> + CodeEdit * expression_edit = nullptr ; <nl> + CurveEditor * curve_editor = nullptr ; <nl> } ; <nl> <nl> Ref < VisualShader > visual_shader ; <nl> class VisualShaderEditor : public VBoxContainer { <nl> String category ; <nl> String type ; <nl> String description ; <nl> - int sub_func ; <nl> + int sub_func = 0 ; <nl> String sub_func_str ; <nl> Ref < Script > script ; <nl> - int mode ; <nl> - int return_type ; <nl> - int func ; <nl> - float value ; <nl> - bool highend ; <nl> - bool is_custom ; <nl> - int temp_idx ; <nl> + int mode = 0 ; <nl> + int return_type = 0 ; <nl> + int func = 0 ; <nl> + float value = 0 ; <nl> + bool highend = false ; <nl> + bool is_custom = false ; <nl> + int temp_idx = 0 ; <nl> <nl> AddOption ( const String & p_name = String ( ) , const String & p_category = String ( ) , const String & p_sub_category = String ( ) , const String & p_type = String ( ) , const String & p_description = String ( ) , int p_sub_func = - 1 , int p_return_type = - 1 , int p_mode = - 1 , int p_func = - 1 , float p_value = - 1 , bool p_highend = false ) { <nl> name = p_name ; <nl> class VisualShaderEditor : public VBoxContainer { <nl> static VisualShaderEditor * singleton ; <nl> <nl> struct DragOp { <nl> - VisualShader : : Type type ; <nl> - int node ; <nl> + VisualShader : : Type type = VisualShader : : Type : : TYPE_MAX ; <nl> + int node = 0 ; <nl> Vector2 from ; <nl> Vector2 to ; <nl> } ; <nl> class EditorInspectorShaderModePlugin : public EditorInspectorPlugin { <nl> class VisualShaderNodePortPreview : public Control { <nl> GDCLASS ( VisualShaderNodePortPreview , Control ) ; <nl> Ref < VisualShader > shader ; <nl> - VisualShader : : Type type ; <nl> - int node ; <nl> - int port ; <nl> + VisualShader : : Type type = VisualShader : : Type : : TYPE_MAX ; <nl> + int node = 0 ; <nl> + int port = 0 ; <nl> void _shader_changed ( ) ; / / must regen <nl> protected : <nl> void _notification ( int p_what ) ; <nl> class VisualShaderNodePortPreview : public Control { <nl> public : <nl> virtual Size2 get_minimum_size ( ) const override ; <nl> void setup ( const Ref < VisualShader > & p_shader , VisualShader : : Type p_type , int p_node , int p_port ) ; <nl> - VisualShaderNodePortPreview ( ) ; <nl> } ; <nl> <nl> class VisualShaderConversionPlugin : public EditorResourceConversionPlugin { <nl> mmm a / editor / progress_dialog . h <nl> ppp b / editor / progress_dialog . h <nl> class BackgroundProgress : public HBoxContainer { <nl> _THREAD_SAFE_CLASS_ <nl> <nl> struct Task { <nl> - HBoxContainer * hb ; <nl> - ProgressBar * progress ; <nl> + HBoxContainer * hb = nullptr ; <nl> + ProgressBar * progress = nullptr ; <nl> } ; <nl> <nl> Map < String , Task > tasks ; <nl> class ProgressDialog : public PopupPanel { <nl> GDCLASS ( ProgressDialog , PopupPanel ) ; <nl> struct Task { <nl> String task ; <nl> - VBoxContainer * vb ; <nl> - ProgressBar * progress ; <nl> - Label * state ; <nl> + VBoxContainer * vb = nullptr ; <nl> + ProgressBar * progress = nullptr ; <nl> + Label * state = nullptr ; <nl> } ; <nl> HBoxContainer * cancel_hb ; <nl> Button * cancel ; <nl> mmm a / editor / project_manager . cpp <nl> ppp b / editor / project_manager . cpp <nl> class ProjectList : public ScrollContainer { <nl> String path ; <nl> String icon ; <nl> String main_scene ; <nl> - uint64_t last_edited ; <nl> - bool favorite ; <nl> - bool grayed ; <nl> - bool missing ; <nl> - int version ; <nl> + uint64_t last_edited = 0 ; <nl> + bool favorite = false ; <nl> + bool grayed = false ; <nl> + bool missing = false ; <nl> + int version = 0 ; <nl> <nl> - ProjectListItemControl * control ; <nl> + ProjectListItemControl * control = nullptr ; <nl> <nl> Item ( ) { } <nl> <nl> class ProjectList : public ScrollContainer { <nl> } ; <nl> <nl> struct ProjectListComparator { <nl> - FilterOption order_option ; <nl> + FilterOption order_option = FilterOption : : EDIT_DATE ; <nl> <nl> / / operator < <nl> _FORCE_INLINE_ bool operator ( ) ( const ProjectList : : Item & a , const ProjectList : : Item & b ) const { <nl> mmm a / editor / quick_open . h <nl> ppp b / editor / quick_open . h <nl> class EditorQuickOpen : public ConfirmationDialog { <nl> <nl> struct Entry { <nl> String path ; <nl> - float score ; <nl> + float score = 0 ; <nl> } ; <nl> <nl> struct EntryComparator { <nl> mmm a / editor / script_create_dialog . h <nl> ppp b / editor / script_create_dialog . h <nl> class ScriptCreateDialog : public ConfirmationDialog { <nl> SCRIPT_ORIGIN_EDITOR , <nl> } ; <nl> struct ScriptTemplateInfo { <nl> - int id ; <nl> - ScriptOrigin origin ; <nl> + int id = 0 ; <nl> + ScriptOrigin origin = ScriptOrigin : : SCRIPT_ORIGIN_EDITOR ; <nl> String dir ; <nl> String name ; <nl> String extension ; <nl> mmm a / modules / gdscript / editor / gdscript_highlighter . h <nl> ppp b / modules / gdscript / editor / gdscript_highlighter . h <nl> class GDScriptSyntaxHighlighter : public EditorSyntaxHighlighter { <nl> Color color ; <nl> String start_key ; <nl> String end_key ; <nl> - bool line_only ; <nl> + bool line_only = false ; <nl> } ; <nl> Vector < ColorRegion > color_regions ; <nl> Map < int , int > color_region_cache ; <nl> mmm a / modules / mono / editor / bindings_generator . h <nl> ppp b / modules / mono / editor / bindings_generator . h <nl> class BindingsGenerator { <nl> struct ConstantInterface { <nl> String name ; <nl> String proxy_name ; <nl> - int value ; <nl> + int value = 0 ; <nl> const DocData : : ConstantDoc * const_doc ; <nl> <nl> ConstantInterface ( ) { } <nl> class BindingsGenerator { <nl> struct PropertyInterface { <nl> StringName cname ; <nl> String proxy_name ; <nl> - int index ; <nl> + int index = 0 ; <nl> <nl> StringName setter ; <nl> StringName getter ; <nl> class BindingsGenerator { <nl> String im_type_out ; / / Return type for the C # method declaration . Also used as companion of [ unique_siq ] <nl> String im_sig ; / / Signature for the C # method declaration <nl> String unique_sig ; / / Unique signature to avoid duplicates in containers <nl> - bool editor_only ; <nl> + bool editor_only = false ; <nl> <nl> InternalCall ( ) { } <nl> <nl> mmm a / modules / mono / editor / godotsharp_export . cpp <nl> ppp b / modules / mono / editor / godotsharp_export . cpp <nl> MonoAssemblyName * new_mono_assembly_name ( ) { <nl> <nl> struct AssemblyRefInfo { <nl> String name ; <nl> - uint16_t major ; <nl> - uint16_t minor ; <nl> - uint16_t build ; <nl> - uint16_t revision ; <nl> + uint16_t major = 0 ; <nl> + uint16_t minor = 0 ; <nl> + uint16_t build = 0 ; <nl> + uint16_t revision = 0 ; <nl> } ; <nl> <nl> AssemblyRefInfo get_assemblyref_name ( MonoImage * p_image , int index ) { <nl> mmm a / modules / mono / editor / script_class_parser . h <nl> ppp b / modules / mono / editor / script_class_parser . h <nl> class ScriptClassParser { <nl> } ; <nl> <nl> String name ; <nl> - Type type ; <nl> + Type type = NAMESPACE_DECL ; <nl> } ; <nl> <nl> struct ClassDecl { <nl> String name ; <nl> String namespace_ ; <nl> Vector < String > base ; <nl> - bool nested ; <nl> + bool nested = false ; <nl> } ; <nl> <nl> private : <nl> String code ; <nl> - int idx ; <nl> - int line ; <nl> + int idx = 0 ; <nl> + int line = 0 ; <nl> String error_str ; <nl> - bool error ; <nl> + bool error = false ; <nl> Variant value ; <nl> <nl> Vector < ClassDecl > classes ; <nl> mmm a / platform / android / android_keys_utils . h <nl> ppp b / platform / android / android_keys_utils . h <nl> <nl> # include < core / os / keyboard . h > <nl> <nl> struct _WinTranslatePair { <nl> - unsigned int keysym ; <nl> - unsigned int keycode ; <nl> + unsigned int keysym = 0 ; <nl> + unsigned int keycode = 0 ; <nl> } ; <nl> <nl> static _WinTranslatePair _ak_to_keycode [ ] = { <nl> mmm a / platform / android / api / java_class_wrapper . h <nl> ppp b / platform / android / api / java_class_wrapper . h <nl> class JavaClass : public Reference { <nl> Map < StringName , Variant > constant_map ; <nl> <nl> struct MethodInfo { <nl> - bool _static ; <nl> + bool _static = false ; <nl> Vector < uint32_t > param_types ; <nl> Vector < StringName > param_sigs ; <nl> - uint32_t return_type ; <nl> + uint32_t return_type = 0 ; <nl> jmethodID method ; <nl> } ; <nl> <nl> mmm a / platform / android / audio_driver_opensl . cpp <nl> ppp b / platform / android / audio_driver_opensl . cpp <nl> void AudioDriverOpenSL : : set_pause ( bool p_pause ) { <nl> <nl> AudioDriverOpenSL : : AudioDriverOpenSL ( ) { <nl> s_ad = this ; <nl> - pause = false ; <nl> - active = false ; <nl> } <nl> mmm a / platform / android / audio_driver_opensl . h <nl> ppp b / platform / android / audio_driver_opensl . h <nl> <nl> # include < SLES / OpenSLES_Android . h > <nl> <nl> class AudioDriverOpenSL : public AudioDriver { <nl> - bool active ; <nl> + bool active = false ; <nl> Mutex mutex ; <nl> <nl> enum { <nl> BUFFER_COUNT = 2 <nl> } ; <nl> <nl> - bool pause ; <nl> + bool pause = false ; <nl> <nl> - uint32_t buffer_size ; <nl> - int16_t * buffers [ BUFFER_COUNT ] ; <nl> - int32_t * mixdown_buffer ; <nl> - int last_free ; <nl> + uint32_t buffer_size = 0 ; <nl> + int16_t * buffers [ BUFFER_COUNT ] = { } ; <nl> + int32_t * mixdown_buffer = nullptr ; <nl> + int last_free = 0 ; <nl> <nl> Vector < int16_t > rec_buffer ; <nl> <nl> mmm a / platform / android / display_server_android . h <nl> ppp b / platform / android / display_server_android . h <nl> class RenderingDeviceVulkan ; <nl> class DisplayServerAndroid : public DisplayServer { <nl> public : <nl> struct TouchPos { <nl> - int id ; <nl> + int id = 0 ; <nl> Point2 pos ; <nl> } ; <nl> <nl> class DisplayServerAndroid : public DisplayServer { <nl> } ; <nl> <nl> struct JoypadEvent { <nl> - int device ; <nl> - int type ; <nl> - int index ; <nl> - bool pressed ; <nl> - float value ; <nl> - int hat ; <nl> + int device = 0 ; <nl> + int type = 0 ; <nl> + int index = 0 ; <nl> + bool pressed = false ; <nl> + float value = 0 ; <nl> + int hat = 0 ; <nl> } ; <nl> <nl> private : <nl> mmm a / platform / android / export / export . cpp <nl> ppp b / platform / android / export / export . cpp <nl> static const char * SPLASH_BG_COLOR_PATH = " res / drawable / splash_bg_color . png " ; <nl> <nl> struct LauncherIcon { <nl> const char * export_path ; <nl> - int dimensions ; <nl> + int dimensions = 0 ; <nl> } ; <nl> <nl> static const int icon_densities_count = 6 ; <nl> class EditorExportPlatformAndroid : public EditorExportPlatform { <nl> String id ; <nl> String name ; <nl> String description ; <nl> - int api_level ; <nl> + int api_level = 0 ; <nl> } ; <nl> <nl> struct APKExportData { <nl> zipFile apk ; <nl> - EditorProgress * ep ; <nl> + EditorProgress * ep = nullptr ; <nl> } ; <nl> <nl> Vector < PluginConfig > plugins ; <nl> mmm a / platform / android / file_access_android . cpp <nl> ppp b / platform / android / file_access_android . cpp <nl> bool FileAccessAndroid : : file_exists ( const String & p_path ) { <nl> return true ; <nl> } <nl> <nl> - FileAccessAndroid : : FileAccessAndroid ( ) { <nl> - a = nullptr ; <nl> - eof = false ; <nl> - } <nl> - <nl> FileAccessAndroid : : ~ FileAccessAndroid ( ) { <nl> close ( ) ; <nl> } <nl> mmm a / platform / android / file_access_android . h <nl> ppp b / platform / android / file_access_android . h <nl> <nl> <nl> class FileAccessAndroid : public FileAccess { <nl> static FileAccess * create_android ( ) ; <nl> - mutable AAsset * a ; <nl> - mutable size_t len ; <nl> - mutable size_t pos ; <nl> - mutable bool eof ; <nl> + mutable AAsset * a = nullptr ; <nl> + mutable size_t len = 0 ; <nl> + mutable size_t pos = 0 ; <nl> + mutable bool eof = false ; <nl> <nl> public : <nl> static AAssetManager * asset_manager ; <nl> class FileAccessAndroid : public FileAccess { <nl> <nl> / / static void make_default ( ) ; <nl> <nl> - FileAccessAndroid ( ) ; <nl> ~ FileAccessAndroid ( ) ; <nl> } ; <nl> <nl> mmm a / platform / android / os_android . cpp <nl> ppp b / platform / android / os_android . cpp <nl> OS_Android : : OS_Android ( GodotJavaWrapper * p_godot_java , GodotIOJavaWrapper * p_god <nl> # if defined ( OPENGL_ENABLED ) <nl> gl_extensions = nullptr ; <nl> use_gl2 = false ; <nl> + use_16bits_fbo = false ; <nl> # endif <nl> <nl> # if defined ( VULKAN_ENABLED ) <nl> mmm a / platform / iphone / export / export . cpp <nl> ppp b / platform / iphone / export / export . cpp <nl> class EditorExportPlatformIOS : public EditorExportPlatform { <nl> <nl> struct IOSExportAsset { <nl> String exported_path ; <nl> - bool is_framework ; / / framework is anything linked to the binary , otherwise it ' s a resource <nl> - bool should_embed ; <nl> + bool is_framework = false ; / / framework is anything linked to the binary , otherwise it ' s a resource <nl> + bool should_embed = false ; <nl> } ; <nl> <nl> String _get_additional_plist_content ( ) ; <nl> Vector < EditorExportPlatformIOS : : ExportArchitecture > EditorExportPlatformIOS : : _ge <nl> struct LoadingScreenInfo { <nl> const char * preset_key ; <nl> const char * export_name ; <nl> - int width ; <nl> - int height ; <nl> - bool rotate ; <nl> + int width = 0 ; <nl> + int height = 0 ; <nl> + bool rotate = false ; <nl> } ; <nl> <nl> static const LoadingScreenInfo loading_screen_infos [ ] = { <nl> struct IconInfo { <nl> const char * actual_size_side ; <nl> const char * scale ; <nl> const char * unscaled_size ; <nl> - bool is_required ; <nl> + bool is_required = false ; <nl> } ; <nl> <nl> static const IconInfo icon_infos [ ] = { <nl> Error EditorExportPlatformIOS : : _walk_dir_recursive ( DirAccess * p_da , FileHandler <nl> <nl> struct CodesignData { <nl> const Ref < EditorExportPreset > & preset ; <nl> - bool debug ; <nl> + bool debug = false ; <nl> <nl> CodesignData ( const Ref < EditorExportPreset > & p_preset , bool p_debug ) : <nl> preset ( p_preset ) , <nl> mmm a / platform / linuxbsd / detect_prime_x11 . cpp <nl> ppp b / platform / linuxbsd / detect_prime_x11 . cpp <nl> typedef GLXContext ( * GLXCREATECONTEXTATTRIBSARBPROC ) ( Display * , GLXFBConfig , GLX <nl> <nl> struct vendor { <nl> const char * glxvendor ; <nl> - int priority ; <nl> + int priority = 0 ; <nl> } ; <nl> <nl> vendor vendormap [ ] = { <nl> mmm a / platform / linuxbsd / display_server_x11 . h <nl> ppp b / platform / linuxbsd / display_server_x11 . h <nl> <nl> <nl> / / Hints for X11 fullscreen <nl> typedef struct { <nl> - unsigned long flags ; <nl> - unsigned long functions ; <nl> - unsigned long decorations ; <nl> - long inputMode ; <nl> - unsigned long status ; <nl> + unsigned long flags = 0 ; <nl> + unsigned long functions = 0 ; <nl> + unsigned long decorations = 0 ; <nl> + long inputMode = 0 ; <nl> + unsigned long status = 0 ; <nl> } Hints ; <nl> <nl> typedef struct _xrr_monitor_info { <nl> Atom name ; <nl> - Bool primary ; <nl> - Bool automatic ; <nl> - int noutput ; <nl> - int x ; <nl> - int y ; <nl> - int width ; <nl> - int height ; <nl> - int mwidth ; <nl> - int mheight ; <nl> - RROutput * outputs ; <nl> + Bool primary = false ; <nl> + Bool automatic = false ; <nl> + int noutput = 0 ; <nl> + int x = 0 ; <nl> + int y = 0 ; <nl> + int width = 0 ; <nl> + int height = 0 ; <nl> + int mwidth = 0 ; <nl> + int mheight = 0 ; <nl> + RROutput * outputs = nullptr ; <nl> } xrr_monitor_info ; <nl> <nl> # undef CursorShape <nl> mmm a / platform / linuxbsd / joypad_linux . cpp <nl> ppp b / platform / linuxbsd / joypad_linux . cpp <nl> <nl> static const char * ignore_str = " / dev / input / js " ; <nl> # endif <nl> <nl> - JoypadLinux : : Joypad : : Joypad ( ) { <nl> - fd = - 1 ; <nl> - dpad = 0 ; <nl> - devpath = " " ; <nl> - for ( int i = 0 ; i < MAX_ABS ; i + + ) { <nl> - abs_info [ i ] = nullptr ; <nl> - } <nl> - } <nl> - <nl> JoypadLinux : : Joypad : : ~ Joypad ( ) { <nl> for ( int i = 0 ; i < MAX_ABS ; i + + ) { <nl> if ( abs_info [ i ] ) { <nl> mmm a / platform / linuxbsd / joypad_linux . h <nl> ppp b / platform / linuxbsd / joypad_linux . h <nl> class JoypadLinux { <nl> Input : : JoyAxis curr_axis [ MAX_ABS ] ; <nl> int key_map [ MAX_KEY ] ; <nl> int abs_map [ MAX_ABS ] ; <nl> - int dpad ; <nl> - int fd ; <nl> + int dpad = 0 ; <nl> + int fd = - 1 ; <nl> <nl> String devpath ; <nl> - input_absinfo * abs_info [ MAX_ABS ] ; <nl> + input_absinfo * abs_info [ MAX_ABS ] = { } ; <nl> <nl> - bool force_feedback ; <nl> - int ff_effect_id ; <nl> - uint64_t ff_effect_timestamp ; <nl> + bool force_feedback = false ; <nl> + int ff_effect_id = 0 ; <nl> + uint64_t ff_effect_timestamp = 0 ; <nl> <nl> - Joypad ( ) ; <nl> ~ Joypad ( ) ; <nl> void reset ( ) ; <nl> } ; <nl> mmm a / platform / osx / display_server_osx . h <nl> ppp b / platform / osx / display_server_osx . h <nl> class DisplayServerOSX : public DisplayServer { <nl> <nl> struct KeyEvent { <nl> WindowID window_id ; <nl> - unsigned int osx_state ; <nl> - bool pressed ; <nl> - bool echo ; <nl> - bool raw ; <nl> - uint32_t keycode ; <nl> - uint32_t physical_keycode ; <nl> - uint32_t unicode ; <nl> + unsigned int osx_state = false ; <nl> + bool pressed = false ; <nl> + bool echo = false ; <nl> + bool raw = false ; <nl> + uint32_t keycode = 0 ; <nl> + uint32_t physical_keycode = 0 ; <nl> + uint32_t unicode = 0 ; <nl> } ; <nl> <nl> struct WarpEvent { <nl> mmm a / platform / osx / export / export . cpp <nl> ppp b / platform / osx / export / export . cpp <nl> <nl> class EditorExportPlatformOSX : public EditorExportPlatform { <nl> GDCLASS ( EditorExportPlatformOSX , EditorExportPlatform ) ; <nl> <nl> - int version_code ; <nl> + int version_code = 0 ; <nl> <nl> Ref < ImageTexture > logo ; <nl> <nl> mmm a / platform / osx / joypad_osx . cpp <nl> ppp b / platform / osx / joypad_osx . cpp <nl> <nl> static JoypadOSX * self = nullptr ; <nl> <nl> joypad : : joypad ( ) { <nl> - device_ref = nullptr ; <nl> - ff_device = nullptr ; <nl> - ff_axes = nullptr ; <nl> - ff_directions = nullptr ; <nl> - ffservice = 0 ; <nl> - ff_timestamp = 0 ; <nl> - id = 0 ; <nl> - <nl> ff_constant_force . lMagnitude = 10000 ; <nl> ff_effect . dwDuration = 0 ; <nl> ff_effect . dwSamplePeriod = 0 ; <nl> mmm a / platform / osx / joypad_osx . h <nl> ppp b / platform / osx / joypad_osx . h <nl> struct rec_element { <nl> IOHIDElementRef ref ; <nl> IOHIDElementCookie cookie ; <nl> <nl> - uint32_t usage ; <nl> + uint32_t usage = 0 ; <nl> <nl> - int min ; <nl> - int max ; <nl> + int min = 0 ; <nl> + int max = 0 ; <nl> <nl> struct Comparator { <nl> bool operator ( ) ( const rec_element p_a , const rec_element p_b ) const { return p_a . usage < p_b . usage ; } <nl> struct rec_element { <nl> } ; <nl> <nl> struct joypad { <nl> - IOHIDDeviceRef device_ref ; <nl> + IOHIDDeviceRef device_ref = nullptr ; <nl> <nl> Vector < rec_element > axis_elements ; <nl> Vector < rec_element > button_elements ; <nl> Vector < rec_element > hat_elements ; <nl> <nl> - int id ; <nl> + int id = 0 ; <nl> <nl> - io_service_t ffservice ; / * Interface for force feedback , 0 = no ff * / <nl> + io_service_t ffservice = 0 ; / * Interface for force feedback , 0 = no ff * / <nl> FFCONSTANTFORCE ff_constant_force ; <nl> FFDeviceObjectReference ff_device ; <nl> FFEffectObjectReference ff_object ; <nl> - uint64_t ff_timestamp ; <nl> - LONG * ff_directions ; <nl> + uint64_t ff_timestamp = 0 ; <nl> + LONG * ff_directions = nullptr ; <nl> FFEFFECT ff_effect ; <nl> - DWORD * ff_axes ; <nl> + DWORD * ff_axes = nullptr ; <nl> <nl> void add_hid_elements ( CFArrayRef p_array ) ; <nl> void add_hid_element ( IOHIDElementRef p_element ) ; <nl> mmm a / platform / server / os_server . h <nl> ppp b / platform / server / os_server . h <nl> <nl> # undef CursorShape <nl> <nl> class OS_Server : public OS_Unix { <nl> - RenderingServer * rendering_server ; <nl> + RenderingServer * rendering_server = nullptr ; <nl> VideoMode current_videomode ; <nl> List < String > args ; <nl> - MainLoop * main_loop ; <nl> + MainLoop * main_loop = nullptr ; <nl> <nl> - bool grab ; <nl> + bool grab = false ; <nl> <nl> virtual void delete_main_loop ( ) ; <nl> <nl> - bool force_quit ; <nl> + bool force_quit = false ; <nl> <nl> - InputDefault * input ; <nl> + InputDefault * input = nullptr ; <nl> <nl> CrashHandler crash_handler ; <nl> <nl> - int video_driver_index ; <nl> + int video_driver_index = 0 ; <nl> <nl> Ref < ResourceFormatDummyTexture > resource_loader_dummy ; <nl> <nl> mmm a / platform / uwp / context_egl_uwp . cpp <nl> ppp b / platform / uwp / context_egl_uwp . cpp <nl> ContextEGL_UWP : : ContextEGL_UWP ( CoreWindow ^ p_window , Driver p_driver ) : <nl> mEglContext ( EGL_NO_CONTEXT ) , <nl> mEglSurface ( EGL_NO_SURFACE ) , <nl> driver ( p_driver ) , <nl> - window ( p_window ) { } <nl> + window ( p_window ) , <nl> + vsync ( false ) { } <nl> <nl> ContextEGL_UWP : : ~ ContextEGL_UWP ( ) { <nl> cleanup ( ) ; <nl> mmm a / platform / uwp / export / export . cpp <nl> ppp b / platform / uwp / export / export . cpp <nl> class AppxPackager { <nl> <nl> struct BlockHash { <nl> String base64_hash ; <nl> - size_t compressed_size ; <nl> + size_t compressed_size = 0 ; <nl> } ; <nl> <nl> struct FileMeta { <nl> class AppxPackager { <nl> Vector < BlockHash > hashes ; <nl> uLong file_crc32 = 0 ; <nl> ZPOS64_T zip_offset = 0 ; <nl> - <nl> - FileMeta ( ) { } <nl> } ; <nl> <nl> String progress_task ; <nl> - FileAccess * package ; <nl> + FileAccess * package = nullptr ; <nl> <nl> Set < String > mime_types ; <nl> <nl> mmm a / platform / uwp / joypad_uwp . h <nl> ppp b / platform / uwp / joypad_uwp . h <nl> ref class JoypadUWP sealed { <nl> struct ControllerDevice { <nl> Windows : : Gaming : : Input : : IGameController ^ controller_reference ; <nl> <nl> - int id ; <nl> - bool connected ; <nl> - ControllerType type ; <nl> - float ff_timestamp ; <nl> - float ff_end_timestamp ; <nl> - bool vibrating ; <nl> - <nl> - ControllerDevice ( ) { <nl> - id = - 1 ; <nl> - connected = false ; <nl> - type = ControllerType : : GAMEPAD_CONTROLLER ; <nl> - ff_timestamp = 0 . 0f ; <nl> - ff_end_timestamp = 0 . 0f ; <nl> - vibrating = false ; <nl> - } <nl> + int id = - 1 ; <nl> + bool connected = false ; <nl> + ControllerType type = ControllerType : : GAMEPAD_CONTROLLER ; <nl> + float ff_timestamp = 0 ; <nl> + float ff_end_timestamp = 0 ; <nl> + bool vibrating = false ; <nl> } ; <nl> <nl> ControllerDevice controllers [ MAX_CONTROLLERS ] ; <nl> mmm a / platform / uwp / os_uwp . h <nl> ppp b / platform / uwp / os_uwp . h <nl> class OS_UWP : public OS { <nl> CHAR_EVENT_MESSAGE <nl> } ; <nl> <nl> - bool alt , shift , control ; <nl> - MessageType type ; <nl> - bool pressed ; <nl> - unsigned int keycode ; <nl> - unsigned int physical_keycode ; <nl> - unsigned int unicode ; <nl> - bool echo ; <nl> + bool alt = false , shift = false , control = false ; <nl> + MessageType type = KEY_EVENT_MESSAGE ; <nl> + bool pressed = false ; <nl> + unsigned int keycode = 0 ; <nl> + unsigned int physical_keycode = 0 ; <nl> + unsigned int unicode = 0 ; <nl> + bool echo = false ; <nl> CorePhysicalKeyStatus status ; <nl> } ; <nl> <nl> mmm a / platform / windows / context_gl_windows . cpp <nl> ppp b / platform / windows / context_gl_windows . cpp <nl> ContextGL_Windows : : ContextGL_Windows ( HWND hwnd , bool p_opengl_3_context ) { <nl> hWnd = hwnd ; <nl> use_vsync = false ; <nl> vsync_via_compositor = false ; <nl> + pixel_format = 0 ; <nl> } <nl> <nl> ContextGL_Windows : : ~ ContextGL_Windows ( ) { <nl> mmm a / platform / windows / crash_handler_windows . cpp <nl> ppp b / platform / windows / crash_handler_windows . cpp <nl> <nl> struct module_data { <nl> std : : string image_name ; <nl> std : : string module_name ; <nl> - void * base_address ; <nl> + void * base_address = nullptr ; <nl> DWORD load_size ; <nl> } ; <nl> <nl> mmm a / platform / windows / joypad_windows . h <nl> ppp b / platform / windows / joypad_windows . h <nl> class JoypadWindows { <nl> } ; <nl> <nl> struct xinput_gamepad { <nl> - int id ; <nl> - bool attached ; <nl> - bool vibrating ; <nl> - DWORD last_packet ; <nl> + int id = 0 ; <nl> + bool attached = false ; <nl> + bool vibrating = false ; <nl> + DWORD last_packet = 0 ; <nl> XINPUT_STATE state ; <nl> - uint64_t ff_timestamp ; <nl> - uint64_t ff_end_timestamp ; <nl> - <nl> - xinput_gamepad ( ) { <nl> - attached = false ; <nl> - vibrating = false ; <nl> - ff_timestamp = 0 ; <nl> - ff_end_timestamp = 0 ; <nl> - last_packet = 0 ; <nl> - } <nl> + uint64_t ff_timestamp = 0 ; <nl> + uint64_t ff_end_timestamp = 0 ; <nl> } ; <nl> <nl> typedef DWORD ( WINAPI * XInputGetState_t ) ( DWORD dwUserIndex , XINPUT_STATE * pState ) ; <nl> mmm a / platform / windows / os_windows . cpp <nl> ppp b / platform / windows / os_windows . cpp <nl> void OS_Windows : : set_current_tablet_driver ( const String & p_driver ) { <nl> } <nl> <nl> OS_Windows : : OS_Windows ( HINSTANCE _hInstance ) { <nl> + ticks_per_second = 0 ; <nl> + ticks_start = 0 ; <nl> + main_loop = nullptr ; <nl> + process_map = nullptr ; <nl> + <nl> / / Note : Wacom WinTab driver API for pen input , for devices incompatible with Windows Ink . <nl> HMODULE wintab_lib = LoadLibraryW ( L " wintab32 . dll " ) ; <nl> if ( wintab_lib ) { <nl>
|
Initialize class / struct variables with default values in platform / and editor /
|
godotengine/godot
|
e1811b689b6854668ca690831df8603820b68573
|
2020-12-02T15:09:11Z
|
mmm a / test / functional / p2p_sendheaders . py <nl> ppp b / test / functional / p2p_sendheaders . py <nl> def test_nonnull_locators ( self , test_node , inv_node ) : <nl> test_node . clear_block_announcements ( ) # since we requested headers . . . <nl> elif i = = 2 : <nl> # this time announce own block via headers <nl> + inv_node . clear_block_announcements ( ) <nl> height = self . nodes [ 0 ] . getblockcount ( ) <nl> last_time = self . nodes [ 0 ] . getblock ( self . nodes [ 0 ] . getbestblockhash ( ) ) [ ' time ' ] <nl> block_time = last_time + 1 <nl> def test_nonnull_locators ( self , test_node , inv_node ) : <nl> test_node . wait_for_getdata ( [ new_block . sha256 ] ) <nl> test_node . send_message ( msg_block ( new_block ) ) <nl> test_node . sync_with_ping ( ) # make sure this block is processed <nl> + wait_until ( lambda : inv_node . block_announced , timeout = 60 , lock = mininode_lock ) <nl> inv_node . clear_block_announcements ( ) <nl> test_node . clear_block_announcements ( ) <nl> <nl>
|
Merge : [ tests ] Fix p2p_sendheaders race
|
bitcoin/bitcoin
|
686e97a0c7358291d628213447cf33e99cde7ce8
|
2018-07-01T09:09:11Z
|
mmm a / dbms / src / Formats / CSVRowInputStream . cpp <nl> ppp b / dbms / src / Formats / CSVRowInputStream . cpp <nl> static inline void skipWhitespacesAndTabs ( ReadBuffer & buf ) <nl> } <nl> <nl> <nl> - static void skipRow ( ReadBuffer & istr , const FormatSettings : : CSV & csv , size_t num_columns ) <nl> + static void skipRow ( ReadBuffer & istr , const FormatSettings : : CSV & settings , size_t num_columns ) <nl> { <nl> String tmp ; <nl> for ( size_t i = 0 ; i < num_columns ; + + i ) <nl> { <nl> skipWhitespacesAndTabs ( istr ) ; <nl> - readCSVString ( tmp , istr , csv ) ; <nl> + readCSVString ( tmp , istr , settings ) ; <nl> skipWhitespacesAndTabs ( istr ) ; <nl> <nl> - skipDelimiter ( istr , csv . delimiter , i + 1 = = num_columns ) ; <nl> + skipDelimiter ( istr , settings . delimiter , i + 1 = = num_columns ) ; <nl> } <nl> } <nl> <nl> mmm a / dbms / src / Formats / FormatFactory . cpp <nl> ppp b / dbms / src / Formats / FormatFactory . cpp <nl> BlockInputStreamPtr FormatFactory : : getInput ( const String & name , ReadBuffer & bu <nl> <nl> FormatSettings format_settings ; <nl> format_settings . csv . delimiter = settings . format_csv_delimiter ; <nl> - format_settings . csv . single_quote = settings . format_csv_single_quote ; <nl> - format_settings . csv . double_quote = settings . format_csv_double_quote ; <nl> + format_settings . csv . allow_single_quotes = settings . format_csv_allow_single_quotes ; <nl> + format_settings . csv . allow_double_quotes = settings . format_csv_allow_double_quotes ; <nl> format_settings . values . interpret_expressions = settings . input_format_values_interpret_expressions ; <nl> format_settings . skip_unknown_fields = settings . input_format_skip_unknown_fields ; <nl> format_settings . date_time_input_format = settings . date_time_input_format ; <nl> BlockOutputStreamPtr FormatFactory : : getOutput ( const String & name , WriteBuffer & <nl> format_settings . json . quote_64bit_integers = settings . output_format_json_quote_64bit_integers ; <nl> format_settings . json . quote_denormals = settings . output_format_json_quote_denormals ; <nl> format_settings . csv . delimiter = settings . format_csv_delimiter ; <nl> - format_settings . csv . single_quote = settings . format_csv_single_quote ; <nl> - format_settings . csv . double_quote = settings . format_csv_double_quote ; <nl> + format_settings . csv . allow_single_quotes = settings . format_csv_allow_single_quotes ; <nl> + format_settings . csv . allow_double_quotes = settings . format_csv_allow_double_quotes ; <nl> format_settings . pretty . max_rows = settings . output_format_pretty_max_rows ; <nl> format_settings . pretty . color = settings . output_format_pretty_color ; <nl> format_settings . write_statistics = settings . output_format_write_statistics ; <nl> mmm a / dbms / src / Formats / FormatSettings . h <nl> ppp b / dbms / src / Formats / FormatSettings . h <nl> struct FormatSettings <nl> struct CSV <nl> { <nl> char delimiter = ' , ' ; <nl> - bool single_quote = true ; <nl> - bool double_quote = true ; <nl> + bool allow_single_quotes = true ; <nl> + bool allow_double_quotes = true ; <nl> } ; <nl> <nl> CSV csv ; <nl> mmm a / dbms / src / IO / ReadHelpers . cpp <nl> ppp b / dbms / src / IO / ReadHelpers . cpp <nl> void readBackQuotedStringWithSQLStyle ( String & s , ReadBuffer & buf ) <nl> <nl> <nl> template < typename Vector > <nl> - void readCSVStringInto ( Vector & s , ReadBuffer & buf , const FormatSettings : : CSV & csv ) <nl> + void readCSVStringInto ( Vector & s , ReadBuffer & buf , const FormatSettings : : CSV & settings ) <nl> { <nl> if ( buf . eof ( ) ) <nl> throwReadAfterEOF ( ) ; <nl> void readCSVStringInto ( Vector & s , ReadBuffer & buf , const FormatSettings : : CSV & <nl> if ( maybe_quote = = delimiter ) <nl> return ; <nl> <nl> - if ( ( csv . single_quote & & maybe_quote = = ' \ ' ' ) | | ( csv . double_quote & & maybe_quote = = ' " ' ) ) <nl> + if ( ( csv . allow_single_quotes & & maybe_quote = = ' \ ' ' ) | | ( csv . allow_double_quotes & & maybe_quote = = ' " ' ) ) <nl> { <nl> + + buf . position ( ) ; <nl> <nl> void readCSVStringInto ( Vector & s , ReadBuffer & buf , const FormatSettings : : CSV & <nl> } <nl> } <nl> <nl> - void readCSVString ( String & s , ReadBuffer & buf , const FormatSettings : : CSV & csv ) <nl> + void readCSVString ( String & s , ReadBuffer & buf , const FormatSettings : : CSV & settings ) <nl> { <nl> s . clear ( ) ; <nl> - readCSVStringInto ( s , buf , csv ) ; <nl> + readCSVStringInto ( s , buf , settings ) ; <nl> } <nl> <nl> - template void readCSVStringInto < PaddedPODArray < UInt8 > > ( PaddedPODArray < UInt8 > & s , ReadBuffer & buf , const FormatSettings : : CSV & csv ) ; <nl> + template void readCSVStringInto < PaddedPODArray < UInt8 > > ( PaddedPODArray < UInt8 > & s , ReadBuffer & buf , const FormatSettings : : CSV & settings ) ; <nl> <nl> <nl> template < typename Vector , typename ReturnType > <nl> mmm a / dbms / src / IO / ReadHelpers . h <nl> ppp b / dbms / src / IO / ReadHelpers . h <nl> void readStringUntilEOF ( String & s , ReadBuffer & buf ) ; <nl> <nl> / * * Read string in CSV format . <nl> * Parsing rules : <nl> - * - string could be placed in quotes ; quotes could be single : ' if FormatSettings : : CSV : : single_quote is true <nl> - * or double : " if FormatSettings : : CSV : : double_quote is true ; <nl> + * - string could be placed in quotes ; quotes could be single : ' if FormatSettings : : CSV : : allow_single_quotes is true <nl> + * or double : " if FormatSettings : : CSV : : allow_double_quotes is true ; <nl> * - or string could be unquoted - this is determined by first character ; <nl> * - if string is unquoted , then it is read until next delimiter , <nl> * either until end of line ( CR or LF ) , <nl> void readStringUntilEOF ( String & s , ReadBuffer & buf ) ; <nl> * - if string is in quotes , then it will be read until closing quote , <nl> * but sequences of two consecutive quotes are parsed as single quote inside string ; <nl> * / <nl> - void readCSVString ( String & s , ReadBuffer & buf , const FormatSettings : : CSV & csv ) ; <nl> + void readCSVString ( String & s , ReadBuffer & buf , const FormatSettings : : CSV & settings ) ; <nl> <nl> <nl> / / / Read and append result to array of characters . <nl> template < typename Vector > <nl> void readStringUntilEOFInto ( Vector & s , ReadBuffer & buf ) ; <nl> <nl> template < typename Vector > <nl> - void readCSVStringInto ( Vector & s , ReadBuffer & buf , const FormatSettings : : CSV & csv ) ; <nl> + void readCSVStringInto ( Vector & s , ReadBuffer & buf , const FormatSettings : : CSV & settings ) ; <nl> <nl> / / / ReturnType is either bool or void . If bool , the function will return false instead of throwing an exception . <nl> template < typename Vector , typename ReturnType = void > <nl> template < typename T > <nl> inline std : : enable_if_t < std : : is_arithmetic_v < T > , void > <nl> readCSV ( T & x , ReadBuffer & buf ) { readCSVSimple ( x , buf ) ; } <nl> <nl> - inline void readCSV ( String & x , ReadBuffer & buf , const FormatSettings : : CSV & csv ) { readCSVString ( x , buf , csv ) ; } <nl> + inline void readCSV ( String & x , ReadBuffer & buf , const FormatSettings : : CSV & settings ) { readCSVString ( x , buf , settings ) ; } <nl> inline void readCSV ( LocalDate & x , ReadBuffer & buf ) { readCSVSimple ( x , buf ) ; } <nl> inline void readCSV ( LocalDateTime & x , ReadBuffer & buf ) { readCSVSimple ( x , buf ) ; } <nl> inline void readCSV ( UUID & x , ReadBuffer & buf ) { readCSVSimple ( x , buf ) ; } <nl> mmm a / dbms / src / Interpreters / Settings . h <nl> ppp b / dbms / src / Interpreters / Settings . h <nl> struct Settings <nl> M ( SettingUInt64 , max_network_bandwidth_for_user , 0 , " The maximum speed of data exchange over the network in bytes per second for all concurrently running user queries . Zero means unlimited . " ) \ <nl> M ( SettingUInt64 , max_network_bandwidth_for_all_users , 0 , " The maximum speed of data exchange over the network in bytes per second for all concurrently running queries . Zero means unlimited . " ) \ <nl> M ( SettingChar , format_csv_delimiter , ' , ' , " The character to be considered as a delimiter in CSV data . If setting with a string , a string has to have a length of 1 . " ) \ <nl> - M ( SettingBool , format_csv_single_quote , 1 , " If it is set to true , single quote is treated as string field quote character . " ) \ <nl> - M ( SettingBool , format_csv_double_quote , 1 , " If it is set to true , double quote is treated as string field quote character . " ) \ <nl> + M ( SettingBool , format_csv_allow_single_quotes , 1 , " If it is set to true , allow strings in single quotes . " ) \ <nl> + M ( SettingBool , format_csv_allow_double_quotes , 1 , " If it is set to true , allow strings in double quotes . " ) \ <nl> + \ <nl> M ( SettingUInt64 , enable_conditional_computation , 0 , " Enable conditional computations " ) \ <nl> \ <nl> M ( SettingDateTimeInputFormat , date_time_input_format , FormatSettings : : DateTimeInputFormat : : Basic , " Method to read DateTime from text input formats . Possible values : ' basic ' and ' best_effort ' . " ) \ <nl>
|
Adaptations
|
ClickHouse/ClickHouse
|
84fd35da4111518af18fc69fe70f20ef9931660c
|
2018-07-04T21:00:50Z
|
mmm a / xbmc / GUISettings . cpp <nl> ppp b / xbmc / GUISettings . cpp <nl> void CGUISettings : : Initialize ( ) <nl> AddGroup ( 0 , 1 ) ; <nl> AddCategory ( 0 , " pictures " , 16000 ) ; <nl> AddBool ( 2 , " pictures . showvideos " , 22022 , false ) ; <nl> - AddBool ( 3 , " pictures . savefolderviews " , 583 , true ) ; <nl> AddBool ( 4 , " pictures . generatethumbs " , 13360 , true ) ; <nl> AddSeparator ( 5 , " pictures . sep1 " ) ; <nl> AddBool ( 6 , " pictures . useexifrotation " , 20184 , true ) ; <nl> mmm a / xbmc / GUIViewStatePictures . cpp <nl> ppp b / xbmc / GUIViewStatePictures . cpp <nl> CGUIViewStateWindowPictures : : CGUIViewStateWindowPictures ( const CFileItemList & it <nl> <nl> void CGUIViewStateWindowPictures : : SaveViewState ( ) <nl> { <nl> - if ( g_guiSettings . GetBool ( " pictures . savefolderviews " ) ) <nl> - SaveViewToDb ( m_items . m_strPath , WINDOW_PICTURES , & g_stSettings . m_viewStatePictures ) ; <nl> - else <nl> - { <nl> - g_stSettings . m_viewStatePictures = CViewState ( GetViewAsControl ( ) , GetSortMethod ( ) , GetSortOrder ( ) ) ; <nl> - g_settings . Save ( ) ; <nl> - } <nl> + SaveViewToDb ( m_items . m_strPath , WINDOW_PICTURES , & g_stSettings . m_viewStatePictures ) ; <nl> } <nl> <nl> CStdString CGUIViewStateWindowPictures : : GetLockType ( ) <nl> mmm a / xbmc / GUIWindowSettingsCategory . cpp <nl> ppp b / xbmc / GUIWindowSettingsCategory . cpp <nl> void CGUIWindowSettingsCategory : : OnSettingChanged ( CBaseSettingControl * pSettingC <nl> { <nl> ClearFolderViews ( pSettingControl - > GetSetting ( ) , WINDOW_PROGRAMS ) ; <nl> } <nl> - else if ( strSetting . Equals ( " pictures . savefolderviews " ) ) <nl> - { <nl> - ClearFolderViews ( pSettingControl - > GetSetting ( ) , WINDOW_PICTURES ) ; <nl> - } <nl> else if ( strSetting . Equals ( " network . interface " ) ) <nl> { <nl> NetworkInterfaceChanged ( ) ; <nl>
|
changed : remove pictures save folder view setting - always enabled
|
xbmc/xbmc
|
50414ecd2183fd774ef217a322a0aa904a0e42f3
|
2009-10-11T21:27:55Z
|
mmm a / src / mongo / db / repl / replication_coordinator_external_state_impl . cpp <nl> ppp b / src / mongo / db / repl / replication_coordinator_external_state_impl . cpp <nl> <nl> # include " mongo / s / client / shard_registry . h " <nl> # include " mongo / s / cluster_identity_loader . h " <nl> # include " mongo / s / grid . h " <nl> - # include " mongo / s / periodic_balancer_settings_refresher . h " <nl> # include " mongo / stdx / functional . h " <nl> # include " mongo / stdx / memory . h " <nl> # include " mongo / stdx / thread . h " <nl> void ReplicationCoordinatorExternalStateImpl : : shardingOnStepDownHook ( ) { <nl> invariant ( serverGlobalParams . clusterRole = = ClusterRole : : ShardServer ) ; <nl> ShardingState : : get ( _service ) - > interruptChunkSplitter ( ) ; <nl> CatalogCacheLoader : : get ( _service ) . onStepDown ( ) ; <nl> - PeriodicBalancerSettingsRefresher : : get ( _service ) - > stop ( ) ; <nl> } <nl> <nl> ShardingState : : get ( _service ) - > markCollectionsNotShardedAtStepdown ( ) ; <nl> void ReplicationCoordinatorExternalStateImpl : : _shardingOnTransitionToPrimaryHook <nl> } <nl> <nl> CatalogCacheLoader : : get ( _service ) . onStepUp ( ) ; <nl> - PeriodicBalancerSettingsRefresher : : get ( _service ) - > start ( ) ; <nl> ShardingState : : get ( _service ) - > initiateChunkSplitter ( ) ; <nl> } else { / / unsharded <nl> if ( auto validator = LogicalTimeValidator : : get ( _service ) ) { <nl> mmm a / src / mongo / db / s / sharding_state . cpp <nl> ppp b / src / mongo / db / s / sharding_state . cpp <nl> Status ShardingState : : initializeFromShardIdentity ( OperationContext * opCtx , <nl> repl : : MemberState : : RS_PRIMARY ) ; <nl> <nl> CatalogCacheLoader : : get ( opCtx ) . initializeReplicaSetRole ( isStandaloneOrPrimary ) ; <nl> + <nl> _chunkSplitter - > setReplicaSetMode ( isStandaloneOrPrimary ) ; <nl> <nl> log ( ) < < " initialized sharding components for " <nl> mmm a / src / mongo / s / SConscript <nl> ppp b / src / mongo / s / SConscript <nl> env . Library ( <nl> ' config_server_catalog_cache_loader . cpp ' , <nl> ' config_server_client . cpp ' , <nl> ' grid . cpp ' , <nl> - ' periodic_balancer_settings_refresher . cpp ' , <nl> ' shard_util . cpp ' , <nl> ' sharding_egress_metadata_hook . cpp ' , <nl> ] , <nl> deleted file mode 100644 <nl> index 8c2d4f50c3a4 . . 000000000000 <nl> mmm a / src / mongo / s / periodic_balancer_settings_refresher . cpp <nl> ppp / dev / null <nl> <nl> - / * * <nl> - * Copyright ( C ) 2017 MongoDB Inc . <nl> - * <nl> - * This program is free software : you can redistribute it and / or modify <nl> - * it under the terms of the GNU Affero General Public License , version 3 , <nl> - * as published by the Free Software Foundation . <nl> - * <nl> - * This program is distributed in the hope that it will be useful , <nl> - * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> - * GNU Affero General Public License for more details . <nl> - * <nl> - * You should have received a copy of the GNU Affero General Public License <nl> - * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> - * <nl> - * As a special exception , the copyright holders give permission to link the <nl> - * code of portions of this program with the OpenSSL library under certain <nl> - * conditions as described in each individual source file and distribute <nl> - * linked combinations including the program with the OpenSSL library . You <nl> - * must comply with the GNU Affero General Public License in all respects for <nl> - * all of the code used other than as permitted herein . If you modify file ( s ) <nl> - * with this exception , you may extend this exception to your version of the <nl> - * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> - * delete this exception statement from your version . If you delete this <nl> - * exception statement from all source files in the program , then also delete <nl> - * it in the license file . <nl> - * / <nl> - <nl> - # define MONGO_LOG_DEFAULT_COMPONENT : : mongo : : logger : : LogComponent : : kSharding <nl> - <nl> - # include " mongo / platform / basic . h " <nl> - <nl> - # include " mongo / s / periodic_balancer_settings_refresher . h " <nl> - <nl> - # include " mongo / db / client . h " <nl> - # include " mongo / db / operation_context . h " <nl> - # include " mongo / db / service_context . h " <nl> - # include " mongo / s / balancer_configuration . h " <nl> - # include " mongo / s / grid . h " <nl> - # include " mongo / util / concurrency / idle_thread_block . h " <nl> - # include " mongo / util / exit . h " <nl> - # include " mongo / util / log . h " <nl> - <nl> - namespace mongo { <nl> - namespace { <nl> - <nl> - const Milliseconds kRefreshInterval ( 10 * 1000 ) ; <nl> - <nl> - const auto getPeriodicBalancerSettingsRefresher = <nl> - ServiceContext : : declareDecoration < std : : unique_ptr < PeriodicBalancerSettingsRefresher > > ( ) ; <nl> - <nl> - } / / namespace <nl> - <nl> - PeriodicBalancerSettingsRefresher : : PeriodicBalancerSettingsRefresher ( bool isPrimary ) <nl> - : _isPrimary ( isPrimary ) { <nl> - _thread = stdx : : thread ( [ this ] { _periodicRefresh ( ) ; } ) ; <nl> - } <nl> - <nl> - PeriodicBalancerSettingsRefresher : : ~ PeriodicBalancerSettingsRefresher ( ) { <nl> - invariant ( ! _thread . joinable ( ) ) ; <nl> - } <nl> - <nl> - void PeriodicBalancerSettingsRefresher : : create ( ServiceContext * serviceContext , bool isPrimary ) { <nl> - invariant ( ! getPeriodicBalancerSettingsRefresher ( serviceContext ) ) ; <nl> - getPeriodicBalancerSettingsRefresher ( serviceContext ) = <nl> - stdx : : make_unique < PeriodicBalancerSettingsRefresher > ( isPrimary ) ; <nl> - <nl> - / / Register a shutdown task to terminate the refresher thread . <nl> - registerShutdownTask ( <nl> - [ serviceContext ] { PeriodicBalancerSettingsRefresher : : get ( serviceContext ) - > shutdown ( ) ; } ) ; <nl> - } <nl> - <nl> - PeriodicBalancerSettingsRefresher * PeriodicBalancerSettingsRefresher : : get ( <nl> - ServiceContext * serviceContext ) { <nl> - return getPeriodicBalancerSettingsRefresher ( serviceContext ) . get ( ) ; <nl> - } <nl> - <nl> - void PeriodicBalancerSettingsRefresher : : start ( ) { <nl> - stdx : : lock_guard < stdx : : mutex > scopedLock ( _mutex ) ; <nl> - invariant ( ! _isPrimary ) ; <nl> - _isPrimary = true ; <nl> - } <nl> - <nl> - void PeriodicBalancerSettingsRefresher : : stop ( ) { <nl> - stdx : : lock_guard < stdx : : mutex > scopedLock ( _mutex ) ; <nl> - if ( ! _isPrimary ) { <nl> - return ; <nl> - } <nl> - _isPrimary = false ; <nl> - } <nl> - <nl> - void PeriodicBalancerSettingsRefresher : : shutdown ( ) { <nl> - { <nl> - stdx : : lock_guard < stdx : : mutex > scopedLock ( _mutex ) ; <nl> - if ( _isShutdown ) { <nl> - return ; <nl> - } <nl> - _isShutdown = true ; <nl> - } <nl> - <nl> - _thread . join ( ) ; <nl> - _thread = { } ; <nl> - } <nl> - <nl> - void PeriodicBalancerSettingsRefresher : : _periodicRefresh ( ) { <nl> - Client : : initThread ( " Periodic Balancer Settings Refresher " ) ; <nl> - auto opCtx = cc ( ) . makeOperationContext ( ) ; <nl> - <nl> - while ( ! _shutDownRequested ( ) ) { <nl> - if ( _isPrimary ) { <nl> - auto status = <nl> - Grid : : get ( opCtx . get ( ) ) - > getBalancerConfiguration ( ) - > refreshAndCheck ( opCtx . get ( ) ) ; <nl> - if ( ! status . isOK ( ) ) { <nl> - log ( ) < < " failed to refresh balancer settings " < < causedBy ( status ) ; <nl> - } <nl> - } <nl> - <nl> - try { <nl> - MONGO_IDLE_THREAD_BLOCK ; <nl> - opCtx - > sleepFor ( kRefreshInterval ) ; <nl> - } catch ( DBException e ) { <nl> - log ( ) < < " Periodic Balancer Settings Refresher interrupted : : " < < e . what ( ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - bool PeriodicBalancerSettingsRefresher : : _shutDownRequested ( ) { <nl> - stdx : : lock_guard < stdx : : mutex > scopedLock ( _mutex ) ; <nl> - return _isShutdown ; <nl> - } <nl> - <nl> - } / / namespace mongo <nl> deleted file mode 100644 <nl> index 5b747836496f . . 000000000000 <nl> mmm a / src / mongo / s / periodic_balancer_settings_refresher . h <nl> ppp / dev / null <nl> <nl> - / * * <nl> - * Copyright ( C ) 2017 MongoDB Inc . <nl> - * <nl> - * This program is free software : you can redistribute it and / or modify <nl> - * it under the terms of the GNU Affero General Public License , version 3 , <nl> - * as published by the Free Software Foundation . <nl> - * <nl> - * This program is distributed in the hope that it will be useful , <nl> - * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> - * GNU Affero General Public License for more details . <nl> - * <nl> - * You should have received a copy of the GNU Affero General Public License <nl> - * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> - * <nl> - * As a special exception , the copyright holders give permission to link the <nl> - * code of portions of this program with the OpenSSL library under certain <nl> - * conditions as described in each individual source file and distribute <nl> - * linked combinations including the program with the OpenSSL library . You <nl> - * must comply with the GNU Affero General Public License in all respects for <nl> - * all of the code used other than as permitted herein . If you modify file ( s ) <nl> - * with this exception , you may extend this exception to your version of the <nl> - * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> - * delete this exception statement from your version . If you delete this <nl> - * exception statement from all source files in the program , then also delete <nl> - * it in the license file . <nl> - * / <nl> - <nl> - # pragma once <nl> - <nl> - # include " mongo / base / disallow_copying . h " <nl> - # include " mongo / stdx / mutex . h " <nl> - # include " mongo / stdx / thread . h " <nl> - <nl> - namespace mongo { <nl> - <nl> - class OperationContext ; <nl> - class ServiceContext ; <nl> - <nl> - / * * <nl> - * Periodically refreshes the cache of the balancer configuration on a primary shard . <nl> - * / <nl> - class PeriodicBalancerSettingsRefresher { <nl> - MONGO_DISALLOW_COPYING ( PeriodicBalancerSettingsRefresher ) ; <nl> - <nl> - public : <nl> - PeriodicBalancerSettingsRefresher ( bool isPrimary ) ; <nl> - ~ PeriodicBalancerSettingsRefresher ( ) ; <nl> - <nl> - / * * <nl> - * Instantiates an instance of the PeriodicBalancerSettingsRefresher and installs it on the <nl> - * specified service context . <nl> - * <nl> - * This method is not thread - safe and must be called only once when the service is starting . <nl> - * / <nl> - static void create ( ServiceContext * serviceContext , bool isPrimary ) ; <nl> - <nl> - / * * <nl> - * Retrieves the per - service instance of the PeriodicBalancerSettingsRefresher . <nl> - * / <nl> - static PeriodicBalancerSettingsRefresher * get ( ServiceContext * serviceContext ) ; <nl> - <nl> - / * * <nl> - * Invoked when the shard server primary enters the ' PRIMARY ' state to start the <nl> - * PeriodicBalancerSettingsRefresher . <nl> - * / <nl> - void start ( ) ; <nl> - <nl> - / * * <nl> - * Invoked when this node which is currently serving as a ' PRIMARY ' steps down . <nl> - * <nl> - * This method might be called multiple times in succession , which is what happens as a result <nl> - * of incomplete transition to primary so it is resilient to that . <nl> - * / <nl> - void stop ( ) ; <nl> - <nl> - / * * <nl> - * Signals shutdown and blocks until the refresher thread has stopped . <nl> - * / <nl> - void shutdown ( ) ; <nl> - <nl> - private : <nl> - / * * <nl> - * The main loop that refreshes the cache periodically . This runs in a separate thread . <nl> - * / <nl> - void _periodicRefresh ( ) ; <nl> - <nl> - / * * <nl> - * Use to check whether or not shutdown has been requested for the running thread . <nl> - * / <nl> - bool _shutDownRequested ( ) ; <nl> - <nl> - / / The background thread to refresh balancer settings <nl> - stdx : : thread _thread ; <nl> - <nl> - / / Protects the state below <nl> - stdx : : mutex _mutex ; <nl> - <nl> - / / The PeriodicBalancerSettingsRefresher is only active on a primary node . <nl> - bool _isPrimary ; <nl> - <nl> - / / Used to shut down the background thread <nl> - bool _isShutdown { false } ; <nl> - } ; <nl> - <nl> - } / / namespace mongo <nl> mmm a / src / mongo / s / sharding_initialization . cpp <nl> ppp b / src / mongo / s / sharding_initialization . cpp <nl> <nl> # include " mongo / s / client / sharding_network_connection_hook . h " <nl> # include " mongo / s / cluster_identity_loader . h " <nl> # include " mongo / s / grid . h " <nl> - # include " mongo / s / periodic_balancer_settings_refresher . h " <nl> # include " mongo / s / query / cluster_cursor_manager . h " <nl> # include " mongo / stdx / memory . h " <nl> # include " mongo / util / exit . h " <nl> Status initializeGlobalShardingState ( OperationContext * opCtx , <nl> if ( serverGlobalParams . clusterRole = = ClusterRole : : ConfigServer & & <nl> replCoord - > getMemberState ( ) . primary ( ) ) { <nl> LogicalTimeValidator : : get ( opCtx ) - > enableKeyGenerator ( opCtx , true ) ; <nl> - } else if ( serverGlobalParams . clusterRole = = ClusterRole : : ShardServer ) { <nl> - / / Determine primary / secondary / standalone state in order to properly set up the refresher . <nl> - bool isReplSet = <nl> - replCoord - > getReplicationMode ( ) = = repl : : ReplicationCoordinator : : modeReplSet ; <nl> - bool isStandaloneOrPrimary = <nl> - ! isReplSet | | ( repl : : ReplicationCoordinator : : get ( opCtx ) - > getMemberState ( ) = = <nl> - repl : : MemberState : : RS_PRIMARY ) ; <nl> - <nl> - PeriodicBalancerSettingsRefresher : : create ( opCtx - > getServiceContext ( ) , <nl> - isStandaloneOrPrimary ) ; <nl> } <nl> <nl> return Status : : OK ( ) ; <nl>
|
SERVER - 31585 Remove unused PeriodicBalancerSettingsRefresher
|
mongodb/mongo
|
548c2e79306912f95a70a348f83d888e2579dcd1
|
2017-10-18T18:19:42Z
|
mmm a / tests / cpp - tests / Classes / ExtensionsTest / CocoStudioArmatureTest / ArmatureScene . cpp <nl> ppp b / tests / cpp - tests / Classes / ExtensionsTest / CocoStudioArmatureTest / ArmatureScene . cpp <nl> std : : string TestLoadFromBinary : : subtitle ( ) const <nl> <nl> void TestLoadFromBinary : : onTouchesEnded ( const std : : vector < Touch * > & touches , Event * event ) <nl> { <nl> - / / remove json created <nl> - / / remove sync resource <nl> if ( - 1 = = m_armatureIndex ) <nl> { <nl> - ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( m_binaryFilesNames [ 0 ] ) ; <nl> + m_armatureIndex = - 2 ; / / is loading <nl> + <nl> + / / remove json created <nl> + / / remove sync resource <nl> + ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / Cowboy . ExportJson " ) ; <nl> ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / Cowboy . ExportJson " ) ; <nl> ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / hero . ExportJson " ) ; <nl> ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / horse . ExportJson " ) ; <nl> ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / HeroAnimation . ExportJson " ) ; <nl> ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / testEasing . ExportJson " ) ; <nl> + for ( int i = 0 ; i < BINARYFILECOUNT ; i + + ) <nl> + { <nl> + ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( m_binaryFilesNames [ i ] ) ; <nl> + } <nl> + <nl> + for ( int i = 0 ; i < BINARYFILECOUNT ; i + + ) <nl> + { <nl> + ArmatureDataManager : : getInstance ( ) - > removeArmatureFileInfo ( " armature / testEasing . csb " ) ; } <nl> <nl> for ( int i = 0 ; i < BINARYFILECOUNT ; i + + ) <nl> { <nl> ArmatureDataManager : : getInstance ( ) - > addArmatureFileInfoAsync ( m_binaryFilesNames [ i ] , this , schedule_selector ( TestLoadFromBinary : : dataLoaded ) ) ; <nl> } <nl> <nl> - m_armatureIndex = - 2 ; / / is loading <nl> } <nl> else if ( m_armatureIndex > = 0 & & m_armature ! = nullptr ) <nl> { <nl> - this - > removeChild ( m_armature ) ; <nl> + m_armature - > removeFromParent ( ) ; <nl> m_armatureIndex = m_armatureIndex = = BINARYFILECOUNT - 1 ? 0 : m_armatureIndex + 1 ; <nl> m_armature = Armature : : create ( m_armatureNames [ m_armatureIndex ] ) ; <nl> m_armature - > setPosition ( Vec2 ( VisibleRect : : center ( ) . x , VisibleRect : : center ( ) . y ) ) ; <nl>
|
fix binary test crash bug
|
cocos2d/cocos2d-x
|
8212ed38223ee5e001fb048ed4f3a95300b6a1d4
|
2014-07-17T08:01:03Z
|
mmm a / src / yuzu / configuration / configure_system . cpp <nl> ppp b / src / yuzu / configuration / configure_system . cpp <nl> <nl> # include " common / logging / backend . h " <nl> # include " common / string_util . h " <nl> # include " core / core . h " <nl> + # include " core / hle / service / acc / profile_manager . h " <nl> # include " core / settings . h " <nl> # include " ui_configure_system . h " <nl> # include " yuzu / configuration / configure_system . h " <nl> void ConfigureSystem : : RenameUser ( ) { <nl> if ( ! ok ) <nl> return ; <nl> <nl> + std : : fill ( profile . username . begin ( ) , profile . username . end ( ) , ' \ 0 ' ) ; <nl> const auto username_std = new_username . toStdString ( ) ; <nl> if ( username_std . size ( ) > profile . username . size ( ) ) { <nl> std : : copy_n ( username_std . begin ( ) , std : : min ( profile . username . size ( ) , username_std . size ( ) ) , <nl> void ConfigureSystem : : RenameUser ( ) { <nl> user , 0 , <nl> new QStandardItem { <nl> GetIcon ( * uuid ) . scaled ( 64 , 64 , Qt : : IgnoreAspectRatio , Qt : : SmoothTransformation ) , <nl> - QString : : fromStdString ( username_std + ' \ n ' + uuid - > FormatSwitch ( ) ) } ) ; <nl> + tr ( " % 1 \ n % 2 " , " % 1 is the profile username , % 2 is the formatted UUID ( e . g . " <nl> + " 00112233 - 4455 - 6677 - 8899 - AABBCCDDEEFF ) ) " ) <nl> + . arg ( QString : : fromStdString ( username_std ) , <nl> + QString : : fromStdString ( uuid - > FormatSwitch ( ) ) ) } ) ; <nl> UpdateCurrentUser ( ) ; <nl> } <nl> <nl> void ConfigureSystem : : DeleteUser ( ) { <nl> ASSERT ( uuid ! = boost : : none ) ; <nl> const auto username = GetAccountUsername ( * uuid ) ; <nl> <nl> - const auto confirm = QMessageBox : : question ( <nl> - this , tr ( " Confirm Delete " ) , <nl> - tr ( " You are about to delete user with name % 1 . Are you sure ? " ) . arg ( username . c_str ( ) ) ) ; <nl> + const auto confirm = <nl> + QMessageBox : : question ( this , tr ( " Confirm Delete " ) , <nl> + tr ( " You are about to delete user with name % 1 . Are you sure ? " ) <nl> + . arg ( QString : : fromStdString ( username ) ) ) ; <nl> <nl> if ( confirm = = QMessageBox : : No ) <nl> return ; <nl> mmm a / src / yuzu / configuration / configure_system . h <nl> ppp b / src / yuzu / configuration / configure_system . h <nl> <nl> <nl> # include < QList > <nl> # include < QWidget > <nl> - # include " core / hle / service / acc / profile_manager . h " <nl> + <nl> + namespace Service : : Account { <nl> + class ProfileManager ; <nl> + struct UUID ; <nl> + } / / namespace Service : : Account <nl> <nl> class QGraphicsScene ; <nl> class QStandardItem ; <nl>
|
configure_system : Clear current username before overwriting
|
yuzu-emu/yuzu
|
e7ac42677be6c13e5286fb42004aa94b0da45391
|
2018-10-24T13:25:20Z
|
mmm a / tensorflow / python / keras / engine / training_utils . py <nl> ppp b / tensorflow / python / keras / engine / training_utils . py <nl> def check_num_samples ( ins , <nl> processed based on the size of the first dimension of the <nl> first input numpy array . When steps is not ` None ` and <nl> ` batch_size ` is ` None ` , returns ` None ` . <nl> - <nl> - Raises : <nl> - ValueError : In case of invalid arguments . <nl> " " " <nl> if steps is not None and batch_size is not None : <nl> raise ValueError ( <nl>
|
docstring updated
|
tensorflow/tensorflow
|
708faca72c504a8e790af575799f2c40f134ccde
|
2019-02-07T05:06:07Z
|
mmm a / lib / SILOptimizer / FunctionSignatureTransforms / FunctionSignatureOpts . cpp <nl> ppp b / lib / SILOptimizer / FunctionSignatureTransforms / FunctionSignatureOpts . cpp <nl> void FunctionSignatureTransform : : createFunctionSignatureOptimizedFunction ( ) { <nl> NewFGenericEnv = nullptr ; <nl> } <nl> <nl> + / / The specialized function is an internal detail , so we need to disconnect it <nl> + / / from a parent class , if one exists , thus the override of the <nl> + / / classSubclassScope . <nl> TransformDescriptor . OptimizedFunction = M . createFunction ( <nl> linkage , Name , NewFTy , NewFGenericEnv , F - > getLocation ( ) , F - > isBare ( ) , <nl> F - > isTransparent ( ) , F - > isSerialized ( ) , F - > getEntryCount ( ) , F - > isThunk ( ) , <nl> - F - > getClassSubclassScope ( ) , F - > getInlineStrategy ( ) , F - > getEffectsKind ( ) , <nl> - nullptr , F - > getDebugScope ( ) ) ; <nl> + / * classSubclassScope = * / SubclassScope : : NotApplicable , <nl> + F - > getInlineStrategy ( ) , F - > getEffectsKind ( ) , nullptr , F - > getDebugScope ( ) ) ; <nl> SILFunction * NewF = TransformDescriptor . OptimizedFunction . get ( ) ; <nl> if ( ! F - > hasQualifiedOwnership ( ) ) { <nl> NewF - > setUnqualifiedOwnership ( ) ; <nl> mmm a / test / TBD / specialization . swift <nl> ppp b / test / TBD / specialization . swift <nl> open class Foo { <nl> } <nl> <nl> open class Bar < T > { <nl> + public init ( ) { <nl> + bar ( ) <nl> + } <nl> + <nl> @ inline ( never ) <nl> fileprivate func bar ( ) { } <nl> } <nl> public func f ( ) { <nl> } <nl> <nl> <nl> + / / Generic specialization , from the foo call in f <nl> / / CHECK - LABEL : / / specialized Foo . foo < A > ( _ : ) <nl> / / CHECK - NEXT : sil private [ noinline ] @ $ S14specialization3FooC3foo33_A6E3E43DB6679655BDF5A878ABC489A0LLyyxmlFSi_Tg5Tf4dd_n : $ @ convention ( thin ) ( ) - > ( ) <nl> <nl> + / / Function signature specialization , from the bar call in Bar . init <nl> + / / CHECK - LABEL : / / specialized Bar . bar ( ) <nl> + / / CHECK - NEXT : sil private [ noinline ] @ $ S14specialization3BarC3bar33_A6E3E43DB6679655BDF5A878ABC489A0LLyyFTf4d_n : $ @ convention ( thin ) ( ) - > ( ) { <nl> + <nl> + / / Generic specialization , from the bar call in f <nl> / / CHECK - LABEL : / / specialized Bar . bar ( ) <nl> / / CHECK - NEXT : sil private [ noinline ] @ $ S14specialization3BarC3bar33_A6E3E43DB6679655BDF5A878ABC489A0LLyyFSi_Tg5Tf4d_n : $ @ convention ( thin ) ( ) - > ( ) <nl>
|
[ SILOptimizer ] Properly disconnect the signature optimized function from a parent class .
|
apple/swift
|
85424c0c3cb0a0860cfd69ed848b69654ed6e8aa
|
2018-06-27T02:09:14Z
|
mmm a / src / cpp / server / external_connection_acceptor_impl . cc <nl> ppp b / src / cpp / server / external_connection_acceptor_impl . cc <nl> ExternalConnectionAcceptorImpl : : ExternalConnectionAcceptorImpl ( <nl> <nl> std : : unique_ptr < experimental : : ExternalConnectionAcceptor > <nl> ExternalConnectionAcceptorImpl : : GetAcceptor ( ) { <nl> - std : : lock_guard < std : : mutex > lock ( mu_ ) ; <nl> + grpc_core : : MutexLock lock ( & mu_ ) ; <nl> GPR_ASSERT ( ! has_acceptor_ ) ; <nl> has_acceptor_ = true ; <nl> return std : : unique_ptr < experimental : : ExternalConnectionAcceptor > ( <nl> ExternalConnectionAcceptorImpl : : GetAcceptor ( ) { <nl> <nl> void ExternalConnectionAcceptorImpl : : HandleNewConnection ( <nl> experimental : : ExternalConnectionAcceptor : : NewConnectionParameters * p ) { <nl> - std : : lock_guard < std : : mutex > lock ( mu_ ) ; <nl> + grpc_core : : MutexLock lock ( & mu_ ) ; <nl> if ( shutdown_ | | ! started_ ) { <nl> / / TODO ( yangg ) clean up . <nl> gpr_log ( <nl> void ExternalConnectionAcceptorImpl : : HandleNewConnection ( <nl> } <nl> <nl> void ExternalConnectionAcceptorImpl : : Shutdown ( ) { <nl> - std : : lock_guard < std : : mutex > lock ( mu_ ) ; <nl> + grpc_core : : MutexLock lock ( & mu_ ) ; <nl> shutdown_ = true ; <nl> } <nl> <nl> void ExternalConnectionAcceptorImpl : : Start ( ) { <nl> - std : : lock_guard < std : : mutex > lock ( mu_ ) ; <nl> + grpc_core : : MutexLock lock ( & mu_ ) ; <nl> GPR_ASSERT ( ! started_ ) ; <nl> GPR_ASSERT ( has_acceptor_ ) ; <nl> GPR_ASSERT ( ! shutdown_ ) ; <nl> mmm a / src / cpp / server / external_connection_acceptor_impl . h <nl> ppp b / src / cpp / server / external_connection_acceptor_impl . h <nl> <nl> # define SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_ <nl> <nl> # include < memory > <nl> - # include < mutex > <nl> <nl> # include < grpc / impl / codegen / grpc_types . h > <nl> # include < grpcpp / security / server_credentials . h > <nl> <nl> # include < grpcpp / server_builder . h > <nl> # include < grpcpp / support / channel_arguments . h > <nl> <nl> + # include " src / core / lib / gprpp / sync . h " <nl> # include " src / core / lib / iomgr / tcp_server . h " <nl> <nl> namespace grpc { <nl> class ExternalConnectionAcceptorImpl <nl> const grpc : : string name_ ; <nl> std : : shared_ptr < ServerCredentials > creds_ ; <nl> grpc_core : : TcpServerFdHandler * handler_ = nullptr ; / / not owned <nl> - std : : mutex mu_ ; <nl> + grpc_core : : Mutex mu_ ; <nl> bool has_acceptor_ = false ; <nl> bool started_ = false ; <nl> bool shutdown_ = false ; <nl> new file mode 100755 <nl> index 00000000000 . . 55cf252d827 <nl> mmm / dev / null <nl> ppp b / tools / run_tests / sanity / cpp_banned_constructs . sh <nl> <nl> + # ! / bin / sh <nl> + # Copyright 2019 gRPC authors . <nl> + # <nl> + # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + # you may not use this file except in compliance with the License . <nl> + # You may obtain a copy of the License at <nl> + # <nl> + # http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + # <nl> + # Unless required by applicable law or agreed to in writing , software <nl> + # distributed under the License is distributed on an " AS IS " BASIS , <nl> + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + # See the License for the specific language governing permissions and <nl> + # limitations under the License . <nl> + <nl> + set - e <nl> + <nl> + cd " $ ( dirname " $ 0 " ) / . . / . . / . . " <nl> + <nl> + # <nl> + # Prevent the use of synchronization and threading constructs from std : : since <nl> + # the code should be using grpc_core : : Mutex , grpc : : internal : : Mutex , <nl> + # grpc_core : : Thread , etc . <nl> + # <nl> + <nl> + egrep - Irn \ <nl> + ' std : : ( mutex | condition_variable | lock_guard | unique_lock | thread ) ' \ <nl> + include / grpc include / grpcpp src / core src / cpp | \ <nl> + egrep - v include / grpcpp / impl / codegen / sync . h | \ <nl> + diff - / dev / null <nl> + <nl> mmm a / tools / run_tests / sanity / sanity_tests . yaml <nl> ppp b / tools / run_tests / sanity / sanity_tests . yaml <nl> <nl> - script : tools / run_tests / sanity / check_tracer_sanity . py <nl> - script : tools / run_tests / sanity / core_banned_functions . py <nl> - script : tools / run_tests / sanity / core_untyped_structs . sh <nl> + - script : tools / run_tests / sanity / cpp_banned_constructs . sh <nl> - script : tools / buildgen / generate_projects . sh - j 3 <nl> cpu_cost : 3 <nl> - script : tools / distrib / check_copyright . py <nl>
|
Merge pull request from vjpai / ban_std_sync_again
|
grpc/grpc
|
6a33459237f3d968675cd724a8874e9b2942e2da
|
2019-11-14T00:21:56Z
|
mmm a / arangod / Indexes / Index . h <nl> ppp b / arangod / Indexes / Index . h <nl> <nl> # include " Basics / Common . h " <nl> # include " Basics / AttributeNameParser . h " <nl> # include " Basics / JsonHelper . h " <nl> - # include " Basics / logging . h " <nl> + # include " Indexes / IndexWatermarks . h " <nl> # include " VocBase / document - collection . h " <nl> # include " VocBase / shaped - json . h " <nl> # include " VocBase / vocbase . h " <nl> typedef struct TRI_index_search_value_s { <nl> } <nl> TRI_index_search_value_t ; <nl> <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / - - SECTION - - struct index_element <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief Unified index element . Do not directly construct it . <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> struct TRI_index_element_t { <nl> <nl> } ; <nl> <nl> + namespace triagens { <nl> + namespace arango { <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / - - SECTION - - class Index <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> - namespace triagens { <nl> - namespace arango { <nl> - <nl> class Index { <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> new file mode 100644 <nl> index 00000000000 . . 56ae114fdbe <nl> mmm / dev / null <nl> ppp b / arangod / Indexes / IndexWatermarks . h <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief index watermarks <nl> + / / / <nl> + / / / @ file <nl> + / / / <nl> + / / / DISCLAIMER <nl> + / / / <nl> + / / / Copyright 2014 ArangoDB GmbH , Cologne , Germany <nl> + / / / Copyright 2004 - 2014 triAGENS GmbH , Cologne , Germany <nl> + / / / <nl> + / / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / / you may not use this file except in compliance with the License . <nl> + / / / You may obtain a copy of the License at <nl> + / / / <nl> + / / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / / <nl> + / / / Unless required by applicable law or agreed to in writing , software <nl> + / / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / / See the License for the specific language governing permissions and <nl> + / / / limitations under the License . <nl> + / / / <nl> + / / / Copyright holder is ArangoDB GmbH , Cologne , Germany <nl> + / / / <nl> + / / / @ author Dr . Frank Celler <nl> + / / / @ author Copyright 2014 , ArangoDB GmbH , Cologne , Germany <nl> + / / / @ author Copyright 2011 - 2013 , triAGENS GmbH , Cologne , Germany <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + # ifndef ARANGODB_INDEXES_INDEXWATERMARKS_H <nl> + # define ARANGODB_INDEXES_INDEXWATERMARKS_H 1 <nl> + <nl> + # include " Basics / Common . h " <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - struct IndexWatermarks <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + <nl> + namespace triagens { <nl> + namespace arango { <nl> + <nl> + struct IndexWatermarks { <nl> + IndexWatermarks ( ) <nl> + : initialFillFactor ( 0 . 5 ) , <nl> + lowWatermark ( 0 . 0 ) , <nl> + highWatermark ( 0 . 66 ) { <nl> + } <nl> + <nl> + double initialFillFactor ; <nl> + double lowWatermark ; <nl> + double highWatermark ; <nl> + } ; <nl> + <nl> + } <nl> + } <nl> + <nl> + # endif <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - END - OF - FILE <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / Local Variables : <nl> + / / mode : outline - minor <nl> + / / outline - regexp : " / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ page \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } " <nl> + / / End : <nl> mmm a / arangod / Indexes / PathBasedIndex . cpp <nl> ppp b / arangod / Indexes / PathBasedIndex . cpp <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> # include " PathBasedIndex . h " <nl> + # include " Basics / logging . h " <nl> <nl> using namespace triagens : : arango ; <nl> <nl> mmm a / arangod / RestServer / ArangoServer . cpp <nl> ppp b / arangod / RestServer / ArangoServer . cpp <nl> <nl> # include " Dispatcher / Dispatcher . h " <nl> # include " HttpServer / ApplicationEndpointServer . h " <nl> # include " HttpServer / AsyncJobManager . h " <nl> + # include " HttpServer / HttpHandlerFactory . h " <nl> # include " Rest / InitializeRest . h " <nl> # include " Rest / OperationMode . h " <nl> # include " Rest / Version . h " <nl> ArangoServer : : ArangoServer ( int argc , char * * argv ) <nl> _pairForAqlHandler ( nullptr ) , <nl> _pairForJobHandler ( nullptr ) , <nl> _indexPool ( nullptr ) , <nl> - _threadAffinity ( 0 ) { <nl> + _threadAffinity ( 0 ) , <nl> + _defaultIndexWatermarks ( ) { <nl> <nl> TRI_SetApplicationName ( " arangod " ) ; <nl> <nl> ArangoServer : : ~ ArangoServer ( ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> void ArangoServer : : buildApplicationServer ( ) { <nl> - / / detect alignment settings for ARM <nl> - { <nl> - # ifdef __arm__ <nl> - / / To change the alignment trap behavior , simply echo a number into <nl> - / / / proc / cpu / alignment . The number is made up from various bits : <nl> - / / <nl> - / / bit behavior when set <nl> - / / mmm mmmmmmmmmmmmmmm - - <nl> - / / <nl> - / / 0 A user process performing an unaligned memory access <nl> - / / will cause the kernel to print a message indicating <nl> - / / process name , pid , pc , instruction , address , and the <nl> - / / fault code . <nl> - / / <nl> - / / 1 The kernel will attempt to fix up the user process <nl> - / / performing the unaligned access . This is of course <nl> - / / slow ( think about the floating point emulator ) and <nl> - / / not recommended for production use . <nl> - / / <nl> - / / 2 The kernel will send a SIGBUS signal to the user process <nl> - / / performing the unaligned access . <nl> - std : : string const filename ( " / proc / cpu / alignment " ) ; <nl> - <nl> - try { <nl> - std : : string cpuAlignment = triagens : : basics : : FileUtils : : slurp ( " / proc / cpu / alignment " ) ; <nl> - int64_t alignment = std : : stol ( cpuAlignment ) ; <nl> - if ( ( alignment & 2 ) = = 0 ) { <nl> - LOG_WARNING ( " possibly incompatible CPU alignment settings found in ' % s ' . this may cause arangod to abort with SIGBUS . it may be necessary to set the value of ' % s ' to 2 " ) ; <nl> - } <nl> - } <nl> - catch ( . . . ) { <nl> - / / ignore that we cannot detect the alignment <nl> - LOG_TRACE ( " unable to detect CPU alignment settings . could not process file ' % s ' " , filename . c_str ( ) ) ; <nl> - } <nl> - # endif <nl> - } <nl> - <nl> _applicationServer = new ApplicationServer ( " arangod " , " [ < options > ] < database - directory > " , rest : : Version : : getDetailed ( ) ) ; <nl> <nl> string conf = TRI_BinaryName ( _argv [ 0 ] ) + " . conf " ; <nl> void ArangoServer : : buildApplicationServer ( ) { <nl> ( " database . query - cache - max - results " , & _queryCacheMaxResults , " maximum number of results in query cache per database " ) <nl> ( " database . index - threads " , & _indexThreads , " threads to start for parallel background index creation " ) <nl> ( " database . throw - collection - not - loaded - error " , & _throwCollectionNotLoadedError , " throw an error when accessing a collection that is still loading " ) <nl> + / * <nl> + ( " database . index - initial - fill - factor " , & _defaultIndexWatermarks . initialFillFactor , " the initial fill factor for hash and edge indexes " ) <nl> + ( " database . index - low - watermark " , & _defaultIndexWatermarks . lowWatermark , " low watermark for hash and edge indexes " ) <nl> + ( " database . index - high - watermark " , & _defaultIndexWatermarks . highWatermark , " high watermark for hash and edge indexes " ) <nl> + * / <nl> ; <nl> <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> void ArangoServer : : buildApplicationServer ( ) { <nl> LOG_INFO ( " please use the ' - - database . directory ' option " ) ; <nl> LOG_FATAL_AND_EXIT ( " no database path has been supplied , giving up " ) ; <nl> } <nl> + <nl> + # ifdef __arm__ <nl> + / / detect alignment settings for ARM <nl> + { <nl> + / / To change the alignment trap behavior , simply echo a number into <nl> + / / / proc / cpu / alignment . The number is made up from various bits : <nl> + / / <nl> + / / bit behavior when set <nl> + / / mmm mmmmmmmmmmmmmmm - - <nl> + / / <nl> + / / 0 A user process performing an unaligned memory access <nl> + / / will cause the kernel to print a message indicating <nl> + / / process name , pid , pc , instruction , address , and the <nl> + / / fault code . <nl> + / / <nl> + / / 1 The kernel will attempt to fix up the user process <nl> + / / performing the unaligned access . This is of course <nl> + / / slow ( think about the floating point emulator ) and <nl> + / / not recommended for production use . <nl> + / / <nl> + / / 2 The kernel will send a SIGBUS signal to the user process <nl> + / / performing the unaligned access . <nl> + bool alignmentDetected = false ; <nl> + <nl> + std : : string const filename ( " / proc / cpu / alignment " ) ; <nl> + try { <nl> + std : : string const cpuAlignment = triagens : : basics : : FileUtils : : slurp ( filename ) ; <nl> + auto start = cpuAlignment . find ( " User faults : " ) ; <nl> + <nl> + if ( start ! = std : : string : : npos ) { <nl> + start + = strlen ( " User faults : " ) ; <nl> + size_t end = start ; <nl> + while ( end < cpuAlignment . size ( ) ) { <nl> + if ( cpuAlignment [ end ] = = ' ' | | cpuAlignment [ end ] = = ' \ t ' ) { <nl> + + + end ; <nl> + } <nl> + else { <nl> + break ; <nl> + } <nl> + } <nl> + while ( end < cpuAlignment . size ( ) ) { <nl> + + + end ; <nl> + if ( cpuAlignment [ end ] < ' 0 ' | | cpuAlignment [ end ] > ' 9 ' ) { <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + int64_t alignment = std : : stol ( std : : string ( cpuAlignment . c_str ( ) + start , end - start ) ) ; <nl> + if ( ( alignment & 2 ) = = 0 ) { <nl> + LOG_WARNING ( " possibly incompatible CPU alignment settings found in ' % s ' . this may cause arangod to abort with SIGBUS . it may be necessary to set the value in ' % s ' to 2 " , <nl> + filename . c_str ( ) , <nl> + filename . c_str ( ) ) ; <nl> + } <nl> + <nl> + alignmentDetected = true ; <nl> + } <nl> + <nl> + } <nl> + catch ( . . . ) { <nl> + / / ignore that we cannot detect the alignment <nl> + LOG_TRACE ( " unable to detect CPU alignment settings . could not process file ' % s ' " , filename . c_str ( ) ) ; <nl> + } <nl> + <nl> + if ( ! alignmentDetected ) { <nl> + LOG_WARNING ( " unable to detect CPU alignment settings . could not process file ' % s ' . this may cause arangod to abort with SIGBUS . it may be necessary to set the value in ' % s ' to 2 " , <nl> + filename . c_str ( ) , <nl> + filename . c_str ( ) ) ; <nl> + } <nl> + } <nl> + # endif <nl> <nl> / / strip trailing separators <nl> _databasePath = StringUtils : : rTrim ( _databasePath , TRI_DIR_SEPARATOR_STR ) ; <nl> mmm a / arangod / RestServer / ArangoServer . h <nl> ppp b / arangod / RestServer / ArangoServer . h <nl> <nl> # include " Basics / win - utils . h " <nl> # endif <nl> <nl> + # include " Aql / QueryRegistry . h " <nl> + # include " Indexes / IndexWatermarks . h " <nl> # include " Rest / AnyServer . h " <nl> # include " Rest / OperationMode . h " <nl> - <nl> # include " VocBase / vocbase . h " <nl> - # include " HttpServer / HttpHandlerFactory . h " <nl> - # include " Aql / QueryRegistry . h " <nl> <nl> struct TRI_server_t ; <nl> struct TRI_vocbase_defaults_s ; <nl> namespace triagens { <nl> class ApplicationScheduler ; <nl> class AsyncJobManager ; <nl> class Dispatcher ; <nl> + class HttpHandlerFactory ; <nl> class HttpServer ; <nl> class HttpsServer ; <nl> } <nl> namespace triagens { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> uint32_t _threadAffinity ; <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief default watermarks for indexes <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + triagens : : arango : : IndexWatermarks _defaultIndexWatermarks ; <nl> } ; <nl> } <nl> } <nl>
|
preparation for index watermarks
|
arangodb/arangodb
|
282e13afb4b397705480c4a482902bf7f5a8b687
|
2015-09-02T14:24:14Z
|
mmm a / third_party / mlir / include / mlir / IR / Builders . h <nl> ppp b / third_party / mlir / include / mlir / IR / Builders . h <nl> class Builder { <nl> FloatAttr getF32FloatAttr ( float value ) ; <nl> FloatAttr getF64FloatAttr ( double value ) ; <nl> <nl> + IntegerAttr getI8IntegerAttr ( int8_t value ) ; <nl> + IntegerAttr getI16IntegerAttr ( int16_t value ) ; <nl> IntegerAttr getI32IntegerAttr ( int32_t value ) ; <nl> IntegerAttr getI64IntegerAttr ( int64_t value ) ; <nl> <nl> mmm a / third_party / mlir / lib / IR / Builders . cpp <nl> ppp b / third_party / mlir / lib / IR / Builders . cpp <nl> IntegerAttr Builder : : getI32IntegerAttr ( int32_t value ) { <nl> return IntegerAttr : : get ( getIntegerType ( 32 ) , APInt ( 32 , value ) ) ; <nl> } <nl> <nl> + IntegerAttr Builder : : getI16IntegerAttr ( int16_t value ) { <nl> + return IntegerAttr : : get ( getIntegerType ( 16 ) , APInt ( 16 , value ) ) ; <nl> + } <nl> + <nl> + IntegerAttr Builder : : getI8IntegerAttr ( int8_t value ) { <nl> + return IntegerAttr : : get ( getIntegerType ( 8 ) , APInt ( 8 , value ) ) ; <nl> + } <nl> + <nl> IntegerAttr Builder : : getIntegerAttr ( Type type , int64_t value ) { <nl> if ( type . isIndex ( ) ) <nl> return IntegerAttr : : get ( type , APInt ( 64 , value ) ) ; <nl>
|
Add convenience methods to create i8 and i16 attributes in Builder .
|
tensorflow/tensorflow
|
e832dcc31c3c68b86c9c4ab5ebbb78cfdd28dcee
|
2019-09-15T00:08:45Z
|
mmm a / Makefile <nl> ppp b / Makefile <nl> pooling_cpu . o : src / operator / pooling . cc <nl> pooling_gpu . o : src / operator / pooling . cu <nl> softmax_cpu . o : src / operator / softmax . cc <nl> softmax_gpu . o : src / operator / softmax . cu <nl> + < < < < < < < HEAD <nl> convolution_cpu . o : src / operator / convolution . cc <nl> convolution_gpu . o : src / operator / convolution . cu <nl> reshape_cpu . o : src / operator / reshape . cc <nl> reshape_gpu . o : src / operator / reshape . cu <nl> + = = = = = = = <nl> + io . o : src / io / io . cc <nl> + > > > > > > > finish merge remote master <nl> <nl> lib / libmxnet . a : $ ( OBJ ) $ ( OBJCXX11 ) $ ( CUOBJ ) <nl> lib / libmxnet . so : $ ( OBJ ) $ ( OBJCXX11 ) $ ( CUOBJ ) <nl> <nl> test / test_storage : test / test_storage . cc lib / libmxnet . a <nl> + test / io_mnist_test : test / io_mnist_test . cc lib / libmxnet . a $ ( DMLC_CORE ) / libdmlc . a <nl> # test / test_threaded_engine : test / test_threaded_engine . cc api / libmxnet . a <nl> <nl> $ ( BIN ) : <nl> new file mode 100644 <nl> index 00000000000 . . 29dccbace77 <nl> mmm / dev / null <nl> ppp b / include / mxnet / io . h <nl> <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * \ file io . h <nl> + * \ brief mxnet io data structure and data iterator <nl> + * / <nl> + # ifndef MXNET_IO_H_ <nl> + # define MXNET_IO_H_ <nl> + # include < dmlc / data . h > <nl> + # include < vector > <nl> + # include < string > <nl> + # include < utility > <nl> + # include " . / base . h " <nl> + <nl> + namespace mxnet { <nl> + / * ! <nl> + * \ brief iterator type <nl> + * \ tparam DType data type <nl> + * / <nl> + template < typename DType > <nl> + class IIterator : public dmlc : : DataIter < DType > { <nl> + public : <nl> + / * ! <nl> + * \ brief set the parameter <nl> + * \ param name name of parameter <nl> + * \ param val value of parameter <nl> + * / <nl> + virtual void SetParam ( const char * name , const char * val ) = 0 ; <nl> + / * ! \ brief initalize the iterator so that we can use the iterator * / <nl> + virtual void Init ( void ) = 0 ; <nl> + / * ! \ brief set before first of the item * / <nl> + virtual void BeforeFirst ( void ) = 0 ; <nl> + / * ! \ brief move to next item * / <nl> + virtual bool Next ( void ) = 0 ; <nl> + / * ! \ brief get current data * / <nl> + virtual const DType & Value ( void ) const = 0 ; <nl> + / * ! \ brief constructor * / <nl> + virtual ~ IIterator ( void ) { } <nl> + / * ! \ brief store the name of each data , it could be used for making NArrays * / <nl> + std : : vector < std : : string > data_names ; <nl> + / * ! \ brief set data name to each attribute of data * / <nl> + inline void SetDataName ( const std : : string data_name ) { <nl> + data_names . push_back ( data_name ) ; <nl> + } <nl> + } ; / / class IIterator <nl> + <nl> + / * ! \ brief a single data instance * / <nl> + struct DataInst { <nl> + / * ! \ brief unique id for instance * / <nl> + unsigned index ; <nl> + / * ! \ brief content of data * / <nl> + std : : vector < TBlob > data ; <nl> + / * ! \ brief extra data to be fed to the network * / <nl> + std : : string extra_data ; <nl> + } ; / / struct DataInst <nl> + <nl> + / * ! <nl> + * \ brief a standard batch of data commonly used by iterator <nl> + * a databatch contains multiple TBlobs . Each Tblobs has <nl> + * a name stored in a map . There ' s no different between <nl> + * data and label , how we use them is to see the DNN implementation . <nl> + * / <nl> + struct DataBatch { <nl> + public : <nl> + / * ! \ brief unique id for instance , can be NULL , sometimes is useful * / <nl> + unsigned * inst_index ; <nl> + / * ! \ brief number of instance * / <nl> + mshadow : : index_t batch_size ; <nl> + / * ! \ brief number of padding elements in this batch , <nl> + this is used to indicate the last elements in the batch are only padded up to match the batch , and should be discarded * / <nl> + mshadow : : index_t num_batch_padd ; <nl> + public : <nl> + / * ! \ brief content of dense data , if this DataBatch is dense * / <nl> + std : : vector < TBlob > data ; <nl> + / * ! \ brief extra data to be fed to the network * / <nl> + std : : string extra_data ; <nl> + public : <nl> + / * ! \ brief constructor * / <nl> + DataBatch ( void ) { <nl> + inst_index = NULL ; <nl> + batch_size = 0 ; num_batch_padd = 0 ; <nl> + } <nl> + / * ! \ brief giving name to the data * / <nl> + void Naming ( std : : vector < std : : string > names ) ; <nl> + } ; / / struct DataBatch <nl> + <nl> + / * ! <nl> + * \ brief create the databatch iterator IIterator <nl> + * \ param cfg configure settings key = vale pair <nl> + * \ return the data IIterator ptr <nl> + * / <nl> + IIterator < DataBatch > * CreateIterator ( const std : : vector < std : : pair < std : : string , std : : string > > & cfg ) ; <nl> + / * ! <nl> + * \ brief create the databatch iterator IIterator from config file <nl> + * \ param cfg_path configure file path <nl> + * \ return the data IIterator ptr <nl> + * / <nl> + IIterator < DataBatch > * CreateIteratorFromConfig ( const char * cfg_path ) ; <nl> + / * ! <nl> + * \ brief create the databatch iterator IIterator by iter name <nl> + * \ param iter_name can be mnist , imgrec and so on <nl> + * \ return the data IIterator ptr <nl> + * / <nl> + IIterator < DataBatch > * CreateIteratorByName ( const char * iter_name ) ; <nl> + } / / namespace mxnet <nl> + # endif / / MXNET_IO_H_ <nl> new file mode 100644 <nl> index 00000000000 . . 1ae73463168 <nl> mmm / dev / null <nl> ppp b / src / io / inst_vector . h <nl> <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * \ inst_vector . h <nl> + * \ brief holder of a sequence of DataInst in CPU <nl> + * that are not necessarily of same shape <nl> + * / <nl> + # ifndef MXNET_IO_INST_VECTOR_H_ <nl> + # define MXNET_IO_INST_VECTOR_H_ <nl> + # include < dmlc / base . h > <nl> + # include < mshadow / tensor . h > <nl> + # include < vector > <nl> + # include < string > <nl> + # include " . / data . h " <nl> + namespace mxnet { <nl> + / * ! <nl> + * \ brief tensor vector that can store sequence of tensor <nl> + * in a memory compact way , tensors do not have to be of same shape <nl> + * / <nl> + template < int dim , typename DType > <nl> + class TensorVector { <nl> + public : <nl> + TensorVector ( void ) { <nl> + this - > Clear ( ) ; <nl> + } <nl> + / / get i - th tensor <nl> + inline mshadow : : Tensor < cpu , dim , DType > <nl> + operator [ ] ( size_t i ) const { <nl> + CHECK ( i + 1 < offset_ . size ( ) ) ; <nl> + CHECK ( shape_ [ i ] . Size ( ) = = offset_ [ i + 1 ] - offset_ [ i ] ) ; <nl> + return mshadow : : Tensor < cpu , dim , DType > <nl> + ( reinterpret_cast < DType * > ( BeginPtr ( content_ ) ) + offset_ [ i ] , shape_ [ i ] ) ; <nl> + } <nl> + inline mshadow : : Tensor < cpu , dim , DType > Back ( ) const { <nl> + return ( * this ) [ Size ( ) - 1 ] ; <nl> + } <nl> + inline size_t Size ( void ) const { <nl> + return shape_ . size ( ) ; <nl> + } <nl> + / / push a tensor of certain shape <nl> + / / return the reference of the pushed tensor <nl> + inline void Push ( mshadow : : Shape < dim > shape ) { <nl> + shape_ . push_back ( shape ) ; <nl> + offset_ . push_back ( offset_ . back ( ) + shape . Size ( ) ) ; <nl> + content_ . resize ( offset_ . back ( ) ) ; <nl> + } <nl> + inline void Clear ( void ) { <nl> + offset_ . clear ( ) ; <nl> + offset_ . push_back ( 0 ) ; <nl> + content_ . clear ( ) ; <nl> + shape_ . clear ( ) ; <nl> + } <nl> + <nl> + private : <nl> + / / offset of the data content <nl> + std : : vector < size_t > offset_ ; <nl> + / / data content <nl> + std : : vector < DType > content_ ; <nl> + / / shape of data <nl> + std : : vector < mshadow : : Shape < dim > > shape_ ; <nl> + } ; <nl> + <nl> + / * ! <nl> + * \ brief tblob vector that can store sequence of tblob <nl> + * in a memory compact way , tblobs do not have to be of same shape <nl> + * / <nl> + template < typename DType > <nl> + class TBlobVector { <nl> + public : <nl> + TBlobVector ( void ) { <nl> + this - > Clear ( ) ; <nl> + } <nl> + / / get i - th tblob <nl> + inline TBlob operator [ ] ( size_t i ) const ; <nl> + / / get the last tblob <nl> + inline TBlob Back ( ) ; <nl> + / / return the size of the vector <nl> + inline size_t Size ( void ) const ; <nl> + / / push a tensor of certain shape <nl> + / / return the reference of the pushed tensor <nl> + inline void Push ( TShape shape_ ) ; <nl> + inline void Clear ( void ) ; <nl> + private : <nl> + / / offset of the data content <nl> + std : : vector < size_t > offset_ ; <nl> + / / data content <nl> + std : : vector < DType > content_ ; <nl> + / / shape of data <nl> + std : : vector < TShape > shape_ ; <nl> + } ; <nl> + <nl> + / * ! <nl> + * \ brief instance vector that can holds <nl> + * non - uniform shape data instance in a shape efficient way <nl> + * / <nl> + class InstVector { <nl> + public : <nl> + inline size_t Size ( void ) const { <nl> + return index_ . size ( ) ; <nl> + } <nl> + / / instance <nl> + inline DataInst operator [ ] ( size_t i ) const ; <nl> + / / get back of instance vector <nl> + inline DataInst Back ( ) const ; <nl> + / / clear the container <nl> + inline void Clear ( void ) ; <nl> + / / push the newly coming instance <nl> + inline void Push ( unsigned index , TBlob data_ ) ; <nl> + <nl> + private : <nl> + / * ! \ brief index of the data * / <nl> + std : : vector < unsigned > index_ ; <nl> + / / data <nl> + std : : vector < TensorVector < real_t > > data_ ; <nl> + / / extra data <nl> + std : : vector < std : : string > extra_data_ ; <nl> + } ; <nl> + # endif / / MXNET_IO_INST_VECTOR_H_ <nl> new file mode 100644 <nl> index 00000000000 . . 2df16e4fc20 <nl> mmm / dev / null <nl> ppp b / src / io / io . cc <nl> <nl> + / / Copyright ( c ) 2015 by Contributors <nl> + # define _CRT_SECURE_NO_WARNINGS <nl> + # define _CRT_SECURE_NO_DEPRECATE <nl> + <nl> + # include < mxnet / io . h > <nl> + # include < dmlc / logging . h > <nl> + # include < dmlc / config . h > <nl> + # include < mshadow / tensor . h > <nl> + # include < string > <nl> + # include < vector > <nl> + # include < fstream > <nl> + # include " iter_mnist - inl . h " <nl> + # include " . . / utils / random . h " <nl> + <nl> + namespace mxnet { <nl> + IIterator < DataBatch > * CreateIterator ( <nl> + const std : : vector < std : : pair < std : : string , std : : string > > & cfg ) { <nl> + size_t i = 0 ; <nl> + IIterator < DataBatch > * it = NULL ; <nl> + for ( ; i < cfg . size ( ) ; + + i ) { <nl> + const char * name = cfg [ i ] . first . c_str ( ) ; <nl> + const char * val = cfg [ i ] . second . c_str ( ) ; <nl> + if ( ! strcmp ( name , " iter " ) ) { <nl> + if ( ! strcmp ( val , " mnist " ) ) { <nl> + CHECK ( it = = NULL ) < < " mnist cannot chain over other iterator " ; <nl> + it = new MNISTIterator ( ) ; continue ; <nl> + } <nl> + CHECK ( ! strcmp ( val , " mnist " ) ) < < " Currently only have mnist iterator " ; <nl> + } <nl> + if ( it ! = NULL ) { <nl> + it - > SetParam ( name , val ) ; <nl> + } <nl> + } <nl> + CHECK ( it ! = NULL ) < < " must specify iterator by iter = itername " ; <nl> + return it ; <nl> + } <nl> + <nl> + IIterator < DataBatch > * CreateIteratorFromConfig ( const char * cfg_path ) { <nl> + std : : ifstream ifs ( cfg_path , std : : ifstream : : in ) ; <nl> + std : : vector < std : : pair < std : : string , std : : string > > itcfg ; <nl> + dmlc : : Config cfg ( ifs ) ; <nl> + for ( dmlc : : Config : : ConfigIterator iter = cfg . begin ( ) ; iter ! = cfg . end ( ) ; + + iter ) { <nl> + dmlc : : Config : : ConfigEntry ent = * iter ; <nl> + itcfg . push_back ( std : : make_pair ( ent . first , ent . second ) ) ; <nl> + } <nl> + / / Get the data and init <nl> + return CreateIterator ( itcfg ) ; <nl> + } <nl> + <nl> + IIterator < DataBatch > * CreateIteratorByName ( const char * iter_name ) { <nl> + IIterator < DataBatch > * it = NULL ; <nl> + / / Currently only support mnist <nl> + if ( ! strcmp ( iter_name , " mnist " ) ) { <nl> + CHECK ( it = = NULL ) < < " mnist cannot chain over other iterator " ; <nl> + it = new MNISTIterator ( ) ; <nl> + } <nl> + CHECK ( ! strcmp ( iter_name , " mnist " ) ) < < " Currently only have mnist iterator " ; <nl> + return it ; <nl> + } <nl> + } / / namespace mxnet <nl> new file mode 100644 <nl> index 00000000000 . . 376838fcf3f <nl> mmm / dev / null <nl> ppp b / src / io / iter_mnist - inl . h <nl> <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * \ file iter_mnist - inl . h <nl> + * \ brief iterator that takes mnist dataset <nl> + * / <nl> + # ifndef MXNET_IO_ITER_MNIST_INL_H_ <nl> + # define MXNET_IO_ITER_MNIST_INL_H_ <nl> + # include < mshadow / tensor . h > <nl> + # include < mxnet / io . h > <nl> + # include < mxnet / base . h > <nl> + # include < dmlc / io . h > <nl> + # include < dmlc / logging . h > <nl> + # include < string > <nl> + # include < vector > <nl> + # include " . . / utils / random . h " <nl> + <nl> + namespace mxnet { <nl> + class MNISTIterator : public IIterator < DataBatch > { <nl> + public : <nl> + MNISTIterator ( void ) { <nl> + img_ . dptr_ = NULL ; <nl> + mode_ = 1 ; <nl> + inst_offset_ = 0 ; <nl> + silent_ = 0 ; <nl> + shuffle_ = 0 ; <nl> + rnd . Seed ( kRandMagic ) ; <nl> + out_ . data . resize ( 2 ) ; <nl> + } <nl> + virtual ~ MNISTIterator ( void ) { <nl> + if ( img_ . dptr_ ! = NULL ) delete [ ] img_ . dptr_ ; <nl> + } <nl> + virtual void SetParam ( const char * name , const char * val ) { <nl> + if ( ! strcmp ( name , " silent " ) ) silent_ = atoi ( val ) ; <nl> + if ( ! strcmp ( name , " batch_size " ) ) batch_size_ = ( index_t ) atoi ( val ) ; <nl> + if ( ! strcmp ( name , " input_flat " ) ) mode_ = atoi ( val ) ; <nl> + if ( ! strcmp ( name , " shuffle " ) ) shuffle_ = atoi ( val ) ; <nl> + if ( ! strcmp ( name , " index_offset " ) ) inst_offset_ = atoi ( val ) ; <nl> + if ( ! strcmp ( name , " path_img " ) ) path_img = val ; <nl> + if ( ! strcmp ( name , " path_label " ) ) path_label = val ; <nl> + if ( ! strcmp ( name , " path_img " ) ) path_img = val ; <nl> + if ( ! strcmp ( name , " seed_data " ) ) rnd . Seed ( kRandMagic + atoi ( val ) ) ; <nl> + } <nl> + / / intialize iterator loads data in <nl> + virtual void Init ( void ) { <nl> + this - > LoadImage ( ) ; <nl> + this - > LoadLabel ( ) ; <nl> + / / set name <nl> + this - > SetDataName ( std : : string ( " data " ) ) ; <nl> + this - > SetDataName ( std : : string ( " label " ) ) ; <nl> + if ( mode_ = = 1 ) { <nl> + batch_data_ . shape_ = mshadow : : Shape4 ( batch_size_ , 1 , 1 , img_ . size ( 1 ) * img_ . size ( 2 ) ) ; <nl> + } else { <nl> + batch_data_ . shape_ = mshadow : : Shape4 ( batch_size_ , 1 , img_ . size ( 1 ) , img_ . size ( 2 ) ) ; <nl> + } <nl> + out_ . inst_index = NULL ; <nl> + batch_label_ . shape_ = mshadow : : Shape2 ( batch_size_ , 1 ) ; <nl> + batch_label_ . stride_ = 1 ; <nl> + batch_data_ . stride_ = batch_data_ . size ( 3 ) ; <nl> + out_ . batch_size = batch_size_ ; <nl> + if ( shuffle_ ) this - > Shuffle ( ) ; <nl> + if ( silent_ = = 0 ) { <nl> + mshadow : : Shape < 4 > s = batch_data_ . shape_ ; <nl> + printf ( " MNISTIterator : load % u images , shuffle = % d , shape = % u , % u , % u , % u \ n " , <nl> + ( unsigned ) img_ . size ( 0 ) , shuffle_ , s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ; <nl> + } <nl> + } <nl> + virtual void BeforeFirst ( void ) { <nl> + this - > loc_ = 0 ; <nl> + } <nl> + virtual bool Next ( void ) { <nl> + if ( loc_ + batch_size_ < = img_ . size ( 0 ) ) { <nl> + batch_data_ . dptr_ = img_ [ loc_ ] . dptr_ ; <nl> + batch_label_ . dptr_ = & labels_ [ loc_ ] ; <nl> + out_ . data [ 0 ] = TBlob ( batch_data_ ) ; <nl> + out_ . data [ 1 ] = TBlob ( batch_label_ ) ; <nl> + out_ . inst_index = & inst_ [ loc_ ] ; <nl> + loc_ + = batch_size_ ; <nl> + return true ; <nl> + } else { <nl> + return false ; <nl> + } <nl> + } <nl> + virtual const DataBatch & Value ( void ) const { <nl> + return out_ ; <nl> + } <nl> + <nl> + private : <nl> + inline void LoadImage ( void ) { <nl> + dmlc : : Stream * stdimg = dmlc : : Stream : : Create ( path_img . c_str ( ) , " r " ) ; <nl> + ReadInt ( stdimg ) ; <nl> + int image_count = ReadInt ( stdimg ) ; <nl> + int image_rows = ReadInt ( stdimg ) ; <nl> + int image_cols = ReadInt ( stdimg ) ; <nl> + <nl> + img_ . shape_ = mshadow : : Shape3 ( image_count , image_rows , image_cols ) ; <nl> + img_ . stride_ = img_ . size ( 2 ) ; <nl> + <nl> + / / allocate continuous memory <nl> + img_ . dptr_ = new float [ img_ . MSize ( ) ] ; <nl> + for ( int i = 0 ; i < image_count ; + + i ) { <nl> + for ( int j = 0 ; j < image_rows ; + + j ) { <nl> + for ( int k = 0 ; k < image_cols ; + + k ) { <nl> + unsigned char ch ; <nl> + CHECK ( stdimg - > Read ( & ch , sizeof ( ch ) ! = 0 ) ) ; <nl> + img_ [ i ] [ j ] [ k ] = ch ; <nl> + } <nl> + } <nl> + } <nl> + / / normalize to 0 - 1 <nl> + img_ * = 1 . 0f / 256 . 0f ; <nl> + delete stdimg ; <nl> + } <nl> + inline void LoadLabel ( void ) { <nl> + dmlc : : Stream * stdlabel = dmlc : : Stream : : Create ( path_label . c_str ( ) , " r " ) ; <nl> + ReadInt ( stdlabel ) ; <nl> + int labels_count = ReadInt ( stdlabel ) ; <nl> + labels_ . resize ( labels_count ) ; <nl> + for ( int i = 0 ; i < labels_count ; + + i ) { <nl> + unsigned char ch ; <nl> + CHECK ( stdlabel - > Read ( & ch , sizeof ( ch ) ! = 0 ) ) ; <nl> + labels_ [ i ] = ch ; <nl> + inst_ . push_back ( ( unsigned ) i + inst_offset_ ) ; <nl> + } <nl> + delete stdlabel ; <nl> + } <nl> + inline void Shuffle ( void ) { <nl> + rnd . Shuffle ( & inst_ ) ; <nl> + std : : vector < float > tmplabel ( labels_ . size ( ) ) ; <nl> + mshadow : : TensorContainer < cpu , 3 > tmpimg ( img_ . shape_ ) ; <nl> + for ( size_t i = 0 ; i < inst_ . size ( ) ; + + i ) { <nl> + unsigned ridx = inst_ [ i ] - inst_offset_ ; <nl> + mshadow : : Copy ( tmpimg [ i ] , img_ [ ridx ] ) ; <nl> + tmplabel [ i ] = labels_ [ ridx ] ; <nl> + } <nl> + / / copy back <nl> + mshadow : : Copy ( img_ , tmpimg ) ; <nl> + labels_ = tmplabel ; <nl> + } <nl> + <nl> + private : <nl> + inline static int ReadInt ( dmlc : : Stream * fi ) { <nl> + unsigned char buf [ 4 ] ; <nl> + CHECK ( fi - > Read ( buf , sizeof ( buf ) ) = = sizeof ( buf ) ) <nl> + < < " invalid mnist format " ; <nl> + return reinterpret_cast < int > ( buf [ 0 ] < < 24 | buf [ 1 ] < < 16 | buf [ 2 ] < < 8 | buf [ 3 ] ) ; <nl> + } <nl> + <nl> + private : <nl> + / * ! \ brief silent * / <nl> + int silent_ ; <nl> + / * ! \ brief path * / <nl> + std : : string path_img , path_label ; <nl> + / * ! \ brief output * / <nl> + DataBatch out_ ; <nl> + / * ! \ brief whether do shuffle * / <nl> + int shuffle_ ; <nl> + / * ! \ brief data mode * / <nl> + int mode_ ; <nl> + / * ! \ brief current location * / <nl> + index_t loc_ ; <nl> + / * ! \ brief batch size * / <nl> + index_t batch_size_ ; <nl> + / * ! \ brief image content * / <nl> + mshadow : : Tensor < cpu , 3 > img_ ; <nl> + / * ! \ brief label content * / <nl> + std : : vector < float > labels_ ; <nl> + / * ! \ brief batch data tensor * / <nl> + mshadow : : Tensor < cpu , 4 > batch_data_ ; <nl> + / * ! \ brief batch label tensor * / <nl> + mshadow : : Tensor < cpu , 2 > batch_label_ ; <nl> + / * ! \ brief instance index offset * / <nl> + unsigned inst_offset_ ; <nl> + / * ! \ brief instance index * / <nl> + std : : vector < unsigned > inst_ ; <nl> + / / random sampler <nl> + utils : : RandomSampler rnd ; <nl> + / / magic number to setup randomness <nl> + static const int kRandMagic = 0 ; <nl> + } ; / / class MNISTIterator <nl> + } / / namespace mxnet <nl> + # endif / / MXNET_IO_ITER_MNIST_INL_H_ <nl> new file mode 100644 <nl> index 00000000000 . . 2bfba24a507 <nl> mmm / dev / null <nl> ppp b / test / io_mnist_test . cc <nl> <nl> + / / Copyright ( c ) 2015 by Contributors <nl> + / / IO test code <nl> + <nl> + # include < dmlc / io . h > <nl> + # include < dmlc / logging . h > <nl> + # include < dmlc / config . h > <nl> + # include < iostream > <nl> + # include < fstream > <nl> + # include " mxnet / io . h " <nl> + # include " . . / src / io / iter_mnist - inl . h " <nl> + <nl> + using namespace std ; <nl> + using namespace mxnet ; <nl> + using namespace dmlc ; <nl> + <nl> + void InitIter ( IIterator < DataBatch > * itr , <nl> + const std : : vector < std : : pair < std : : string , std : : string > > & defcfg ) { <nl> + for ( size_t i = 0 ; i < defcfg . size ( ) ; + + i ) { <nl> + itr - > SetParam ( defcfg [ i ] . first . c_str ( ) , defcfg [ i ] . second . c_str ( ) ) ; <nl> + } <nl> + itr - > Init ( ) ; <nl> + } <nl> + <nl> + IIterator < DataBatch > * CreateIterators ( <nl> + const std : : vector < std : : pair < std : : string , std : : string > > & cfg ) { <nl> + IIterator < DataBatch > * data_itr = NULL ; <nl> + int flag = 0 ; <nl> + std : : string evname ; <nl> + std : : vector < std : : pair < std : : string , std : : string > > itcfg ; <nl> + std : : vector < std : : pair < std : : string , std : : string > > defcfg ; <nl> + for ( size_t i = 0 ; i < cfg . size ( ) ; + + i ) { <nl> + const char * name = cfg [ i ] . first . c_str ( ) ; <nl> + const char * val = cfg [ i ] . second . c_str ( ) ; <nl> + if ( ! strcmp ( name , " data " ) ) { <nl> + flag = 1 ; continue ; <nl> + } <nl> + if ( ! strcmp ( name , " eval " ) ) { <nl> + flag = 2 ; continue ; <nl> + } <nl> + if ( ! strcmp ( name , " pred " ) ) { <nl> + flag = 3 ; continue ; <nl> + } <nl> + if ( ! strcmp ( name , " iterend " ) & & ! strcmp ( val , " true " ) ) { <nl> + if ( flag = = 1 ) { <nl> + data_itr = mxnet : : CreateIterator ( itcfg ) ; <nl> + } <nl> + flag = 0 ; itcfg . clear ( ) ; <nl> + } <nl> + if ( flag = = 0 ) { <nl> + defcfg . push_back ( cfg [ i ] ) ; <nl> + } else { <nl> + itcfg . push_back ( cfg [ i ] ) ; <nl> + } <nl> + } <nl> + if ( data_itr ! = NULL ) { <nl> + InitIter ( data_itr , defcfg ) ; <nl> + } <nl> + return data_itr ; <nl> + } <nl> + <nl> + / * ! <nl> + * Usage : . / io_mnist_test / path / to / io_config / file <nl> + * Example <nl> + * data = train <nl> + * iter = mnist <nl> + * path_img = " . / data / mnist / train - images - idx3 - ubyte " <nl> + * path_label = " . / data / mnist / train - labels - idx1 - ubyte " <nl> + * shuffle = 1 <nl> + * iterend = true <nl> + * input_shape = 1 , 1 , 784 <nl> + * batch_size = 100 <nl> + * <nl> + * / <nl> + <nl> + int main ( int argc , char * * argv ) { <nl> + std : : ifstream ifs ( argv [ 1 ] , std : : ifstream : : in ) ; <nl> + std : : vector < std : : pair < std : : string , std : : string > > itcfg ; <nl> + Config cfg ( ifs ) ; <nl> + for ( Config : : ConfigIterator iter = cfg . begin ( ) ; iter ! = cfg . end ( ) ; + + iter ) { <nl> + Config : : ConfigEntry ent = * iter ; <nl> + itcfg . push_back ( std : : make_pair ( ent . first , ent . second ) ) ; <nl> + } <nl> + / / Get the data and init <nl> + IIterator < DataBatch > * data_itr = CreateIterators ( itcfg ) ; <nl> + data_itr - > BeforeFirst ( ) ; <nl> + int batch_dir = 0 ; <nl> + while ( data_itr - > Next ( ) ) { <nl> + std : : cout < < " Label of Batch " < < batch_dir + + < < std : : endl ; <nl> + / / print label <nl> + DataBatch db = data_itr - > Value ( ) ; <nl> + mshadow : : Tensor < mshadow : : cpu , 2 > label = db . data [ 1 ] . get < mshadow : : cpu , 2 , float > ( ) ; <nl> + for ( size_t i = 0 ; i < label . shape_ . shape_ [ 0 ] ; i + + ) <nl> + std : : cout < < label . dptr_ [ i ] < < " " ; <nl> + std : : cout < < " \ n " ; <nl> + } <nl> + } <nl>
|
finish merge remote master
|
apache/incubator-mxnet
|
1b19f9d792189248f631985ef52d1b608096d0b9
|
2015-08-27T00:25:20Z
|
mmm a / tensorflow / python / ops / linalg / linear_operator_householder . py <nl> ppp b / tensorflow / python / ops / linalg / linear_operator_householder . py <nl> class LinearOperatorHouseholder ( linear_operator . LinearOperator ) : <nl> x = . . . Shape [ 2 , 4 ] Tensor <nl> operator . matmul ( x ) <nl> = = > Shape [ 2 , 4 ] Tensor <nl> + ` ` ` <nl> <nl> # # # # Shape compatibility <nl> <nl> mmm a / tensorflow / python / ops / linalg / linear_operator_permutation . py <nl> ppp b / tensorflow / python / ops / linalg / linear_operator_permutation . py <nl> class LinearOperatorPermutation ( linear_operator . LinearOperator ) : <nl> x = . . . Shape [ 3 , 4 ] Tensor <nl> operator . matmul ( x ) <nl> = = > Shape [ 3 , 4 ] Tensor <nl> + ` ` ` <nl> <nl> # # # # Shape compatibility <nl> <nl>
|
Closing backticks were not there breaking the website ' s view .
|
tensorflow/tensorflow
|
0a704c08b681fd3bb965a6a626d96f9ecca30477
|
2020-03-31T22:05:07Z
|
mmm a / stdlib / public / Darwin / Compression / Compression . swift <nl> ppp b / stdlib / public / Darwin / Compression / Compression . swift <nl> public enum FilterError : Error { <nl> / / / Filter failed to initialize , <nl> / / / invalid internal state , <nl> / / / invalid parameters <nl> - case state <nl> + case invalidState <nl> <nl> / / / Invalid data in a call to compression_stream_process , <nl> / / / non - empty write after an output filter has been finalized <nl> - case data <nl> + case invalidData <nl> } <nl> <nl> / / / Compression filter direction of operation , compress / decompress <nl> extension compression_stream { <nl> / / / - Parameter operation : direction of operation <nl> / / / - Parameter algorithm : compression algorithm <nl> / / / <nl> - / / / - Throws : ` FilterError . state ` if ` algorithm ` is not supported <nl> + / / / - Throws : ` FilterError . invalidState ` if ` algorithm ` is not supported <nl> / / / by the Compression stream API <nl> / / / <nl> internal init ( operation : FilterOperation , algorithm : Algorithm ) throws { <nl> extension compression_stream { <nl> src_size : 0 , <nl> state : nil ) <nl> let status = compression_stream_init ( & self , operation . rawValue , algorithm . rawValue ) <nl> - guard status = = COMPRESSION_STATUS_OK else { throw FilterError . state } <nl> + guard status = = COMPRESSION_STATUS_OK else { throw FilterError . invalidState } <nl> } <nl> } <nl> <nl> public class OutputFilter { <nl> / / / - bufferCapacity : capacity of the internal data buffer <nl> / / / - writeFunc : called to write the processed data <nl> / / / <nl> - / / / - Throws : ` FilterError . state ` if stream initialization failed <nl> + / / / - Throws : ` FilterError . invalidState ` if stream initialization failed <nl> public init ( <nl> _ operation : FilterOperation , <nl> using algorithm : Algorithm , <nl> public class OutputFilter { <nl> / / / - Parameter data : data to process <nl> / / / <nl> / / / - Throws : <nl> - / / / ` FilterError . data ` if an error occurs during processing , <nl> + / / / ` FilterError . invalidData ` if an error occurs during processing , <nl> / / / or if ` data ` is not empty / nil , and the filter is the finalized state <nl> public func write < D : DataProtocol > ( _ data : D ? ) throws { <nl> / / Finalize if data is empty / nil <nl> if data = = nil | | data ! . isEmpty { try finalize ( ) ; return } <nl> <nl> / / Fail if already finalized <nl> - if _finalized { throw FilterError . data } <nl> + if _finalized { throw FilterError . invalidData } <nl> <nl> / / Process all incoming data <nl> for region in data ! . regions { <nl> public class OutputFilter { <nl> / / / When all output has been sent , the writingTo closure is called one last time with nil data . <nl> / / / Once the stream is finalized , writing non empty / nil data to the stream will throw an exception . <nl> / / / <nl> - / / / - Throws : ` FilterError . data ` if an error occurs during processing <nl> + / / / - Throws : ` FilterError . invalidData ` if an error occurs during processing <nl> public func finalize ( ) throws { <nl> / / Do nothing if already finalized <nl> if _finalized { return } <nl> public class OutputFilter { <nl> _stream . dst_size = _bufCapacity <nl> <nl> let status = compression_stream_process ( & _stream , ( finalize ? Int32 ( COMPRESSION_STREAM_FINALIZE . rawValue ) : 0 ) ) <nl> - guard status ! = COMPRESSION_STATUS_ERROR else { throw FilterError . data } <nl> + guard status ! = COMPRESSION_STATUS_ERROR else { throw FilterError . invalidData } <nl> <nl> / / Number of bytes written to buf <nl> let writtenBytes = _bufCapacity - _stream . dst_size <nl> public class InputFilter < D : DataProtocol > { <nl> public func advance ( by n : Int ) throws { <nl> <nl> / / Sanity checks <nl> - if n > _regionRemaining { throw FilterError . state } / / invalid n <nl> + if n > _regionRemaining { throw FilterError . invalidState } / / invalid n <nl> <nl> / / Update counters <nl> _regionRemaining - = n <nl> public class InputFilter < D : DataProtocol > { <nl> } <nl> <nl> / / Sanity checks <nl> - if _remaining ! = 0 & & _regionRemaining = = 0 { throw FilterError . state } <nl> + if _remaining ! = 0 & & _regionRemaining = = 0 { throw FilterError . invalidState } <nl> } <nl> } <nl> <nl> public class InputFilter < D : DataProtocol > { <nl> / / / - bufferCapacity : capacity of the internal data buffer <nl> / / / - readFunc : called to read the input data <nl> / / / <nl> - / / / - Throws : ` FilterError . state ` if filter initialization failed <nl> + / / / - Throws : ` FilterError . invalidState ` if filter initialization failed <nl> public init ( <nl> _ operation : FilterOperation , <nl> using algorithm : Algorithm , <nl> public class InputFilter < D : DataProtocol > { <nl> / / / - Returns : a new Data object containing at most ` count ` output bytes , or nil if no more data is available <nl> / / / <nl> / / / - Throws : <nl> - / / / ` FilterError . data ` if an error occurs during processing <nl> + / / / ` FilterError . invalidData ` if an error occurs during processing <nl> public func readData ( ofLength count : Int ) throws - > Data ? { <nl> / / Sanity check <nl> precondition ( count > 0 , " number of bytes to read can ' t be 0 " ) <nl> public class InputFilter < D : DataProtocol > { <nl> _stream . src_ptr = src_buf . baseAddress ! . assumingMemoryBound ( to : UInt8 . self ) <nl> _stream . src_size = src_buf . count <nl> let status = compression_stream_process ( & _stream , ( _eofReached ? Int32 ( COMPRESSION_STREAM_FINALIZE . rawValue ) : 0 ) ) <nl> - guard status ! = COMPRESSION_STATUS_ERROR else { throw FilterError . data } <nl> + guard status ! = COMPRESSION_STATUS_ERROR else { throw FilterError . invalidData } <nl> if status = = COMPRESSION_STATUS_END { _endReached = true } <nl> / / Advance by the number of consumed bytes <nl> let consumed = src_buf . count - _stream . src_size <nl> public class InputFilter < D : DataProtocol > { <nl> } else { <nl> / / No data available , process until END reached <nl> let status = compression_stream_process ( & _stream , ( _eofReached ? Int32 ( COMPRESSION_STREAM_FINALIZE . rawValue ) : 0 ) ) <nl> - guard status ! = COMPRESSION_STATUS_ERROR else { throw FilterError . data } <nl> + guard status ! = COMPRESSION_STATUS_ERROR else { throw FilterError . invalidData } <nl> if status = = COMPRESSION_STATUS_END { _endReached = true } <nl> } <nl> <nl>
|
rename error states from code review
|
apple/swift
|
dafba928a62f025cbe4fedc0c74a4c35f13dad81
|
2019-04-08T20:22:44Z
|
mmm a / docs / CHANGELOG . txt <nl> ppp b / docs / CHANGELOG . txt <nl> Other Changes : <nl> - Style : Attenuated default opacity of ImGuiCol_Separator in Classic and Light styles . <nl> - Style : Added style . ColorButtonPosition ( left / right , defaults to ImGuiDir_Right ) to move the color button <nl> of ColorEdit3 / ColorEdit4 functions to either side of the inputs . <nl> + - Misc : Made Button ( ) , ColorButton ( ) not trigger an " edited " event leading to IsItemDeactivatedAfterEdit ( ) <nl> + returning true . This also effectively make ColorEdit4 ( ) not incorrect trigger IsItemDeactivatedAfterEdit ( ) <nl> + when clicking the color button to open the picker popup . ( # 1875 ) <nl> - Misc : Added IMGUI_DISABLE_METRICS_WINDOW imconfig . h setting to explicitly compile out ShowMetricsWindow ( ) . <nl> - Debug , Metrics : Added " Tools - > Item Picker " tool which allow clicking on a widget to break in the debugger <nl> within the item code . The tool calls IM_DEBUG_BREAK ( ) which can be redefined in imconfig . h if needed . <nl> mmm a / imgui_demo . cpp <nl> ppp b / imgui_demo . cpp <nl> static void ShowDemoWindowWidgets ( ) <nl> static bool b = false ; <nl> static float col4f [ 4 ] = { 1 . 0f , 0 . 5 , 0 . 0f , 1 . 0f } ; <nl> static char str [ 16 ] = { } ; <nl> - ImGui : : RadioButton ( " Text " , & item_type , 0 ) ; <nl> - ImGui : : RadioButton ( " Button " , & item_type , 1 ) ; <nl> - ImGui : : RadioButton ( " Checkbox " , & item_type , 2 ) ; <nl> - ImGui : : RadioButton ( " SliderFloat " , & item_type , 3 ) ; <nl> - ImGui : : RadioButton ( " InputText " , & item_type , 4 ) ; <nl> - ImGui : : RadioButton ( " InputFloat3 " , & item_type , 5 ) ; <nl> - ImGui : : RadioButton ( " ColorEdit4 " , & item_type , 6 ) ; <nl> - ImGui : : RadioButton ( " MenuItem " , & item_type , 7 ) ; <nl> - ImGui : : RadioButton ( " TreeNode ( w / double - click ) " , & item_type , 8 ) ; <nl> - ImGui : : RadioButton ( " ListBox " , & item_type , 9 ) ; <nl> - ImGui : : Separator ( ) ; <nl> + ImGui : : Combo ( " Item Type " , & item_type , " Text \ 0Button \ 0Button ( w / repeat ) \ 0Checkbox \ 0SliderFloat \ 0InputText \ 0InputFloat \ 0InputFloat3 \ 0ColorEdit4 \ 0MenuItem \ 0TreeNode ( w / double - click ) \ 0ListBox \ 0 " ) ; <nl> + ImGui : : SameLine ( ) ; <nl> + HelpMarker ( " Testing how various types of items are interacting with the IsItemXXX functions . " ) ; <nl> bool ret = false ; <nl> if ( item_type = = 0 ) { ImGui : : Text ( " ITEM : Text " ) ; } / / Testing text items with no identifier / interaction <nl> if ( item_type = = 1 ) { ret = ImGui : : Button ( " ITEM : Button " ) ; } / / Testing button <nl> - if ( item_type = = 2 ) { ret = ImGui : : Checkbox ( " ITEM : Checkbox " , & b ) ; } / / Testing checkbox <nl> - if ( item_type = = 3 ) { ret = ImGui : : SliderFloat ( " ITEM : SliderFloat " , & col4f [ 0 ] , 0 . 0f , 1 . 0f ) ; } / / Testing basic item <nl> - if ( item_type = = 4 ) { ret = ImGui : : InputText ( " ITEM : InputText " , & str [ 0 ] , IM_ARRAYSIZE ( str ) ) ; } / / Testing input text ( which handles tabbing ) <nl> - if ( item_type = = 5 ) { ret = ImGui : : InputFloat3 ( " ITEM : InputFloat3 " , col4f ) ; } / / Testing multi - component items ( IsItemXXX flags are reported merged ) <nl> - if ( item_type = = 6 ) { ret = ImGui : : ColorEdit4 ( " ITEM : ColorEdit4 " , col4f ) ; } / / Testing multi - component items ( IsItemXXX flags are reported merged ) <nl> - if ( item_type = = 7 ) { ret = ImGui : : MenuItem ( " ITEM : MenuItem " ) ; } / / Testing menu item ( they use ImGuiButtonFlags_PressedOnRelease button policy ) <nl> - if ( item_type = = 8 ) { ret = ImGui : : TreeNodeEx ( " ITEM : TreeNode w / ImGuiTreeNodeFlags_OpenOnDoubleClick " , ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen ) ; } / / Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy . <nl> - if ( item_type = = 9 ) { const char * items [ ] = { " Apple " , " Banana " , " Cherry " , " Kiwi " } ; static int current = 1 ; ret = ImGui : : ListBox ( " ITEM : ListBox " , & current , items , IM_ARRAYSIZE ( items ) , IM_ARRAYSIZE ( items ) ) ; } <nl> + if ( item_type = = 2 ) { ImGui : : PushButtonRepeat ( true ) ; ret = ImGui : : Button ( " ITEM : Button " ) ; ImGui : : PopButtonRepeat ( ) ; } / / Testing button ( with repeater ) <nl> + if ( item_type = = 3 ) { ret = ImGui : : Checkbox ( " ITEM : Checkbox " , & b ) ; } / / Testing checkbox <nl> + if ( item_type = = 4 ) { ret = ImGui : : SliderFloat ( " ITEM : SliderFloat " , & col4f [ 0 ] , 0 . 0f , 1 . 0f ) ; } / / Testing basic item <nl> + if ( item_type = = 5 ) { ret = ImGui : : InputText ( " ITEM : InputText " , & str [ 0 ] , IM_ARRAYSIZE ( str ) ) ; } / / Testing input text ( which handles tabbing ) <nl> + if ( item_type = = 6 ) { ret = ImGui : : InputFloat ( " ITEM : InputFloat " , col4f , 1 . 0f ) ; } / / Testing + / - buttons on scalar input <nl> + if ( item_type = = 7 ) { ret = ImGui : : InputFloat3 ( " ITEM : InputFloat3 " , col4f ) ; } / / Testing multi - component items ( IsItemXXX flags are reported merged ) <nl> + if ( item_type = = 8 ) { ret = ImGui : : ColorEdit4 ( " ITEM : ColorEdit4 " , col4f ) ; } / / Testing multi - component items ( IsItemXXX flags are reported merged ) <nl> + if ( item_type = = 9 ) { ret = ImGui : : MenuItem ( " ITEM : MenuItem " ) ; } / / Testing menu item ( they use ImGuiButtonFlags_PressedOnRelease button policy ) <nl> + if ( item_type = = 10 ) { ret = ImGui : : TreeNodeEx ( " ITEM : TreeNode w / ImGuiTreeNodeFlags_OpenOnDoubleClick " , ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen ) ; } / / Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy . <nl> + if ( item_type = = 11 ) { const char * items [ ] = { " Apple " , " Banana " , " Cherry " , " Kiwi " } ; static int current = 1 ; ret = ImGui : : ListBox ( " ITEM : ListBox " , & current , items , IM_ARRAYSIZE ( items ) , IM_ARRAYSIZE ( items ) ) ; } <nl> ImGui : : BulletText ( <nl> " Return value = % d \ n " <nl> " IsItemFocused ( ) = % d \ n " <nl> mmm a / imgui_widgets . cpp <nl> ppp b / imgui_widgets . cpp <nl> bool ImGui : : ButtonEx ( const char * label , const ImVec2 & size_arg , ImGuiButtonFlags <nl> flags | = ImGuiButtonFlags_Repeat ; <nl> bool hovered , held ; <nl> bool pressed = ButtonBehavior ( bb , id , & hovered , & held , flags ) ; <nl> - if ( pressed ) <nl> - MarkItemEdited ( id ) ; <nl> <nl> / / Render <nl> const ImU32 col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ; <nl> bool ImGui : : ColorButton ( const char * desc_id , const ImVec4 & col , ImGuiColorEditFl <nl> if ( ! ( flags & ImGuiColorEditFlags_NoTooltip ) & & hovered ) <nl> ColorTooltip ( desc_id , & col . x , flags & ( ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaPreviewHalf ) ) ; <nl> <nl> - if ( pressed ) <nl> - MarkItemEdited ( id ) ; <nl> - <nl> return pressed ; <nl> } <nl> <nl>
|
Misc : Made Button ( ) , ColorButton ( ) not trigger an " edited " event leading to IsItemDeactivatedAfterEdit ( ) returning true . This also effectively make ColorEdit4 ( ) not incorrect trigger IsItemDeactivatedAfterEdit ( ) when clicking the color button to open the picker popup . ( )
|
ocornut/imgui
|
61c7f0194e9027f86b3bc476f0a7db4129d54e5c
|
2019-07-18T00:10:28Z
|
mmm a / mars / comm / socket / socket_address . cc <nl> ppp b / mars / comm / socket / socket_address . cc <nl> void socket_address : : __init ( const sockaddr * _addr ) { <nl> <nl> snprintf ( url_ , sizeof ( url_ ) , " [ % s ] : % u " , ip_ , port ( ) ) ; <nl> } else { <nl> + xassert2 ( false ) ; <nl> addr_ . sa . sa_family = AF_UNSPEC ; <nl> } <nl> } <nl>
|
assert when call socket_address : : init with malformed arg
|
Tencent/mars
|
42c7f6254fc24f7ff1b6ec55ae3ed0bc9d1e97c6
|
2020-08-11T08:31:31Z
|
mmm a / modules / java / generator / gen_java . py <nl> ppp b / modules / java / generator / gen_java . py <nl> def checkFileRemap ( path ) : <nl> " size_t " : { " j_type " : " long " , " jn_type " : " long " , " jni_type " : " jlong " , " suffix " : " J " } , <nl> " __int64 " : { " j_type " : " long " , " jn_type " : " long " , " jni_type " : " jlong " , " suffix " : " J " } , <nl> " int64 " : { " j_type " : " long " , " jn_type " : " long " , " jni_type " : " jlong " , " suffix " : " J " } , <nl> - " double [ ] " : { " j_type " : " double [ ] " , " jn_type " : " double [ ] " , " jni_type " : " jdoubleArray " , " suffix " : " _3D " } <nl> + " double [ ] " : { " j_type " : " double [ ] " , " jn_type " : " double [ ] " , " jni_type " : " jdoubleArray " , " suffix " : " _3D " } , <nl> + ' string ' : { # std : : string , see " String " in modules / core / misc / java / gen_dict . json <nl> + ' j_type ' : ' String ' , <nl> + ' jn_type ' : ' String ' , <nl> + ' jni_name ' : ' n_ % ( n ) s ' , <nl> + ' jni_type ' : ' jstring ' , <nl> + ' jni_var ' : ' const char * utf_ % ( n ) s = env - > GetStringUTFChars ( % ( n ) s , 0 ) ; std : : string n_ % ( n ) s ( utf_ % ( n ) s ? utf_ % ( n ) s : " " ) ; env - > ReleaseStringUTFChars ( % ( n ) s , utf_ % ( n ) s ) ' , <nl> + ' suffix ' : ' Ljava_lang_String_2 ' , <nl> + ' j_import ' : ' java . lang . String ' <nl> + } , <nl> } <nl> <nl> # Defines a rule to add extra prefixes for names from specific namespaces . <nl> def gen_func ( self , ci , fi , prop_name = ' ' ) : <nl> ret = " return ( jlong ) _retval_ ; " <nl> else : # returned as jobject <nl> ret = " return _retval_ ; " <nl> - elif fi . ctype = = " String " : <nl> + elif fi . ctype in [ ' String ' , ' string ' ] : <nl> ret = " return env - > NewStringUTF ( _retval_ . c_str ( ) ) ; " <nl> default = ' return env - > NewStringUTF ( " " ) ; ' <nl> elif self . isWrapped ( fi . ctype ) : # wrapped class : <nl> def gen_func ( self , ci , fi , prop_name = ' ' ) : <nl> retval = " " <nl> elif fi . ctype = = " String " : <nl> retval = " cv : : " + retval <nl> + elif fi . ctype = = " string " : <nl> + retval = " std : : " + retval <nl> elif " v_type " in type_dict [ fi . ctype ] : # vector is returned <nl> retval = type_dict [ fi . ctype ] [ ' jni_var ' ] % { " n " : ' _ret_val_vector_ ' } + " = " <nl> if type_dict [ fi . ctype ] [ " v_type " ] in ( " Mat " , " vector_Mat " ) : <nl> new file mode 100644 <nl> index 00000000000 . . 43cef7e79e7 <nl> mmm / dev / null <nl> ppp b / modules / objdetect / misc / java / test / QRCodeDetectorTest . java <nl> <nl> + package org . opencv . test . objdetect ; <nl> + <nl> + import org . opencv . core . Mat ; <nl> + import org . opencv . objdetect . QRCodeDetector ; <nl> + import org . opencv . imgcodecs . Imgcodecs ; <nl> + import org . opencv . objdetect . Objdetect ; <nl> + import org . opencv . test . OpenCVTestCase ; <nl> + import org . opencv . test . OpenCVTestRunner ; <nl> + <nl> + public class QRCodeDetectorTest extends OpenCVTestCase { <nl> + <nl> + private final static String ENV_OPENCV_TEST_DATA_PATH = " OPENCV_TEST_DATA_PATH " ; <nl> + private String testDataPath ; <nl> + <nl> + @ Override <nl> + protected void setUp ( ) throws Exception { <nl> + super . setUp ( ) ; <nl> + <nl> + testDataPath = System . getenv ( ENV_OPENCV_TEST_DATA_PATH ) ; <nl> + if ( testDataPath = = null ) <nl> + throw new Exception ( ENV_OPENCV_TEST_DATA_PATH + " has to be defined ! " ) ; <nl> + } <nl> + <nl> + public void testDetectAndDecode ( ) { <nl> + Mat img = Imgcodecs . imread ( testDataPath + " / cv / qrcode / link_ocv . jpg " ) ; <nl> + QRCodeDetector detector = new QRCodeDetector ( ) ; <nl> + String output = detector . detectAndDecode ( img ) ; <nl> + assertEquals ( output , " https : / / opencv . org / " ) ; <nl> + } <nl> + <nl> + } <nl>
|
Merge pull request from dkurt : fix_qrcode_decode_java
|
opencv/opencv
|
4c2100e02c84242f3fe31cb3353683e45c401ab3
|
2019-04-05T14:15:51Z
|
mmm a / src / perfmon / core . hpp <nl> ppp b / src / perfmon / core . hpp <nl> <nl> # include < set > <nl> <nl> # include " containers / intrusive_list . hpp " <nl> - # include " containers / scoped_regex . hpp " <nl> # include " containers / scoped . hpp " <nl> # include " utils . hpp " <nl> # include " concurrency / rwi_lock . hpp " <nl> <nl> class perfmon_collection_t ; <nl> class perfmon_result_t ; <nl> + class scoped_regex_t ; <nl> <nl> / * The perfmon ( short for " PERFormance MONitor " ) is responsible for gathering <nl> * data about various parts of the server . <nl>
|
Made perfmon / core . hpp not include scoped_regex . hpp .
|
rethinkdb/rethinkdb
|
d6d443f45dfcc9fc32503f391ef85cbf1b2ff76d
|
2013-05-29T02:16:04Z
|
mmm a / . cicd / platforms / macos - 10 . 14 . sh <nl> ppp b / . cicd / platforms / macos - 10 . 14 . sh <nl> mkdir - p cmake - build <nl> cd cmake - build <nl> cmake - DCMAKE_BUILD_TYPE = Release - DCMAKE_INSTALL_PREFIX = ' / usr / local ' - DENABLE_BSON = ON - DENABLE_SSL = DARWIN - DENABLE_AUTOMATIC_INIT_AND_CLEANUP = OFF - DENABLE_STATIC = ON - DENABLE_ICU = OFF - DENABLE_SASL = OFF - DENABLE_SNAPPY = OFF . . <nl> make - j12 <nl> - make install <nl> + sudo make install <nl> cd . . / . . <nl> rm mongo - c - driver - 1 . 13 . 0 . tar . gz <nl> <nl> tar - xzf mongo - cxx - driver - r3 . 4 . 0 . tar . gz <nl> cd mongo - cxx - driver - r3 . 4 . 0 / build <nl> cmake - DBUILD_SHARED_LIBS = OFF - DCMAKE_BUILD_TYPE = Release - DCMAKE_INSTALL_PREFIX = ' / usr / local ' . . <nl> make - j12 VERBOSE = 1 <nl> - make install <nl> + sudo make install <nl> cd . . / . . <nl> rm - f mongo - cxx - driver - r3 . 4 . 0 . tar . gz <nl>
|
quick fixes
|
EOSIO/eos
|
d16c21d59a4f0fd57861d35cc3bb1715bdb15bce
|
2019-08-29T17:39:37Z
|
mmm a / arangod / GeneralServer / VppCommTask . cpp <nl> ppp b / arangod / GeneralServer / VppCommTask . cpp <nl> <nl> # include " GeneralServer / GeneralServerFeature . h " <nl> # include " GeneralServer / RestHandler . h " <nl> # include " GeneralServer / RestHandlerFactory . h " <nl> + # include " Rest / CommonDefines . h " <nl> # include " Logger / LoggerFeature . h " <nl> # include " Scheduler / Scheduler . h " <nl> # include " Scheduler / SchedulerFeature . h " <nl> std : : unique_ptr < basics : : StringBuffer > createChunkForNetworkSingle ( <nl> VppCommTask : : VppCommTask ( GeneralServer * server , TRI_socket_t sock , <nl> ConnectionInfo & & info , double timeout ) <nl> : Task ( " VppCommTask " ) , <nl> - GeneralCommTask ( server , sock , std : : move ( info ) , timeout ) { <nl> + GeneralCommTask ( server , sock , std : : move ( info ) , timeout ) , <nl> + _headerOptions ( VPackOptions : : Defaults ) { <nl> _protocol = " vpp " ; <nl> _readBuffer - > reserve ( <nl> _bufferLength ) ; / / ATTENTION < - this is required so we do not <nl> / / loose information during a resize <nl> / / connectionStatisticsAgentSetVpp ( ) ; <nl> + _headerOptions . attributeTranslator = <nl> + basics : : VelocyPackHelper : : getHeaderTranslator ( ) ; <nl> } <nl> <nl> void VppCommTask : : addResponse ( VppResponse * response ) { <nl> bool VppCommTask : : processRead ( ) { <nl> if ( doExecute ) { <nl> VPackSlice header = message . header ( ) ; <nl> LOG_TOPIC ( DEBUG , Logger : : COMMUNICATION ) <nl> - < < " got request : " < < header . toJson ( ) ; <nl> + < < " got request : " < < header . toJson ( & _headerOptions ) ; <nl> int type = meta : : underlyingValue ( GeneralRequest : : RequestType : : ILLEGAL ) ; <nl> try { <nl> type = header . get ( " type " ) . getInt ( ) ; <nl> bool VppCommTask : : processRead ( ) { <nl> / / the handler will take ownersip of this pointer <nl> std : : unique_ptr < VppRequest > request ( new VppRequest ( <nl> _connectionInfo , std : : move ( message ) , chunkHeader . _messageID ) ) ; <nl> + request - > setHeaderOptions ( & _headerOptions ) ; <nl> GeneralServerFeature : : HANDLER_FACTORY - > setRequestContext ( request . get ( ) ) ; <nl> / / make sure we have a database <nl> if ( request - > requestContext ( ) = = nullptr ) { <nl> bool VppCommTask : : processRead ( ) { <nl> std : : unique_ptr < VppResponse > response ( <nl> new VppResponse ( GeneralResponse : : ResponseCode : : SERVER_ERROR , <nl> chunkHeader . _messageID ) ) ; <nl> + response - > setHeaderOptions ( & _headerOptions ) ; <nl> executeRequest ( std : : move ( request ) , std : : move ( response ) ) ; <nl> } <nl> } <nl> mmm a / arangod / GeneralServer / VppCommTask . h <nl> ppp b / arangod / GeneralServer / VppCommTask . h <nl> class VppCommTask : public GeneralCommTask { <nl> / / will be cleaned <nl> } ; <nl> ProcessReadVariables _processReadVariables ; <nl> + velocypack : : Options _headerOptions ; <nl> <nl> struct ChunkHeader { <nl> std : : size_t _headerLength ; <nl> mmm a / lib / Basics / VelocyPackHelper . cpp <nl> ppp b / lib / Basics / VelocyPackHelper . cpp <nl> unsigned long long XXH64 ( const void * input , size_t length , <nl> using VelocyPackHelper = arangodb : : basics : : VelocyPackHelper ; <nl> <nl> static std : : unique_ptr < VPackAttributeTranslator > Translator ; <nl> + static std : : unique_ptr < VPackAttributeTranslator > HeaderTranslator ; <nl> static std : : unique_ptr < VPackAttributeExcludeHandler > ExcludeHandler ; <nl> <nl> / / attribute exclude handler for skipping over system attributes <nl> void VelocyPackHelper : : initialize ( ) { <nl> TRI_ASSERT ( VPackSlice ( Translator - > translate ( ToAttribute - AttributeBase ) ) <nl> . copyString ( ) = = StaticStrings : : ToString ) ; <nl> <nl> + HeaderTranslator . reset ( new VPackAttributeTranslator ) ; <nl> + HeaderTranslator - > add ( " version " , 6 ) ; <nl> + HeaderTranslator - > add ( " type " , 7 ) ; <nl> + HeaderTranslator - > add ( " database " , 8 ) ; <nl> + HeaderTranslator - > add ( " requestType " , 9 ) ; <nl> + HeaderTranslator - > add ( " request " , 0 ) ; <nl> + HeaderTranslator - > add ( " parameter " , - 1 ) ; <nl> + HeaderTranslator - > add ( " meta " , - 2 ) ; <nl> + HeaderTranslator - > add ( " responseCode " , - 3 ) ; <nl> + HeaderTranslator - > seal ( ) ; <nl> + <nl> / / initialize exclude handler for system attributes <nl> ExcludeHandler . reset ( new SystemAttributeExcludeHandler ) ; <nl> } <nl> arangodb : : velocypack : : AttributeTranslator * VelocyPackHelper : : getTranslator ( ) { <nl> return Translator . get ( ) ; <nl> } <nl> <nl> + arangodb : : velocypack : : AttributeTranslator * <nl> + VelocyPackHelper : : getHeaderTranslator ( ) { <nl> + return HeaderTranslator . get ( ) ; <nl> + } <nl> + <nl> bool VelocyPackHelper : : AttributeSorterUTF8 : : operator ( ) ( <nl> std : : string const & l , std : : string const & r ) const { <nl> / / use UTF - 8 - based comparison of attribute names <nl> mmm a / lib / Basics / VelocyPackHelper . h <nl> ppp b / lib / Basics / VelocyPackHelper . h <nl> class VelocyPackHelper { <nl> <nl> static arangodb : : velocypack : : AttributeExcludeHandler * getExcludeHandler ( ) ; <nl> static arangodb : : velocypack : : AttributeTranslator * getTranslator ( ) ; <nl> + static arangodb : : velocypack : : AttributeTranslator * getHeaderTranslator ( ) ; <nl> <nl> struct VPackHash { <nl> size_t operator ( ) ( arangodb : : velocypack : : Slice const & ) const ; <nl> mmm a / lib / Rest / CommonDefines . h <nl> ppp b / lib / Rest / CommonDefines . h <nl> <nl> <nl> namespace arangodb { <nl> <nl> - enum class ContentType { <nl> - CUSTOM , / / use Content - Type from _headers <nl> - JSON , / / application / json <nl> - VPACK , / / application / x - velocypack <nl> - TEXT , / / text / plain <nl> - HTML , / / text / html <nl> - DUMP , / / application / x - arango - dump <nl> - UNSET <nl> - } ; <nl> - <nl> - enum class ProtocolVersion { HTTP_1_0 , HTTP_1_1 , VPP_1_0 , UNKNOWN } ; <nl> - <nl> - enum ConnectionType { <nl> - CONNECTION_NONE , <nl> - CONNECTION_KEEP_ALIVE , <nl> - CONNECTION_CLOSE <nl> - } ; <nl> - / / VSTREAM_CRED : This method is used for sending Authentication <nl> - / / request , i . e ; username and password . <nl> + / / enum class ContentType { <nl> + / / CUSTOM , / / use Content - Type from _headers <nl> + / / JSON , / / application / json <nl> + / / VPACK , / / application / x - velocypack <nl> + / / TEXT , / / text / plain <nl> + / / HTML , / / text / html <nl> + / / DUMP , / / application / x - arango - dump <nl> + / / UNSET <nl> + / / } ; <nl> / / <nl> - / / VSTREAM_REGISTER : This Method is used for registering event of <nl> - / / some kind <nl> + / / enum class ProtocolVersion { HTTP_1_0 , HTTP_1_1 , VPP_1_0 , UNKNOWN } ; <nl> / / <nl> - / / VSTREAM_STATUS : Returns STATUS code and message for a given <nl> - / / request <nl> - enum class RequestType { <nl> - DELETE_REQ = 0 , / / windows redefines DELETE <nl> - GET , <nl> - HEAD , <nl> - OPTIONS , <nl> - POST , <nl> - PUT , <nl> - PATCH , <nl> - VSTREAM_CRED , <nl> - VSTREAM_REGISTER , <nl> - VSTREAM_STATUS , <nl> - ILLEGAL / / must be last <nl> - } ; <nl> - <nl> - enum class ResponseCode { <nl> - CONTINUE = 100 , <nl> - SWITCHING_PROTOCOLS = 101 , <nl> - PROCESSING = 102 , <nl> - <nl> - OK = 200 , <nl> - CREATED = 201 , <nl> - ACCEPTED = 202 , <nl> - PARTIAL = 203 , <nl> - NO_CONTENT = 204 , <nl> - RESET_CONTENT = 205 , <nl> - PARTIAL_CONTENT = 206 , <nl> - <nl> - MOVED_PERMANENTLY = 301 , <nl> - FOUND = 302 , <nl> - SEE_OTHER = 303 , <nl> - NOT_MODIFIED = 304 , <nl> - TEMPORARY_REDIRECT = 307 , <nl> - PERMANENT_REDIRECT = 308 , <nl> - <nl> - BAD = 400 , <nl> - UNAUTHORIZED = 401 , <nl> - PAYMENT_REQUIRED = 402 , <nl> - FORBIDDEN = 403 , <nl> - NOT_FOUND = 404 , <nl> - METHOD_NOT_ALLOWED = 405 , <nl> - NOT_ACCEPTABLE = 406 , <nl> - REQUEST_TIMEOUT = 408 , <nl> - CONFLICT = 409 , <nl> - GONE = 410 , <nl> - LENGTH_REQUIRED = 411 , <nl> - PRECONDITION_FAILED = 412 , <nl> - REQUEST_ENTITY_TOO_LARGE = 413 , <nl> - REQUEST_URI_TOO_LONG = 414 , <nl> - UNSUPPORTED_MEDIA_TYPE = 415 , <nl> - REQUESTED_RANGE_NOT_SATISFIABLE = 416 , <nl> - EXPECTATION_FAILED = 417 , <nl> - I_AM_A_TEAPOT = 418 , <nl> - UNPROCESSABLE_ENTITY = 422 , <nl> - LOCKED = 423 , <nl> - PRECONDITION_REQUIRED = 428 , <nl> - TOO_MANY_REQUESTS = 429 , <nl> - REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , <nl> - UNAVAILABLE_FOR_LEGAL_REASONS = 451 , <nl> - <nl> - SERVER_ERROR = 500 , <nl> - NOT_IMPLEMENTED = 501 , <nl> - BAD_GATEWAY = 502 , <nl> - SERVICE_UNAVAILABLE = 503 , <nl> - HTTP_VERSION_NOT_SUPPORTED = 505 , <nl> - BANDWIDTH_LIMIT_EXCEEDED = 509 , <nl> - NOT_EXTENDED = 510 <nl> - } ; <nl> + / / enum ConnectionType { <nl> + / / CONNECTION_NONE , <nl> + / / CONNECTION_KEEP_ALIVE , <nl> + / / CONNECTION_CLOSE <nl> + / / } ; <nl> + / / / / VSTREAM_CRED : This method is used for sending Authentication <nl> + / / / / request , i . e ; username and password . <nl> + / / / / <nl> + / / / / VSTREAM_REGISTER : This Method is used for registering event of <nl> + / / / / some kind <nl> + / / / / <nl> + / / / / VSTREAM_STATUS : Returns STATUS code and message for a given <nl> + / / / / request <nl> + / / enum class RequestType { <nl> + / / DELETE_REQ = 0 , / / windows redefines DELETE <nl> + / / GET , <nl> + / / HEAD , <nl> + / / OPTIONS , <nl> + / / POST , <nl> + / / PUT , <nl> + / / PATCH , <nl> + / / VSTREAM_CRED , <nl> + / / VSTREAM_REGISTER , <nl> + / / VSTREAM_STATUS , <nl> + / / ILLEGAL / / must be last <nl> + / / } ; <nl> + / / <nl> + / / enum class ResponseCode { <nl> + / / CONTINUE = 100 , <nl> + / / SWITCHING_PROTOCOLS = 101 , <nl> + / / PROCESSING = 102 , <nl> + / / <nl> + / / OK = 200 , <nl> + / / CREATED = 201 , <nl> + / / ACCEPTED = 202 , <nl> + / / PARTIAL = 203 , <nl> + / / NO_CONTENT = 204 , <nl> + / / RESET_CONTENT = 205 , <nl> + / / PARTIAL_CONTENT = 206 , <nl> + / / <nl> + / / MOVED_PERMANENTLY = 301 , <nl> + / / FOUND = 302 , <nl> + / / SEE_OTHER = 303 , <nl> + / / NOT_MODIFIED = 304 , <nl> + / / TEMPORARY_REDIRECT = 307 , <nl> + / / PERMANENT_REDIRECT = 308 , <nl> + / / <nl> + / / BAD = 400 , <nl> + / / UNAUTHORIZED = 401 , <nl> + / / PAYMENT_REQUIRED = 402 , <nl> + / / FORBIDDEN = 403 , <nl> + / / NOT_FOUND = 404 , <nl> + / / METHOD_NOT_ALLOWED = 405 , <nl> + / / NOT_ACCEPTABLE = 406 , <nl> + / / REQUEST_TIMEOUT = 408 , <nl> + / / CONFLICT = 409 , <nl> + / / GONE = 410 , <nl> + / / LENGTH_REQUIRED = 411 , <nl> + / / PRECONDITION_FAILED = 412 , <nl> + / / REQUEST_ENTITY_TOO_LARGE = 413 , <nl> + / / REQUEST_URI_TOO_LONG = 414 , <nl> + / / UNSUPPORTED_MEDIA_TYPE = 415 , <nl> + / / REQUESTED_RANGE_NOT_SATISFIABLE = 416 , <nl> + / / EXPECTATION_FAILED = 417 , <nl> + / / I_AM_A_TEAPOT = 418 , <nl> + / / UNPROCESSABLE_ENTITY = 422 , <nl> + / / LOCKED = 423 , <nl> + / / PRECONDITION_REQUIRED = 428 , <nl> + / / TOO_MANY_REQUESTS = 429 , <nl> + / / REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , <nl> + / / UNAVAILABLE_FOR_LEGAL_REASONS = 451 , <nl> + / / <nl> + / / SERVER_ERROR = 500 , <nl> + / / NOT_IMPLEMENTED = 501 , <nl> + / / BAD_GATEWAY = 502 , <nl> + / / SERVICE_UNAVAILABLE = 503 , <nl> + / / HTTP_VERSION_NOT_SUPPORTED = 505 , <nl> + / / BANDWIDTH_LIMIT_EXCEEDED = 509 , <nl> + / / NOT_EXTENDED = 510 <nl> + / / } ; <nl> } <nl> # endif <nl> mmm a / lib / Rest / VppRequest . cpp <nl> ppp b / lib / Rest / VppRequest . cpp <nl> VppRequest : : VppRequest ( ConnectionInfo const & connectionInfo , <nl> : GeneralRequest ( connectionInfo ) , <nl> _message ( std : : move ( message ) ) , <nl> _headers ( nullptr ) , <nl> - _messageId ( messageId ) { <nl> + _messageId ( messageId ) , <nl> + _headerOptions ( nullptr ) { <nl> _protocol = " vpp " ; <nl> _contentType = ContentType : : VPACK ; <nl> _contentTypeResponse = ContentType : : VPACK ; <nl> mmm a / lib / Rest / VppRequest . h <nl> ppp b / lib / Rest / VppRequest . h <nl> class VppRequest : public GeneralRequest { <nl> return arangodb : : Endpoint : : TransportType : : VPP ; <nl> } ; <nl> <nl> + void setHeaderOptions ( VPackOptions * options ) { _headerOptions = options ; } <nl> + <nl> std : : unordered_map < std : : string , std : : string > const & headers ( ) const override ; <nl> / / get value from headers map . The key must be lowercase . <nl> std : : string const & header ( std : : string const & key ) const override ; <nl> class VppRequest : public GeneralRequest { <nl> std : : unordered_map < std : : string , std : : vector < std : : string > > _arrayValues ; <nl> uint64_t _messageId ; <nl> const std : : unordered_map < std : : string , std : : string > _cookies ; / / TODO remove <nl> + VPackOptions * _headerOptions ; <nl> <nl> void parseHeaderInformation ( ) ; <nl> } ; <nl> mmm a / lib / Rest / VppResponse . cpp <nl> ppp b / lib / Rest / VppResponse . cpp <nl> <nl> # include < velocypack / Builder . h > <nl> # include < velocypack / Dumper . h > <nl> # include < velocypack / Options . h > <nl> + # include < velocypack / AttributeTranslator . h > <nl> + # include < velocypack / Buffer . h > <nl> # include < velocypack / velocypack - aliases . h > <nl> <nl> # include " Basics / Exceptions . h " <nl> <nl> # include " Meta / conversion . h " <nl> # include " Rest / VppRequest . h " <nl> <nl> + # include " CommonDefines . h " <nl> + <nl> using namespace arangodb ; <nl> using namespace arangodb : : basics ; <nl> <nl> bool VppResponse : : HIDE_PRODUCT_HEADER = false ; <nl> <nl> VppResponse : : VppResponse ( ResponseCode code , uint64_t id ) <nl> - : GeneralResponse ( code ) , _header ( nullptr ) , _payload ( ) , _messageId ( id ) { <nl> + : GeneralResponse ( code ) , <nl> + _header ( nullptr ) , <nl> + _payload ( ) , <nl> + _messageId ( id ) , <nl> + _headerOptions ( nullptr ) { <nl> _contentType = ContentType : : VPACK ; <nl> _connectionType = CONNECTION_KEEP_ALIVE ; <nl> } <nl> void VppResponse : : setPayload ( arangodb : : velocypack : : Slice const & slice , <nl> VPackMessageNoOwnBuffer VppResponse : : prepareForNetwork ( ) { <nl> / / initalize builder with vpackbuffer . then we do not need to <nl> / / steal the header and can avoid the shared pointer <nl> - VPackBuilder builder ; <nl> + <nl> + / / VPackBuffer < uint8_t > buffer ; <nl> + / / VPackBuilder builder ( buffer ) ; <nl> + VPackBuilder builder ( _headerOptions ) ; <nl> builder . openObject ( ) ; <nl> builder . add ( " version " , VPackValue ( int ( 1 ) ) ) ; <nl> - builder . add ( " type " , VPackValue ( int ( 1 ) ) ) ; / / 2 = = response <nl> + builder . add ( " type " , VPackValue ( int ( 2 ) ) ) ; / / 2 = = response <nl> builder . add ( <nl> " responseCode " , <nl> VPackValue ( static_cast < int > ( meta : : underlyingValue ( _responseCode ) ) ) ) ; <nl> builder . close ( ) ; <nl> + <nl> + / / options . Defaults . attributeTranslator = nullptr ; <nl> + <nl> _header = builder . steal ( ) ; <nl> return VPackMessageNoOwnBuffer ( VPackSlice ( _header - > data ( ) ) , <nl> VPackSlice ( _payload . data ( ) ) , _messageId , <nl> mmm a / lib / Rest / VppResponse . h <nl> ppp b / lib / Rest / VppResponse . h <nl> class VppResponse : public GeneralResponse { <nl> return arangodb : : Endpoint : : TransportType : : VPP ; <nl> } ; <nl> <nl> + void setHeaderOptions ( VPackOptions * options ) { _headerOptions = options ; } <nl> + <nl> VPackMessageNoOwnBuffer prepareForNetwork ( ) ; <nl> <nl> private : <nl> class VppResponse : public GeneralResponse { <nl> VPackBuffer < uint8_t > _payload ; <nl> uint64_t _messageId ; <nl> bool _generateBody ; / / this must be true if payload should be send <nl> + VPackOptions * _headerOptions ; <nl> } ; <nl> } <nl> <nl>
|
add translator to VelocyPackHelper and headerOption to Vpp Protocol
|
arangodb/arangodb
|
8f5e6f65d68d92c0c238a83f11d86cc817142fae
|
2016-08-23T11:05:50Z
|
mmm a / src / mongo / db / repl / replication_coordinator_impl . cpp <nl> ppp b / src / mongo / db / repl / replication_coordinator_impl . cpp <nl> ReplicationCoordinatorImpl : : _updateMemberStateFromTopologyCoordinator ( WithLock l <nl> / / When we try to make ( 1 , 2 ) the commit point , we ' d find ( 0 , 2 ) as the newest snapshot <nl> / / before the commit point , but it would be invalid to mark it as the committed snapshot <nl> / / since it was never committed . <nl> - / / <nl> - / / TODO SERVER - 19209 We also need to clear snapshots before a resync . <nl> _dropAllSnapshots_inlock ( ) ; <nl> } <nl> <nl>
|
SERVER - 43455 remove todo for SERVER - 19209
|
mongodb/mongo
|
21d3803a7a59644a5191849f150b9d57af383066
|
2019-10-18T15:39:00Z
|
mmm a / lib / Parse / ParseDecl . cpp <nl> ppp b / lib / Parse / ParseDecl . cpp <nl> void Parser : : parseDeclListDelayed ( IterableDeclContext * IDC ) { <nl> / / Re - enter the lexical scope . <nl> Scope S ( this , DelayedState - > takeScope ( ) ) ; <nl> ContextChange CC ( * this , DelayedState - > ParentContext ) ; <nl> - auto * ext = cast < ExtensionDecl > ( IDC ) ; <nl> + Decl * D = const_cast < Decl * > ( IDC - > getDecl ( ) ) ; <nl> SourceLoc LBLoc = consumeToken ( tok : : l_brace ) ; <nl> SourceLoc RBLoc ; <nl> - parseDeclList ( ext - > getBraces ( ) . Start , RBLoc , diag : : expected_rbrace_extension , <nl> - ParseDeclOptions ( DelayedState - > Flags ) , <nl> - [ & ] ( Decl * D ) { ext - > addMember ( D ) ; } ) ; <nl> - ext - > setBraces ( { LBLoc , RBLoc } ) ; <nl> + Diag < > Id ; <nl> + switch ( D - > getKind ( ) ) { <nl> + case DeclKind : : Extension : Id = diag : : expected_rbrace_extension ; break ; <nl> + case DeclKind : : Enum : Id = diag : : expected_rbrace_enum ; break ; <nl> + case DeclKind : : Protocol : Id = diag : : expected_rbrace_protocol ; break ; <nl> + case DeclKind : : Class : Id = diag : : expected_rbrace_class ; break ; <nl> + case DeclKind : : Struct : Id = diag : : expected_rbrace_struct ; break ; <nl> + default : <nl> + llvm_unreachable ( " Bad iterable decl context kinds . " ) ; <nl> + } <nl> + if ( auto * ext = dyn_cast < ExtensionDecl > ( D ) ) { <nl> + parseDeclList ( ext - > getBraces ( ) . Start , RBLoc , Id , <nl> + ParseDeclOptions ( DelayedState - > Flags ) , <nl> + [ & ] ( Decl * D ) { ext - > addMember ( D ) ; } ) ; <nl> + ext - > setBraces ( { LBLoc , RBLoc } ) ; <nl> + } else { <nl> + auto * ntd = cast < NominalTypeDecl > ( D ) ; <nl> + parseDeclList ( ntd - > getBraces ( ) . Start , RBLoc , Id , <nl> + ParseDeclOptions ( DelayedState - > Flags ) , <nl> + [ & ] ( Decl * D ) { ntd - > addMember ( D ) ; } ) ; <nl> + ntd - > setBraces ( { LBLoc , RBLoc } ) ; <nl> + } <nl> } <nl> <nl> void Parser : : parseDeclDelayed ( ) { <nl> ParserResult < EnumDecl > Parser : : parseDeclEnum ( ParseDeclOptions Flags , <nl> <nl> SyntaxParsingContext BlockContext ( SyntaxContext , SyntaxKind : : MemberDeclBlock ) ; <nl> SourceLoc LBLoc , RBLoc ; <nl> + SourceLoc PosBeforeLB = Tok . getLoc ( ) ; <nl> if ( parseToken ( tok : : l_brace , LBLoc , diag : : expected_lbrace_enum ) ) { <nl> LBLoc = PreviousLoc ; <nl> RBLoc = LBLoc ; <nl> ParserResult < EnumDecl > Parser : : parseDeclEnum ( ParseDeclOptions Flags , <nl> } else { <nl> Scope S ( this , ScopeKind : : ClassBody ) ; <nl> ParseDeclOptions Options ( PD_HasContainerType | PD_AllowEnumElement | PD_InEnum ) ; <nl> - if ( parseDeclList ( LBLoc , RBLoc , diag : : expected_rbrace_enum , <nl> - Options , [ & ] ( Decl * D ) { ED - > addMember ( D ) ; } ) ) <nl> - Status . setIsParseError ( ) ; <nl> + if ( canDelayBodyParsing ( ) ) { <nl> + if ( Tok . is ( tok : : r_brace ) ) { <nl> + RBLoc = consumeToken ( ) ; <nl> + } else { <nl> + RBLoc = Tok . getLoc ( ) ; <nl> + Status . setIsParseError ( ) ; <nl> + } <nl> + State - > delayDeclList ( ED , Options . toRaw ( ) , CurDeclContext , { LBLoc , RBLoc } , <nl> + PosBeforeLB ) ; <nl> + } else { <nl> + if ( parseDeclList ( LBLoc , RBLoc , diag : : expected_rbrace_enum , <nl> + Options , [ & ] ( Decl * D ) { ED - > addMember ( D ) ; } ) ) <nl> + Status . setIsParseError ( ) ; <nl> + } <nl> } <nl> <nl> ED - > setBraces ( { LBLoc , RBLoc } ) ; <nl>
|
Merge pull request from nkcsgexi / parse - enum
|
apple/swift
|
0c4ee41c482e5fb420d98ac706fe126374a2e26e
|
2018-09-07T02:35:52Z
|
mmm a / templates / cocos2dx_files . json <nl> ppp b / templates / cocos2dx_files . json <nl> <nl> " tools / framework - compile / bin - templates / lua - template - runtime / src / app / MyApp . lua " , <nl> " tools / framework - compile / bin - templates / lua - template - runtime / src / app / views / MainScene . lua " , <nl> " tools / framework - compile / bin - templates / lua - template - runtime / src / config . lua " , <nl> - " tools / gen - prebuilt / README . md " , <nl> - " tools / gen - prebuilt / build_config . json " , <nl> - " tools / gen - prebuilt / excopy . py " , <nl> - " tools / gen - prebuilt / gen_prebuilt_libs . py " , <nl> - " tools / gen - prebuilt / module_config . json " , <nl> - " tools / gen - prebuilt / module_organize . py " , <nl> " tools / missing - tools . txt " , <nl> " tools / particle / convert_YCoordFlipped . py " , <nl> " tools / simulator / . cocos - project . json " , <nl>
|
[ AUTO ] [ ci skip ] : updating cocos2dx_files . json
|
cocos2d/cocos2d-x
|
f751234b7f51fff4b25bced46385d25c11538ba3
|
2015-07-27T05:38:54Z
|
mmm a / src / Parsers / ASTAssignment . h <nl> ppp b / src / Parsers / ASTAssignment . h <nl> class ASTAssignment : public IAST <nl> { <nl> public : <nl> String column_name ; <nl> - ASTPtr expression ; <nl> + <nl> + ASTPtr expression ( ) const <nl> + { <nl> + return children . at ( 0 ) ; <nl> + } <nl> <nl> String getID ( char delim ) const override { return " Assignment " + ( delim + column_name ) ; } <nl> <nl> ASTPtr clone ( ) const override <nl> { <nl> auto res = std : : make_shared < ASTAssignment > ( * this ) ; <nl> - res - > children . clear ( ) ; <nl> - <nl> - if ( expression ) <nl> - { <nl> - res - > expression = expression - > clone ( ) ; <nl> - res - > children . push_back ( res - > expression ) ; <nl> - } <nl> - <nl> + res - > children = { expression ( ) - > clone ( ) } ; <nl> return res ; <nl> } <nl> <nl> class ASTAssignment : public IAST <nl> <nl> settings . ostr < < ( settings . hilite ? hilite_operator : " " ) < < " = " < < ( settings . hilite ? hilite_none : " " ) ; <nl> <nl> - expression - > formatImpl ( settings , state , frame ) ; <nl> + expression ( ) - > formatImpl ( settings , state , frame ) ; <nl> } <nl> } ; <nl> <nl> mmm a / src / Parsers / ParserAlterQuery . cpp <nl> ppp b / src / Parsers / ParserAlterQuery . cpp <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> } <nl> else <nl> return false ; <nl> - <nl> } <nl> <nl> if ( command - > col_decl ) <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> command - > children . push_back ( command - > order_by ) ; <nl> if ( command - > sample_by ) <nl> command - > children . push_back ( command - > sample_by ) ; <nl> + if ( command - > index_decl ) <nl> + command - > children . push_back ( command - > index_decl ) ; <nl> + if ( command - > index ) <nl> + command - > children . push_back ( command - > index ) ; <nl> + if ( command - > constraint_decl ) <nl> + command - > children . push_back ( command - > constraint_decl ) ; <nl> + if ( command - > constraint ) <nl> + command - > children . push_back ( command - > constraint ) ; <nl> if ( command - > predicate ) <nl> command - > children . push_back ( command - > predicate ) ; <nl> if ( command - > update_assignments ) <nl> bool ParserAlterCommand : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected <nl> command - > children . push_back ( command - > ttl ) ; <nl> if ( command - > settings_changes ) <nl> command - > children . push_back ( command - > settings_changes ) ; <nl> + if ( command - > select ) <nl> + command - > children . push_back ( command - > select ) ; <nl> + if ( command - > rename_to ) <nl> + command - > children . push_back ( command - > rename_to ) ; <nl> <nl> return true ; <nl> } <nl> bool ParserAssignment : : parseImpl ( Pos & pos , ASTPtr & node , Expected & expected ) <nl> if ( ! s_equals . ignore ( pos , expected ) ) <nl> return false ; <nl> <nl> - if ( ! p_expression . parse ( pos , assignment - > expression , expected ) ) <nl> + ASTPtr expression ; <nl> + if ( ! p_expression . parse ( pos , expression , expected ) ) <nl> return false ; <nl> <nl> tryGetIdentifierNameInto ( column , assignment - > column_name ) ; <nl> - if ( assignment - > expression ) <nl> - assignment - > children . push_back ( assignment - > expression ) ; <nl> + if ( expression ) <nl> + assignment - > children . push_back ( expression ) ; <nl> <nl> return true ; <nl> } <nl> mmm a / src / Storages / MutationCommands . cpp <nl> ppp b / src / Storages / MutationCommands . cpp <nl> std : : optional < MutationCommand > MutationCommand : : parse ( ASTAlterCommand * command , <nl> for ( const ASTPtr & assignment_ast : command - > update_assignments - > children ) <nl> { <nl> const auto & assignment = assignment_ast - > as < ASTAssignment & > ( ) ; <nl> - auto insertion = res . column_to_update_expression . emplace ( assignment . column_name , assignment . expression ) ; <nl> + auto insertion = res . column_to_update_expression . emplace ( assignment . column_name , assignment . expression ( ) ) ; <nl> if ( ! insertion . second ) <nl> throw Exception ( " Multiple assignments in the single statement to column " + backQuote ( assignment . column_name ) , <nl> ErrorCodes : : MULTIPLE_ASSIGNMENTS_TO_COLUMN ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 8e6c69b87b2 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01599_mutation_query_params . reference <nl> <nl> + 2 1 <nl> + 1 1 <nl> new file mode 100755 <nl> index 00000000000 . . 6bc12b5409e <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01599_mutation_query_params . sh <nl> <nl> + # ! / usr / bin / env bash <nl> + <nl> + CURDIR = $ ( cd " $ ( dirname " $ { BASH_SOURCE [ 0 ] } " ) " & & pwd ) <nl> + . " $ CURDIR " / . . / shell_config . sh <nl> + <nl> + <nl> + $ CLICKHOUSE_CLIENT - n - - query " <nl> + DROP TABLE IF EXISTS test ; <nl> + <nl> + CREATE TABLE test <nl> + ( <nl> + id UUID , <nl> + date_time DateTime , <nl> + x UInt32 , <nl> + y UInt32 <nl> + ) ENGINE = MergeTree ( ) <nl> + PARTITION BY toYYYYMMDD ( date_time ) <nl> + ORDER BY ( date_time ) ; <nl> + <nl> + INSERT INTO test ( x , y ) VALUES ( 2 , 1 ) ; <nl> + " <nl> + <nl> + $ CLICKHOUSE_CLIENT - - query " SELECT x , y FROM test " <nl> + <nl> + $ CLICKHOUSE_CLIENT - - mutations_sync 1 - - param_x 1 - - param_y 1 - - query " <nl> + ALTER TABLE test <nl> + UPDATE x = { x : UInt32 } <nl> + WHERE y = { y : UInt32 } ; <nl> + " <nl> + <nl> + $ CLICKHOUSE_CLIENT - - query " SELECT x , y FROM test " <nl> + $ CLICKHOUSE_CLIENT - - query " DROP TABLE test " <nl>
|
Merge pull request from ClickHouse / parser - alter - missing - code
|
ClickHouse/ClickHouse
|
df90cbd7d34059d22e16c6ab4775f43f16e6faba
|
2020-11-30T06:38:14Z
|
mmm a / include / flatbuffers / flatbuffers . h <nl> ppp b / include / flatbuffers / flatbuffers . h <nl> class vector_downward { <nl> uint8_t * make_space ( size_t len ) { <nl> if ( len > static_cast < size_t > ( cur_ - buf_ ) ) { <nl> auto old_size = size ( ) ; <nl> + auto largest_align = AlignOf < largest_scalar_t > ( ) ; <nl> reserved_ + = std : : max ( len , growth_policy ( reserved_ ) ) ; <nl> + / / Round up to avoid undefined behavior from unaligned loads and stores . <nl> + reserved_ = ( reserved_ + ( largest_align - 1 ) ) & ~ ( largest_align - 1 ) ; <nl> auto new_buf = allocator_ . allocate ( reserved_ ) ; <nl> auto new_cur = new_buf + reserved_ - old_size ; <nl> memcpy ( new_cur , cur_ , old_size ) ; <nl>
|
Round up allocation size to avoid misalignment ( issue )
|
google/flatbuffers
|
47aab7823387b777dfd0e9393fc81b05a288b18f
|
2015-07-02T21:05:45Z
|
mmm a / include / swift / AST / ASTContext . h <nl> ppp b / include / swift / AST / ASTContext . h <nl> class ConstraintCheckerArenaRAII { <nl> <nl> class SILLayout ; / / From SIL <nl> <nl> + / / / A set of missing witnesses for a given conformance . These are temporarily <nl> + / / / stashed in the ASTContext so the type checker can get at them . <nl> + / / / <nl> + / / / The only subclass is owned by the type checker , so it can hide its own <nl> + / / / data structures . <nl> + class MissingWitnessesBase { <nl> + public : <nl> + virtual ~ MissingWitnessesBase ( ) ; <nl> + } ; <nl> + <nl> / / / ASTContext - This object creates and owns the AST objects . <nl> / / / However , this class does more than just maintain context within an AST . <nl> / / / It is the closest thing to thread - local or compile - local storage in this <nl> class ASTContext final { <nl> takeDelayedConformanceDiags ( NormalProtocolConformance * conformance ) ; <nl> <nl> / / / Add delayed missing witnesses for the given normal protocol conformance . <nl> - void addDelayedMissingWitnesses ( NormalProtocolConformance * conformance , <nl> - ArrayRef < ValueDecl * > witnesses ) ; <nl> + void addDelayedMissingWitnesses ( <nl> + NormalProtocolConformance * conformance , <nl> + std : : unique_ptr < MissingWitnessesBase > missingWitnesses ) ; <nl> <nl> / / / Retrieve the delayed missing witnesses for the given normal protocol <nl> / / / conformance . <nl> - std : : vector < ValueDecl * > <nl> + std : : unique_ptr < MissingWitnessesBase > <nl> takeDelayedMissingWitnesses ( NormalProtocolConformance * conformance ) ; <nl> <nl> / / / Produce a specialized conformance , which takes a generic <nl> mmm a / lib / AST / ASTContext . cpp <nl> ppp b / lib / AST / ASTContext . cpp <nl> struct ASTContext : : Implementation { <nl> / / / Map from normal protocol conformances to missing witnesses that have <nl> / / / been delayed until the conformance is fully checked , so that we can <nl> / / / issue a fixit that fills the entire protocol stub . <nl> - llvm : : DenseMap < NormalProtocolConformance * , std : : vector < ValueDecl * > > <nl> + llvm : : DenseMap < <nl> + NormalProtocolConformance * , std : : unique_ptr < MissingWitnessesBase > > <nl> DelayedMissingWitnesses ; <nl> <nl> / / / Stores information about lazy deserialization of various declarations . <nl> bool ASTContext : : hasDelayedConformanceErrors ( ) const { <nl> return false ; <nl> } <nl> <nl> + MissingWitnessesBase : : ~ MissingWitnessesBase ( ) { } <nl> + <nl> void ASTContext : : addDelayedConformanceDiag ( <nl> NormalProtocolConformance * conformance , <nl> DelayedConformanceDiag fn ) { <nl> getImpl ( ) . DelayedConformanceDiags [ conformance ] . push_back ( std : : move ( fn ) ) ; <nl> } <nl> <nl> - void ASTContext : : <nl> - addDelayedMissingWitnesses ( NormalProtocolConformance * conformance , <nl> - ArrayRef < ValueDecl * > witnesses ) { <nl> - auto & bucket = getImpl ( ) . DelayedMissingWitnesses [ conformance ] ; <nl> - bucket . insert ( bucket . end ( ) , witnesses . begin ( ) , witnesses . end ( ) ) ; <nl> + void ASTContext : : addDelayedMissingWitnesses ( <nl> + NormalProtocolConformance * conformance , <nl> + std : : unique_ptr < MissingWitnessesBase > missingWitnesses ) { <nl> + getImpl ( ) . DelayedMissingWitnesses [ conformance ] = std : : move ( missingWitnesses ) ; <nl> } <nl> <nl> - std : : vector < ValueDecl * > ASTContext : : <nl> - takeDelayedMissingWitnesses ( NormalProtocolConformance * conformance ) { <nl> - std : : vector < ValueDecl * > result ; <nl> + std : : unique_ptr < MissingWitnessesBase > <nl> + ASTContext : : takeDelayedMissingWitnesses ( <nl> + NormalProtocolConformance * conformance ) { <nl> + std : : unique_ptr < MissingWitnessesBase > result ; <nl> auto known = getImpl ( ) . DelayedMissingWitnesses . find ( conformance ) ; <nl> if ( known ! = getImpl ( ) . DelayedMissingWitnesses . end ( ) ) { <nl> result = std : : move ( known - > second ) ; <nl> mmm a / lib / Sema / CSDiagnostics . cpp <nl> ppp b / lib / Sema / CSDiagnostics . cpp <nl> bool ContextualFailure : : tryProtocolConformanceFixIt ( <nl> { <nl> llvm : : SmallString < 128 > Text ; <nl> llvm : : raw_svector_ostream SS ( Text ) ; <nl> - llvm : : SetVector < ValueDecl * > missingWitnesses ; <nl> + llvm : : SetVector < MissingWitness > missingWitnesses ; <nl> for ( auto protocol : missingProtocols ) { <nl> auto conformance = NormalProtocolConformance ( <nl> nominal - > getDeclaredType ( ) , protocol , SourceLoc ( ) , nominal , <nl> bool ContextualFailure : : tryProtocolConformanceFixIt ( <nl> } <nl> <nl> for ( auto decl : missingWitnesses ) { <nl> - swift : : printRequirementStub ( decl , nominal , nominal - > getDeclaredType ( ) , <nl> + swift : : printRequirementStub ( decl . requirement , nominal , nominal - > getDeclaredType ( ) , <nl> nominal - > getStartLoc ( ) , SS ) ; <nl> } <nl> <nl> mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> class swift : : MultiConformanceChecker { <nl> llvm : : SmallVector < ValueDecl * , 16 > UnsatisfiedReqs ; <nl> llvm : : SmallVector < ConformanceChecker , 4 > AllUsedCheckers ; <nl> llvm : : SmallVector < NormalProtocolConformance * , 4 > AllConformances ; <nl> - llvm : : SetVector < ValueDecl * > MissingWitnesses ; <nl> + llvm : : SetVector < MissingWitness > MissingWitnesses ; <nl> llvm : : SmallPtrSet < ValueDecl * , 8 > CoveredMembers ; <nl> <nl> / / / Check one conformance . <nl> checkIndividualConformance ( NormalProtocolConformance * conformance , <nl> PrettyStackTraceConformance trace ( getASTContext ( ) , " type - checking " , <nl> conformance ) ; <nl> <nl> - std : : vector < ValueDecl * > revivedMissingWitnesses ; <nl> + std : : vector < MissingWitness > revivedMissingWitnesses ; <nl> switch ( conformance - > getState ( ) ) { <nl> case ProtocolConformanceState : : Incomplete : <nl> if ( conformance - > isInvalid ( ) ) { <nl> / / Revive registered missing witnesses to handle it below . <nl> - revivedMissingWitnesses = <nl> - getASTContext ( ) . takeDelayedMissingWitnesses ( conformance ) ; <nl> + if ( auto delayed = getASTContext ( ) . takeDelayedMissingWitnesses ( <nl> + conformance ) ) { <nl> + revivedMissingWitnesses = std : : move ( <nl> + static_cast < DelayedMissingWitnesses * > ( <nl> + delayed . get ( ) ) - > missingWitnesses ) ; <nl> + } <nl> <nl> / / If we have no missing witnesses for this invalid conformance , the <nl> / / conformance is invalid for other reasons , so emit diagnosis now . <nl> diagnoseMatch ( ModuleDecl * module , NormalProtocolConformance * conformance , <nl> <nl> ConformanceChecker : : ConformanceChecker ( <nl> ASTContext & ctx , NormalProtocolConformance * conformance , <nl> - llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses , <nl> + llvm : : SetVector < MissingWitness > & GlobalMissingWitnesses , <nl> bool suppressDiagnostics ) <nl> : WitnessChecker ( ctx , conformance - > getProtocol ( ) , conformance - > getType ( ) , <nl> conformance - > getDeclContext ( ) ) , <nl> printRequirementStub ( ValueDecl * Requirement , DeclContext * Adopter , <nl> / / / NoStubRequirements . <nl> static void <nl> printProtocolStubFixitString ( SourceLoc TypeLoc , ProtocolConformance * Conf , <nl> - ArrayRef < ValueDecl * > MissingWitnesses , <nl> + ArrayRef < MissingWitness > MissingWitnesses , <nl> std : : string & FixitString , <nl> llvm : : SetVector < ValueDecl * > & NoStubRequirements ) { <nl> llvm : : raw_string_ostream FixitStream ( FixitString ) ; <nl> std : : for_each ( MissingWitnesses . begin ( ) , MissingWitnesses . end ( ) , <nl> - [ & ] ( ValueDecl * VD ) { <nl> - if ( ! printRequirementStub ( VD , Conf - > getDeclContext ( ) , Conf - > getType ( ) , <nl> - TypeLoc , FixitStream ) ) { <nl> - NoStubRequirements . insert ( VD ) ; <nl> + [ & ] ( const MissingWitness & Missing ) { <nl> + if ( ! printRequirementStub ( <nl> + Missing . requirement , Conf - > getDeclContext ( ) , Conf - > getType ( ) , <nl> + TypeLoc , FixitStream ) ) { <nl> + NoStubRequirements . insert ( Missing . requirement ) ; <nl> } <nl> } ) ; <nl> } <nl> printProtocolStubFixitString ( SourceLoc TypeLoc , ProtocolConformance * Conf , <nl> / / / Filter the given array of protocol requirements and produce a new vector <nl> / / / containing the non - conflicting requirements to be implemented by the given <nl> / / / \ c Adoptee type . <nl> - static llvm : : SmallVector < ValueDecl * , 4 > <nl> - filterProtocolRequirements ( ArrayRef < ValueDecl * > Reqs , Type Adoptee ) { <nl> - llvm : : SmallVector < ValueDecl * , 4 > Filtered ; <nl> - if ( Reqs . empty ( ) ) { <nl> + static llvm : : SmallVector < MissingWitness , 4 > <nl> + filterProtocolRequirements ( <nl> + ArrayRef < MissingWitness > MissingWitnesses , Type Adoptee ) { <nl> + llvm : : SmallVector < MissingWitness , 4 > Filtered ; <nl> + if ( MissingWitnesses . empty ( ) ) { <nl> return Filtered ; <nl> } <nl> <nl> filterProtocolRequirements ( ArrayRef < ValueDecl * > Reqs , Type Adoptee ) { <nl> <nl> llvm : : SmallDenseMap < DeclName , llvm : : SmallVector < ValueDecl * , 2 > , 4 > <nl> DeclsByName ; <nl> - for ( auto * const Req : Reqs ) { <nl> + for ( const auto & Missing : MissingWitnesses ) { <nl> + auto Req = Missing . requirement ; <nl> if ( DeclsByName . find ( Req - > getName ( ) ) = = DeclsByName . end ( ) ) { <nl> DeclsByName [ Req - > getName ( ) ] = { Req } ; <nl> - Filtered . push_back ( Req ) ; <nl> + Filtered . push_back ( Missing ) ; <nl> continue ; <nl> } <nl> <nl> filterProtocolRequirements ( ArrayRef < ValueDecl * > Reqs , Type Adoptee ) { <nl> } <nl> <nl> DeclsByName [ Req - > getName ( ) ] . push_back ( Req ) ; <nl> - Filtered . push_back ( Req ) ; <nl> + Filtered . push_back ( Missing ) ; <nl> } <nl> <nl> return Filtered ; <nl> diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind Kind ) { <nl> if ( LocalMissing . empty ( ) ) <nl> return ; <nl> <nl> - const auto InsertFixit = [ ] ( NormalProtocolConformance * Conf , <nl> - SourceLoc ComplainLoc , bool EditorMode , <nl> - llvm : : SmallVector < ValueDecl * , 4 > <nl> - MissingWitnesses ) { <nl> + const auto InsertFixit = [ ] ( <nl> + NormalProtocolConformance * Conf , SourceLoc ComplainLoc , bool EditorMode , <nl> + llvm : : SmallVector < MissingWitness , 4 > MissingWitnesses ) { <nl> DeclContext * DC = Conf - > getDeclContext ( ) ; <nl> / / The location where to insert stubs . <nl> SourceLoc FixitLocation ; <nl> diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind Kind ) { <nl> } <nl> auto & SM = DC - > getASTContext ( ) . SourceMgr ; <nl> auto FixitBufferId = SM . findBufferContainingLoc ( FixitLocation ) ; <nl> - for ( auto VD : MissingWitnesses ) { <nl> + for ( const auto & Missing : MissingWitnesses ) { <nl> + auto VD = Missing . requirement ; <nl> + <nl> / / Don ' t ever emit a diagnostic for a requirement in the NSObject <nl> / / protocol . They ' re not implementable . <nl> if ( isNSObjectProtocol ( VD - > getDeclContext ( ) - > getSelfProtocolDecl ( ) ) ) <nl> diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind Kind ) { <nl> / / If the diagnostics are suppressed , we register these missing witnesses <nl> / / for later revisiting . <nl> Conformance - > setInvalid ( ) ; <nl> - getASTContext ( ) . addDelayedMissingWitnesses ( Conformance , MissingWitnesses ) ; <nl> + getASTContext ( ) . addDelayedMissingWitnesses ( <nl> + Conformance , <nl> + std : : make_unique < DelayedMissingWitnesses > ( MissingWitnesses ) ) ; <nl> } else { <nl> diagnoseOrDefer ( <nl> - LocalMissing [ 0 ] , true , [ & ] ( NormalProtocolConformance * Conf ) { <nl> + LocalMissing [ 0 ] . requirement , true , <nl> + [ & ] ( NormalProtocolConformance * Conf ) { <nl> InsertFixit ( Conf , Loc , IsEditorMode , std : : move ( MissingWitnesses ) ) ; <nl> } ) ; <nl> } <nl> diagnoseMissingWitnesses ( MissingWitnessDiagnosisKind Kind ) { <nl> return ; <nl> } <nl> case MissingWitnessDiagnosisKind : : ErrorOnly : { <nl> - diagnoseOrDefer ( LocalMissing [ 0 ] , true , [ ] ( NormalProtocolConformance * ) { } ) ; <nl> + diagnoseOrDefer ( <nl> + LocalMissing [ 0 ] . requirement , true , [ ] ( NormalProtocolConformance * ) { } ) ; <nl> return ; <nl> } <nl> case MissingWitnessDiagnosisKind : : FixItOnly : <nl> ConformanceChecker : : resolveWitnessViaLookup ( ValueDecl * requirement ) { <nl> return ResolveWitnessResult : : Missing ; <nl> } <nl> <nl> - / / Diagnose the error . <nl> + / / Diagnose the error . <nl> <nl> / / If there was an invalid witness that might have worked , just <nl> / / suppress the diagnostic entirely . This stops the diagnostic cascade . <nl> ConformanceChecker : : resolveWitnessViaLookup ( ValueDecl * requirement ) { <nl> <nl> if ( ! numViable ) { <nl> / / Save the missing requirement for later diagnosis . <nl> - GlobalMissingWitnesses . insert ( requirement ) ; <nl> + GlobalMissingWitnesses . insert ( { requirement , matches } ) ; <nl> diagnoseOrDefer ( requirement , true , <nl> [ requirement , matches , nominal ] ( NormalProtocolConformance * conformance ) { <nl> auto dc = conformance - > getDeclContext ( ) ; <nl> ResolveWitnessResult ConformanceChecker : : resolveWitnessViaDefault ( <nl> return ResolveWitnessResult : : Success ; <nl> } <nl> / / Save the missing requirement for later diagnosis . <nl> - GlobalMissingWitnesses . insert ( requirement ) ; <nl> + GlobalMissingWitnesses . insert ( { requirement , { } } ) ; <nl> return ResolveWitnessResult : : ExplicitFailed ; <nl> } <nl> <nl> ResolveWitnessResult ConformanceChecker : : resolveTypeWitnessViaLookup ( <nl> return ResolveWitnessResult : : ExplicitFailed ; <nl> } <nl> / / Save the missing type witness for later diagnosis . <nl> - GlobalMissingWitnesses . insert ( assocType ) ; <nl> + GlobalMissingWitnesses . insert ( { assocType , { } } ) ; <nl> <nl> / / None of the candidates were viable . <nl> diagnoseOrDefer ( assocType , true , <nl> TypeWitnessAndDecl <nl> TypeWitnessRequest : : evaluate ( Evaluator & eval , <nl> NormalProtocolConformance * conformance , <nl> AssociatedTypeDecl * requirement ) const { <nl> - llvm : : SetVector < ValueDecl * > MissingWitnesses ; <nl> + llvm : : SetVector < MissingWitness > MissingWitnesses ; <nl> ConformanceChecker checker ( requirement - > getASTContext ( ) , conformance , <nl> MissingWitnesses ) ; <nl> checker . resolveSingleTypeWitness ( requirement ) ; <nl> Witness <nl> ValueWitnessRequest : : evaluate ( Evaluator & eval , <nl> NormalProtocolConformance * conformance , <nl> ValueDecl * requirement ) const { <nl> - llvm : : SetVector < ValueDecl * > MissingWitnesses ; <nl> + llvm : : SetVector < MissingWitness > MissingWitnesses ; <nl> ConformanceChecker checker ( requirement - > getASTContext ( ) , conformance , <nl> MissingWitnesses ) ; <nl> checker . resolveSingleWitness ( requirement ) ; <nl> mmm a / lib / Sema / TypeCheckProtocol . h <nl> ppp b / lib / Sema / TypeCheckProtocol . h <nl> enum class MissingWitnessDiagnosisKind { <nl> class AssociatedTypeInference ; <nl> class MultiConformanceChecker ; <nl> <nl> + / / / Describes a missing witness during conformance checking . <nl> + class MissingWitness { <nl> + public : <nl> + / / / The requirement that is missing a witness . <nl> + ValueDecl * requirement ; <nl> + <nl> + / / / The set of potential matching witnesses . <nl> + std : : vector < RequirementMatch > matches ; <nl> + <nl> + MissingWitness ( ValueDecl * requirement , <nl> + ArrayRef < RequirementMatch > matches ) <nl> + : requirement ( requirement ) , <nl> + matches ( matches . begin ( ) , matches . end ( ) ) { } <nl> + } ; <nl> + <nl> + / / / Capture missing witnesses that have been delayed and will be stored <nl> + / / / in the ASTContext for later . <nl> + class DelayedMissingWitnesses : public MissingWitnessesBase { <nl> + public : <nl> + std : : vector < MissingWitness > missingWitnesses ; <nl> + <nl> + DelayedMissingWitnesses ( ArrayRef < MissingWitness > missingWitnesses ) <nl> + : missingWitnesses ( missingWitnesses . begin ( ) , missingWitnesses . end ( ) ) { } <nl> + } ; <nl> + <nl> / / / The protocol conformance checker . <nl> / / / <nl> / / / This helper class handles most of the details of checking whether a <nl> class ConformanceChecker : public WitnessChecker { <nl> / / / Keep track of missing witnesses , either type or value , for later <nl> / / / diagnosis emits . This may contain witnesses that are external to the <nl> / / / protocol under checking . <nl> - llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses ; <nl> + llvm : : SetVector < MissingWitness > & GlobalMissingWitnesses ; <nl> <nl> / / / Keep track of the slice in GlobalMissingWitnesses that is local to <nl> / / / this protocol under checking . <nl> class ConformanceChecker : public WitnessChecker { <nl> ValueDecl * requirement , bool isError , <nl> std : : function < void ( NormalProtocolConformance * ) > fn ) ; <nl> <nl> - ArrayRef < ValueDecl * > getLocalMissingWitness ( ) { <nl> + ArrayRef < MissingWitness > getLocalMissingWitness ( ) { <nl> return GlobalMissingWitnesses . getArrayRef ( ) . <nl> slice ( LocalMissingWitnessesStartIndex , <nl> GlobalMissingWitnesses . size ( ) - LocalMissingWitnessesStartIndex ) ; <nl> class ConformanceChecker : public WitnessChecker { <nl> void emitDelayedDiags ( ) ; <nl> <nl> ConformanceChecker ( ASTContext & ctx , NormalProtocolConformance * conformance , <nl> - llvm : : SetVector < ValueDecl * > & GlobalMissingWitnesses , <nl> + llvm : : SetVector < MissingWitness > & GlobalMissingWitnesses , <nl> bool suppressDiagnostics = true ) ; <nl> <nl> / / / Resolve all of the type witnesses . <nl> void diagnoseConformanceFailure ( Type T , <nl> <nl> } <nl> <nl> + namespace llvm { <nl> + <nl> + template < > <nl> + struct DenseMapInfo < swift : : MissingWitness > { <nl> + using MissingWitness = swift : : MissingWitness ; <nl> + using RequirementPointerTraits = DenseMapInfo < swift : : ValueDecl * > ; <nl> + <nl> + static inline MissingWitness getEmptyKey ( ) { <nl> + return MissingWitness ( RequirementPointerTraits : : getEmptyKey ( ) , { } ) ; <nl> + } <nl> + static inline MissingWitness getTombstoneKey ( ) { <nl> + return MissingWitness ( RequirementPointerTraits : : getTombstoneKey ( ) , { } ) ; <nl> + } <nl> + static inline unsigned getHashValue ( MissingWitness missing ) { <nl> + return RequirementPointerTraits : : getHashValue ( missing . requirement ) ; <nl> + } <nl> + static bool isEqual ( MissingWitness a , MissingWitness b ) { <nl> + return a . requirement = = b . requirement ; <nl> + } <nl> + } ; <nl> + <nl> + } <nl> # endif / / SWIFT_SEMA_PROTOCOL_H <nl> mmm a / lib / Sema / TypeCheckProtocolInference . cpp <nl> ppp b / lib / Sema / TypeCheckProtocolInference . cpp <nl> auto AssociatedTypeInference : : solve ( ConformanceChecker & checker ) <nl> return None ; <nl> <nl> / / Save the missing type witnesses for later diagnosis . <nl> - checker . GlobalMissingWitnesses . insert ( unresolvedAssocTypes . begin ( ) , <nl> - unresolvedAssocTypes . end ( ) ) ; <nl> + for ( auto assocType : unresolvedAssocTypes ) { <nl> + checker . GlobalMissingWitnesses . insert ( { assocType , { } } ) ; <nl> + } <nl> + <nl> return None ; <nl> } <nl> <nl>
|
[ Conformance checker ] Capture potential matches for missing witnesses .
|
apple/swift
|
f91767cfa06aa60076e1487ccd444daea8957c24
|
2020-09-18T23:50:22Z
|
mmm a / buildscripts / smoke . py <nl> ppp b / buildscripts / smoke . py <nl> def start ( self ) : <nl> argv + = [ ' - - nopreallocj ' ] <nl> if self . kwargs . get ( ' auth ' ) : <nl> argv + = [ ' - - auth ' , ' - - setParameter ' , ' enableLocalhostAuthBypass = false ' ] <nl> - authMechanism = self . kwargs . get ( ' authMechanism ' , ' MONGODB - CR ' ) <nl> - if authMechanism ! = ' MONGODB - CR ' : <nl> + authMechanism = self . kwargs . get ( ' authMechanism ' , ' SCRAM - SHA - 1 ' ) <nl> + if authMechanism ! = ' SCRAM - SHA - 1 ' : <nl> argv + = [ ' - - setParameter ' , ' authenticationMechanisms = ' + authMechanism ] <nl> self . auth = True <nl> if self . kwargs . get ( ' keyFile ' ) : <nl> mmm a / jstests / auth / auth1 . js <nl> ppp b / jstests / auth / auth1 . js <nl> print ( " START auth1 . js " ) ; <nl> port = allocatePorts ( 1 ) [ 0 ] ; <nl> baseName = " jstests_auth_auth1 " ; <nl> <nl> - m = startMongod ( " - - auth " , " - - port " , port , " - - dbpath " , MongoRunner . dataPath + baseName , " - - nohttpinterface " , " - - bind_ip " , " 127 . 0 . 0 . 1 " ) ; <nl> - db = m . getDB ( " test " ) ; <nl> - <nl> - / / these are used by read - only user <nl> - mro = new Mongo ( m . host ) ; <nl> - dbRO = mro . getDB ( " test " ) ; <nl> - tRO = dbRO [ baseName ] ; <nl> - <nl> - db . getSisterDB ( " admin " ) . createUser ( { user : " root " , pwd : " root " , roles : [ " root " ] } ) ; <nl> - db . getSisterDB ( " admin " ) . auth ( " root " , " root " ) ; <nl> - <nl> - t = db [ baseName ] ; <nl> - t . drop ( ) ; <nl> - <nl> - db . dropAllUsers ( ) ; <nl> - db . logout ( ) ; <nl> - <nl> - db . getSisterDB ( " admin " ) . createUser ( { user : " super " , pwd : " super " , roles : [ " __system " ] } ) ; <nl> - db . getSisterDB ( " admin " ) . auth ( " super " , " super " ) ; <nl> - db . createUser ( { user : " eliot " , pwd : " eliot " , roles : jsTest . basicUserRoles } ) ; <nl> - db . createUser ( { user : " guest " , pwd : " guest " , roles : jsTest . readOnlyUserRoles } ) ; <nl> - db . getSisterDB ( " admin " ) . logout ( ) ; <nl> - <nl> - assert . throws ( function ( ) { t . findOne ( ) } , [ ] , " read without login " ) ; <nl> - <nl> - print ( " make sure we can ' t run certain commands w / out auth " ) ; <nl> - var codeUnauthorized = 13 ; <nl> - var rslt = db . runCommand ( { eval : " function ( ) { return 1 ; } " } ) ; <nl> - assert . eq ( rslt . code , codeUnauthorized , tojson ( rslt ) ) ; <nl> - var rslt = db . runCommand ( { getLog : " global " } ) ; <nl> - assert . eq ( rslt . code , codeUnauthorized , tojson ( rslt ) ) ; <nl> - <nl> - assert ( ! db . auth ( " eliot " , " eliot2 " ) , " auth succeeded with wrong password " ) ; <nl> - assert ( db . auth ( " eliot " , " eliot " ) , " auth failed " ) ; <nl> - / / Change password <nl> - db . changeUserPassword ( " eliot " , " eliot2 " ) ; <nl> - assert ( ! db . auth ( " eliot " , " eliot " ) , " auth succeeded with wrong password " ) ; <nl> - assert ( db . auth ( " eliot " , " eliot2 " ) , " auth failed " ) ; <nl> - <nl> - for ( i = 0 ; i < 1000 ; + + i ) { <nl> - t . save ( { i : i } ) ; <nl> + authWithMech = function ( database , user , pwd , mech ) { <nl> + if ( mech = = " " ) <nl> + return database . auth ( user , pwd ) ; <nl> + else <nl> + return database . auth ( { user : user , pwd : pwd , mechanism : mech } ) ; <nl> } <nl> - assert . eq ( 1000 , t . count ( ) , " A1 " ) ; <nl> - assert . eq ( 1000 , t . find ( ) . toArray ( ) . length , " A2 " ) ; <nl> <nl> - db . setProfilingLevel ( 2 ) ; <nl> - t . count ( ) ; <nl> - db . setProfilingLevel ( 0 ) ; <nl> - assert . lt ( 0 , db . system . profile . find ( { user : " eliot @ test " } ) . count ( ) , " AP1 " ) <nl> + run = function ( mech ) { <nl> + var m = startMongod ( " - - auth " , " - - port " , port , " - - dbpath " , MongoRunner . dataPath + baseName , <nl> + " - - nohttpinterface " , " - - bind_ip " , " 127 . 0 . 0 . 1 " ) ; <nl> + db = m . getDB ( " test " ) ; <nl> <nl> - var p = { key : { i : true } , <nl> - reduce : function ( obj , prev ) { prev . count + + ; } , <nl> - initial : { count : 0 } <nl> - } ; <nl> + / / these are used by read - only user <nl> + var mro = new Mongo ( m . host ) ; <nl> + var dbRO = mro . getDB ( " test " ) ; <nl> + var tRO = dbRO [ baseName ] ; <nl> <nl> - assert . eq ( 1000 , t . group ( p ) . length , " A5 " ) ; <nl> + db . getSisterDB ( " admin " ) . createUser ( { user : " root " , pwd : " root " , roles : [ " root " ] } ) ; <nl> + authWithMech ( db . getSisterDB ( " admin " ) , " root " , " root " ) ; <nl> <nl> - assert ( dbRO . auth ( " guest " , " guest " ) , " auth failed 2 " ) ; <nl> + var t = db [ baseName ] ; <nl> + t . drop ( ) ; <nl> <nl> - assert . eq ( 1000 , tRO . count ( ) , " B1 " ) ; <nl> - assert . eq ( 1000 , tRO . find ( ) . toArray ( ) . length , " B2 " ) ; / / make sure we have a getMore in play <nl> - assert . commandWorked ( dbRO . runCommand ( { ismaster : 1 } ) , " B3 " ) ; <nl> + db . dropAllUsers ( ) ; <nl> + db . logout ( ) ; <nl> <nl> - assert . writeError ( tRO . save ( { } ) ) ; <nl> + db . getSisterDB ( " admin " ) . createUser ( { user : " super " , pwd : " super " , roles : [ " __system " ] } ) ; <nl> + db . getSisterDB ( " admin " ) . auth ( " super " , " super " ) ; <nl> + db . createUser ( { user : " eliot " , pwd : " eliot " , roles : jsTest . basicUserRoles } ) ; <nl> + db . createUser ( { user : " guest " , pwd : " guest " , roles : jsTest . readOnlyUserRoles } ) ; <nl> + db . getSisterDB ( " admin " ) . logout ( ) ; <nl> <nl> - assert . eq ( 1000 , tRO . count ( ) , " B6 " ) ; <nl> + assert . throws ( function ( ) { t . findOne ( ) } , [ ] , " read without login " ) ; <nl> <nl> - assert . eq ( 1000 , tRO . group ( p ) . length , " C1 " ) ; <nl> + print ( " make sure we can ' t run certain commands w / out auth " ) ; <nl> + var codeUnauthorized = 13 ; <nl> + var rslt = db . runCommand ( { eval : " function ( ) { return 1 ; } " } ) ; <nl> + assert . eq ( rslt . code , codeUnauthorized , tojson ( rslt ) ) ; <nl> + var rslt = db . runCommand ( { getLog : " global " } ) ; <nl> + assert . eq ( rslt . code , codeUnauthorized , tojson ( rslt ) ) ; <nl> <nl> - var p = { key : { i : true } , <nl> - reduce : function ( obj , prev ) { db . jstests_auth_auth1 . save ( { i : 10000 } ) ; prev . count + + ; } , <nl> - initial : { count : 0 } <nl> - } ; <nl> + assert ( ! authWithMech ( db , " eliot " , " eliot2 " , mech ) , " auth succeeded with wrong password " ) ; <nl> + assert ( authWithMech ( db , " eliot " , " eliot " , mech ) , " auth failed " ) ; <nl> + / / Change password <nl> + db . changeUserPassword ( " eliot " , " eliot2 " ) ; <nl> + assert ( ! authWithMech ( db , " eliot " , " eliot " , mech ) , " auth succeeded with wrong password " ) ; <nl> + assert ( authWithMech ( db , " eliot " , " eliot2 " , mech ) , " auth failed " ) ; <nl> <nl> + for ( i = 0 ; i < 1000 ; + + i ) { <nl> + t . save ( { i : i } ) ; <nl> + } <nl> + assert . eq ( 1000 , t . count ( ) , " A1 " ) ; <nl> + assert . eq ( 1000 , t . find ( ) . toArray ( ) . length , " A2 " ) ; <nl> <nl> - assert . throws ( function ( ) { return t . group ( p ) } , null , " write reduce didn ' t fail " ) ; <nl> - assert . eq ( 1000 , dbRO . jstests_auth_auth1 . count ( ) , " C3 " ) ; <nl> + db . setProfilingLevel ( 2 ) ; <nl> + t . count ( ) ; <nl> + db . setProfilingLevel ( 0 ) ; <nl> + assert . lt ( 0 , db . system . profile . find ( { user : " eliot @ test " } ) . count ( ) , " AP1 " ) <nl> <nl> + var p = { key : { i : true } , <nl> + reduce : function ( obj , prev ) { prev . count + + ; } , <nl> + initial : { count : 0 } <nl> + } ; <nl> <nl> - db . getSiblingDB ( ' admin ' ) . auth ( ' super ' , ' super ' ) ; <nl> + assert . eq ( 1000 , t . group ( p ) . length , " A5 " ) ; <nl> <nl> - assert . eq ( 1000 , db . eval ( function ( ) { return db [ " jstests_auth_auth1 " ] . count ( ) ; } ) , " D1 " ) ; <nl> - db . eval ( function ( ) { db [ " jstests_auth_auth1 " ] . save ( { i : 1000 } ) } ) ; <nl> - assert . eq ( 1001 , db . eval ( function ( ) { return db [ " jstests_auth_auth1 " ] . count ( ) ; } ) , " D2 " ) ; <nl> + assert ( dbRO . auth ( " guest " , " guest " ) , " auth failed 2 " ) ; <nl> + <nl> + assert . eq ( 1000 , tRO . count ( ) , " B1 " ) ; <nl> + assert . eq ( 1000 , tRO . find ( ) . toArray ( ) . length , " B2 " ) ; / / make sure we have a getMore in play <nl> + assert . commandWorked ( dbRO . runCommand ( { ismaster : 1 } ) , " B3 " ) ; <nl> + <nl> + assert . writeError ( tRO . save ( { } ) ) ; <nl> + <nl> + assert . eq ( 1000 , tRO . count ( ) , " B6 " ) ; <nl> + <nl> + assert . eq ( 1000 , tRO . group ( p ) . length , " C1 " ) ; <nl> + <nl> + var p = { key : { i : true } , <nl> + reduce : function ( obj , prev ) { db . jstests_auth_auth1 . save ( { i : 10000 } ) ; prev . count + + ; } , <nl> + initial : { count : 0 } <nl> + } ; <nl> + <nl> + <nl> + assert . throws ( function ( ) { return t . group ( p ) } , null , " write reduce didn ' t fail " ) ; <nl> + assert . eq ( 1000 , dbRO . jstests_auth_auth1 . count ( ) , " C3 " ) ; <nl> + <nl> + <nl> + authWithMech ( db . getSisterDB ( ' admin ' ) , ' super ' , ' super ' , mech ) ; <nl> + <nl> + assert . eq ( 1000 , db . eval ( function ( ) { return db [ " jstests_auth_auth1 " ] . count ( ) ; } ) , " D1 " ) ; <nl> + db . eval ( function ( ) { db [ " jstests_auth_auth1 " ] . save ( { i : 1000 } ) } ) ; <nl> + assert . eq ( 1001 , db . eval ( function ( ) { return db [ " jstests_auth_auth1 " ] . count ( ) ; } ) , " D2 " ) ; <nl> + <nl> + jsTest . log ( " About to delete users " ) <nl> + printjson ( db . getSiblingDB ( ' admin ' ) . system . users . findOne ( ) ) <nl> + db . getSiblingDB ( ' admin ' ) . dropAllUsers ( ) <nl> + db . getSiblingDB ( ' admin ' ) . logout ( ) <nl> + MongoRunner . stopMongod ( port ) ; <nl> + } <nl> + <nl> + / / Test the default mechanism <nl> + run ( ) <nl> + <nl> + / / Test MONGODB - CR <nl> + run ( ' MONGODB - CR ' ) <nl> <nl> print ( " SUCCESS auth1 . js " ) ; <nl> mmm a / src / mongo / shell / db . js <nl> ppp b / src / mongo / shell / db . js <nl> DB . prototype . __pwHash = function ( nonce , username , pass ) { <nl> return hex_md5 ( nonce + username + _hashPassword ( username , pass ) ) ; <nl> } <nl> <nl> - DB . prototype . _defaultAuthenticationMechanism = " MONGODB - CR " ; <nl> + DB . prototype . _defaultAuthenticationMechanism = " SCRAM - SHA - 1 " ; <nl> DB . prototype . _defaultGssapiServiceName = null ; <nl> <nl> DB . prototype . _authOrThrow = function ( ) { <nl> mmm a / src / mongo / shell / servers . js <nl> ppp b / src / mongo / shell / servers . js <nl> function appendSetParameterArgs ( argArray ) { <nl> if ( jsTest . options ( ) . enableTestCommands ) { <nl> argArray . push . apply ( argArray , [ ' - - setParameter ' , " enableTestCommands = 1 " ] ) ; <nl> } <nl> - if ( jsTest . options ( ) . authMechanism & & jsTest . options ( ) . authMechanism ! = " MONGODB - CR " ) { <nl> + if ( jsTest . options ( ) . authMechanism & & jsTest . options ( ) . authMechanism ! = " SCRAM - SHA - 1 " ) { <nl> var hasAuthMechs = false ; <nl> for ( i in argArray ) { <nl> if ( typeof argArray [ i ] = = = ' string ' & & <nl> mmm a / src / mongo / shell / shell_options . cpp <nl> ppp b / src / mongo / shell / shell_options . cpp <nl> namespace mongo { <nl> <nl> authenticationOptions . addOptionChaining ( " authenticationMechanism " , <nl> " authenticationMechanism " , moe : : String , " authentication mechanism " ) <nl> - . setDefault ( moe : : Value ( std : : string ( " MONGODB - CR " ) ) ) ; <nl> + . setDefault ( moe : : Value ( std : : string ( " SCRAM - SHA - 1 " ) ) ) ; <nl> <nl> authenticationOptions . addOptionChaining ( " gssapiServiceName " , " gssapiServiceName " , <nl> moe : : String , <nl>
|
SERVER - 15521 Make SCRAM - SHA - 1 default pw algo in shell
|
mongodb/mongo
|
203a02ca8f8581379c4cde74a06e4a81daaccc96
|
2014-10-06T17:48:30Z
|
mmm a / src / mongo / db / catalog / database . cpp <nl> ppp b / src / mongo / db / catalog / database . cpp <nl> Status Database : : dropView ( OperationContext * txn , StringData fullns ) { <nl> } <nl> <nl> Status Database : : dropCollection ( OperationContext * txn , StringData fullns ) { <nl> - invariant ( txn - > lockState ( ) - > isDbLockedForMode ( name ( ) , MODE_X ) ) ; <nl> - <nl> - LOG ( 1 ) < < " dropCollection : " < < fullns ; <nl> - massertNamespaceNotIndex ( fullns , " dropCollection " ) ; <nl> - <nl> - Collection * collection = getCollection ( fullns ) ; <nl> - if ( ! collection ) { <nl> - / / collection doesn ' t exist <nl> + if ( ! getCollection ( fullns ) ) { <nl> + / / Collection doesn ' t exist so don ' t bother validating if it can be dropped . <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> Status Database : : dropCollection ( OperationContext * txn , StringData fullns ) { <nl> return Status ( ErrorCodes : : IllegalOperation , <nl> " turn off profiling before dropping system . profile collection " ) ; <nl> } else if ( ! nss . isSystemDotViews ( ) ) { <nl> - return Status ( ErrorCodes : : IllegalOperation , " can ' t drop system ns " ) ; <nl> + return Status ( ErrorCodes : : IllegalOperation , <nl> + str : : stream ( ) < < " can ' t drop system collection " < < fullns ) ; <nl> } <nl> } <nl> } <nl> <nl> + return dropCollectionEvenIfSystem ( txn , nss ) ; <nl> + } <nl> + <nl> + Status Database : : dropCollectionEvenIfSystem ( OperationContext * txn , const NamespaceString & fullns ) { <nl> + invariant ( txn - > lockState ( ) - > isDbLockedForMode ( name ( ) , MODE_X ) ) ; <nl> + <nl> + LOG ( 1 ) < < " dropCollection : " < < fullns ; <nl> + <nl> + Collection * collection = getCollection ( fullns ) ; <nl> + if ( ! collection ) { <nl> + return Status : : OK ( ) ; / / Post condition already met . <nl> + } <nl> + <nl> + massertNamespaceNotIndex ( fullns . toString ( ) , " dropCollection " ) ; <nl> + <nl> BackgroundOperation : : assertNoBgOpInProgForNs ( fullns ) ; <nl> <nl> - audit : : logDropCollection ( & cc ( ) , fullns ) ; <nl> + audit : : logDropCollection ( & cc ( ) , fullns . toString ( ) ) ; <nl> <nl> Status s = collection - > getIndexCatalog ( ) - > dropAllIndexes ( txn , true ) ; <nl> if ( ! s . isOK ( ) ) { <nl> Status Database : : dropCollection ( OperationContext * txn , StringData fullns ) { <nl> verify ( collection - > _details - > getTotalIndexCount ( txn ) = = 0 ) ; <nl> LOG ( 1 ) < < " \ t dropIndexes done " ; <nl> <nl> - Top : : get ( txn - > getClient ( ) - > getServiceContext ( ) ) . collectionDropped ( fullns ) ; <nl> + Top : : get ( txn - > getClient ( ) - > getServiceContext ( ) ) . collectionDropped ( fullns . toString ( ) ) ; <nl> <nl> / / We want to destroy the Collection object before telling the StorageEngine to destroy the <nl> / / RecordStore . <nl> - _clearCollectionCache ( txn , fullns , " collection dropped " ) ; <nl> + _clearCollectionCache ( txn , fullns . toString ( ) , " collection dropped " ) ; <nl> <nl> - s = _dbEntry - > dropCollection ( txn , fullns ) ; <nl> + s = _dbEntry - > dropCollection ( txn , fullns . toString ( ) ) ; <nl> <nl> if ( ! s . isOK ( ) ) <nl> return s ; <nl> Status Database : : dropCollection ( OperationContext * txn , StringData fullns ) { <nl> } <nl> } <nl> <nl> - getGlobalServiceContext ( ) - > getOpObserver ( ) - > onDropCollection ( txn , nss ) ; <nl> + getGlobalServiceContext ( ) - > getOpObserver ( ) - > onDropCollection ( txn , fullns ) ; <nl> <nl> return Status : : OK ( ) ; <nl> } <nl> mmm a / src / mongo / db / catalog / database . h <nl> ppp b / src / mongo / db / catalog / database . h <nl> class Database { <nl> <nl> const DatabaseCatalogEntry * getDatabaseCatalogEntry ( ) const ; <nl> <nl> + / * * <nl> + * dropCollection ( ) will refuse to drop system collections . Use dropCollectionEvenIfSystem ( ) if <nl> + * that is required . <nl> + * / <nl> Status dropCollection ( OperationContext * txn , StringData fullns ) ; <nl> + Status dropCollectionEvenIfSystem ( OperationContext * txn , const NamespaceString & fullns ) ; <nl> <nl> Status dropView ( OperationContext * txn , StringData fullns ) ; <nl> <nl> mmm a / src / mongo / db / repl / rs_rollback . cpp <nl> ppp b / src / mongo / db / repl / rs_rollback . cpp <nl> void syncFixUp ( OperationContext * txn , <nl> Database * db = dbHolder ( ) . openDb ( txn , nss . db ( ) . toString ( ) ) ; <nl> invariant ( db ) ; <nl> WriteUnitOfWork wunit ( txn ) ; <nl> - db - > dropCollection ( txn , ns ) ; <nl> + fassertStatusOK ( 40359 , db - > dropCollectionEvenIfSystem ( txn , nss ) ) ; <nl> wunit . commit ( ) ; <nl> } <nl> <nl> void syncFixUp ( OperationContext * txn , <nl> throw RSFatalException ( ) ; <nl> } <nl> <nl> - db - > dropCollection ( txn , * it ) ; <nl> + fassertStatusOK ( 40360 , db - > dropCollectionEvenIfSystem ( txn , nss ) ) ; <nl> wunit . commit ( ) ; <nl> } <nl> } <nl> void syncFixUp ( OperationContext * txn , <nl> if ( ! infoResult . isOK ( ) ) { <nl> / / we should drop <nl> WriteUnitOfWork wunit ( txn ) ; <nl> - ctx . db ( ) - > dropCollection ( txn , doc . ns ) ; <nl> + fassertStatusOK ( 40361 , <nl> + ctx . db ( ) - > dropCollectionEvenIfSystem ( txn , nss ) ) ; <nl> wunit . commit ( ) ; <nl> } <nl> } catch ( const DBException & ex ) { <nl>
|
SERVER - 25860 Allow replication rollback to drop system collections
|
mongodb/mongo
|
99e19b1ded425a1d859a9bc52fd5c2712e71f83a
|
2017-01-03T21:02:19Z
|
mmm a / src / textord / colfind . cpp <nl> ppp b / src / textord / colfind . cpp <nl> void ColumnFinder : : ComputeMeanColumnGap ( bool any_multi_column ) { <nl> & gap_samples ) ; <nl> } <nl> mean_column_gap_ = any_multi_column & & gap_samples > 0 <nl> - ? total_gap / gap_samples : total_width / width_samples ; <nl> + ? total_gap / gap_samples : width_samples > 0 <nl> + ? total_width / width_samples : 0 ; <nl> } <nl> <nl> / / / / / / / / Functions that manipulate ColPartitions in the part_grid_ / / / / / <nl>
|
Fix issue detected by Coverity Scan
|
tesseract-ocr/tesseract
|
65997bed1674c7c507518af46b88b4ab15a8b75f
|
2018-08-01T13:56:19Z
|
mmm a / Telegram / SourceFiles / data / data_session . cpp <nl> ppp b / Telegram / SourceFiles / data / data_session . cpp <nl> void Session : : setPinnedFromDialog ( const Dialogs : : Key & key , bool pinned ) { <nl> void Session : : applyPinnedChats ( <nl> Data : : Folder * folder , <nl> const QVector < MTPDialogPeer > & list ) { <nl> - notifyPinnedDialogsOrderUpdated ( ) <nl> + notifyPinnedDialogsOrderUpdated ( ) ; <nl> for ( const auto & peer : list ) { <nl> peer . match ( [ & ] ( const MTPDdialogPeer & data ) { <nl> const auto history = this - > history ( peerFromMTP ( data . vpeer ) ) ; <nl> void Session : : applyDialog ( <nl> void Session : : applyDialog ( <nl> Data : : Folder * requestFolder , <nl> const MTPDdialogFolder & data ) { <nl> - notifyPinnedDialogsOrderUpdated ( ) <nl> + notifyPinnedDialogsOrderUpdated ( ) ; <nl> if ( requestFolder ) { <nl> LOG ( ( " API Error : requestFolder ! = nullptr for dialogFolder . " ) ) ; <nl> } <nl> mmm a / Telegram / SourceFiles / platform / mac / touchbar . h <nl> ppp b / Telegram / SourceFiles / platform / mac / touchbar . h <nl> static NSString * _Nullable BASE_ID = @ " telegram . touchbar " ; <nl> static NSTouchBarCustomizationIdentifier _Nullable customID = @ " telegram . touchbar " ; <nl> static NSTouchBarCustomizationIdentifier _Nullable customIDMain = @ " telegram . touchbarMain " ; <nl> static NSTouchBarItemIdentifier _Nullable savedMessages = [ NSString stringWithFormat : @ " % @ . savedMessages " , customIDMain ] ; <nl> + static NSTouchBarItemIdentifier _Nullable archiveFolder = [ NSString stringWithFormat : @ " % @ . archiveFolder " , customIDMain ] ; <nl> <nl> static NSTouchBarItemIdentifier _Nullable pinnedDialog1 = [ NSString stringWithFormat : @ " % @ . pinnedDialog1 " , customIDMain ] ; <nl> static NSTouchBarItemIdentifier _Nullable pinnedDialog2 = [ NSString stringWithFormat : @ " % @ . pinnedDialog2 " , customIDMain ] ; <nl> mmm a / Telegram / SourceFiles / platform / mac / touchbar . mm <nl> ppp b / Telegram / SourceFiles / platform / mac / touchbar . mm <nl> <nl> # include " history / history . h " <nl> # include " ui / empty_userpic . h " <nl> # include " observer_peer . h " <nl> + # include " styles / style_dialogs . h " <nl> + # include " data / data_folder . h " <nl> <nl> namespace { <nl> / / https : / / developer . apple . com / design / human - interface - guidelines / macos / touch - bar / touch - bar - icons - and - images / <nl> <nl> constexpr auto kSongType = AudioMsgId : : Type : : Song ; <nl> <nl> constexpr auto kSavedMessagesId = 0 ; <nl> + constexpr auto kArchiveId = - 1 ; <nl> } / / namespace <nl> <nl> NSImage * qt_mac_create_nsimage ( const QPixmap & pm ) ; <nl> @ implementation PinnedDialogButton : NSCustomTouchBarItem <nl> - ( id ) init : ( int ) num { <nl> if ( num = = kSavedMessagesId ) { <nl> return [ self initSavedMessages ] ; <nl> + } else if ( num = = kArchiveId ) { <nl> + return [ self initArchive ] ; <nl> } <nl> NSString * identifier = [ NSString stringWithFormat : @ " % @ . pinnedDialog % d " , customIDMain , num ] ; <nl> self = [ super initWithIdentifier : identifier ] ; <nl> - ( id ) init : ( int ) num { <nl> NSButton * button = [ NSButton buttonWithImage : [ self getPinImage ] target : self action : @ selector ( buttonActionPin : ) ] ; <nl> [ button setBordered : NO ] ; <nl> [ button sizeToFit ] ; <nl> - [ button setHidden : ( num > Auth ( ) . data ( ) . pinnedDialogsOrder ( ) . size ( ) ) ] ; <nl> + [ button setHidden : ( num > Auth ( ) . data ( ) . pinnedChatsOrder ( nullptr ) . size ( ) ) ] ; <nl> self . view = button ; <nl> self . customizationLabel = [ NSString stringWithFormat : @ " Pinned Dialog % d " , num ] ; <nl> <nl> - ( id ) initSavedMessages { <nl> NSButton * button = [ NSButton buttonWithImage : [ self getPinImage ] target : self action : @ selector ( buttonActionPin : ) ] ; <nl> [ button setBordered : NO ] ; <nl> [ button sizeToFit ] ; <nl> - [ button setHidden : ( self . number > Auth ( ) . data ( ) . pinnedDialogsOrder ( ) . size ( ) ) ] ; <nl> self . view = button ; <nl> self . customizationLabel = @ " Saved Messages " ; <nl> <nl> return self ; <nl> } <nl> <nl> + - ( id ) initArchive { <nl> + self = [ super initWithIdentifier : archiveFolder ] ; <nl> + if ( ! self ) { <nl> + return nil ; <nl> + } <nl> + self . number = kArchiveId ; <nl> + self . waiting = false ; <nl> + <nl> + NSButton * button = [ NSButton buttonWithImage : [ self getPinImage ] target : self action : @ selector ( buttonActionPin : ) ] ; <nl> + [ button setBordered : NO ] ; <nl> + [ button sizeToFit ] ; <nl> + self . view = button ; <nl> + self . customizationLabel = @ " Archive Folder " ; <nl> + <nl> + return self ; <nl> + } <nl> + <nl> - ( void ) updatePeerData { <nl> - const auto & order = Auth ( ) . data ( ) . pinnedDialogsOrder ( ) ; <nl> + const auto & order = Auth ( ) . data ( ) . pinnedChatsOrder ( nullptr ) ; <nl> if ( self . number > order . size ( ) ) { <nl> self . peer = nil ; <nl> return ; <nl> } <nl> / / Order is reversed . <nl> - const auto pinned = order . at ( order . size ( ) - self . number ) ; <nl> + const auto pinned = order . at ( self . number - 1 ) ; <nl> if ( const auto history = pinned . history ( ) ) { <nl> self . peer = history - > peer ; <nl> } <nl> - ( void ) updatePeerData { <nl> <nl> - ( void ) buttonActionPin : ( NSButton * ) sender { <nl> Core : : Sandbox : : Instance ( ) . customEnterFromEventLoop ( [ = ] { <nl> - App : : main ( ) - > choosePeer ( self . number = = kSavedMessagesId <nl> + App : : main ( ) - > choosePeer ( self . number = = kSavedMessagesId | | self . number = = kArchiveId <nl> ? Auth ( ) . userPeerId ( ) <nl> : self . peer - > id , ShowAtUnreadMsgId ) ; <nl> } ) ; <nl> - ( void ) buttonActionPin : ( NSButton * ) sender { <nl> <nl> <nl> - ( NSImage * ) getPinImage { <nl> - if ( self . number = = kSavedMessagesId ) { <nl> + if ( self . number < = kSavedMessagesId ) { <nl> const int s = kIdealIconSize * cRetinaFactor ( ) ; <nl> auto * pix = new QPixmap ( s , s ) ; <nl> Painter paint ( pix ) ; <nl> paint . fillRect ( QRectF ( 0 , 0 , s , s ) , QColor ( 0 , 0 , 0 , 255 ) ) ; <nl> <nl> - Ui : : EmptyUserpic : : PaintSavedMessages ( paint , 0 , 0 , s , s ) ; <nl> + if ( self . number = = kArchiveId ) { <nl> + paint . fillRect ( QRectF ( 0 , 0 , s , s ) , QColor ( 0 , 0 , 0 , 255 ) ) ; <nl> + if ( const auto folder = Auth ( ) . data ( ) . folderLoaded ( Data : : Folder : : kId ) ) { <nl> + folder - > paintUserpic ( paint , 0 , 0 , s ) ; <nl> + } <nl> + } else { <nl> + Ui : : EmptyUserpic : : PaintSavedMessages ( paint , 0 , 0 , s , s ) ; <nl> + } <nl> pix - > setDevicePixelRatio ( cRetinaFactor ( ) ) ; <nl> return static_cast < NSImage * > ( qt_mac_create_nsimage ( * pix ) ) ; <nl> } <nl> - ( nullable NSTouchBarItem * ) touchBar : ( NSTouchBar * ) touchBar <nl> NSCustomTouchBarItem * item = [ [ NSCustomTouchBarItem alloc ] initWithIdentifier : identifier ] ; <nl> NSMutableArray * pins = [ [ NSMutableArray alloc ] init ] ; <nl> <nl> - for ( auto i = 0 ; i < = 5 ; i + + ) { <nl> + for ( auto i = - 1 ; i < = 5 ; i + + ) { <nl> [ pins addObject : [ [ PinnedDialogButton alloc ] init : i ] . view ] ; <nl> } <nl> NSStackView * stackView = [ NSStackView stackViewWithViews : [ pins copy ] ] ; <nl>
|
Updated for archive support .
|
telegramdesktop/tdesktop
|
9c60d2be80f602942ac8bbeefab226744dac19d6
|
2019-05-27T13:34:58Z
|
mmm a / hphp / system / php / phar / Phar . php <nl> ppp b / hphp / system / php / phar / Phar . php <nl> class Phar extends RecursiveDirectoryIterator <nl> * / <nl> private static $ aliases = array ( ) ; <nl> / * * <nl> - * Preventing of check for __HALT_COMPILER ( ) ; in stub <nl> - * when calling for phar : / / stream wrapper <nl> + * Prevent the check for __HALT_COMPILER ( ) <nl> * / <nl> private static $ preventHaltTokenCheck = false ; <nl> <nl> public function __construct ( $ filename , $ flags = null , $ alias = null ) { <nl> if ( $ pos = = = false & & ! self : : $ preventHaltTokenCheck ) { <nl> throw new PharException ( " __HALT_COMPILER ( ) ; must be declared in a phar " ) ; <nl> } <nl> - self : : $ preventHaltTokenCheck = false ; <nl> $ this - > stub = substr ( $ data , 0 , $ pos ) ; <nl> <nl> $ pos + = strlen ( $ halt_token ) ; <nl> private static function getPharAndFile ( $ filename_or_alias ) { <nl> if ( is_file ( $ filename ) ) { <nl> <nl> if ( ! isset ( self : : $ aliases [ $ filename ] ) ) { <nl> - / * * <nl> - * Hack is needed because stream wrapper should work <nl> - * even without stub at all <nl> - * / <nl> + / / We need this hack because the stream wrapper should work <nl> + / / even without the __HALT_COMPILER token <nl> self : : $ preventHaltTokenCheck = true ; <nl> self : : loadPhar ( $ filename ) ; <nl> + self : : $ preventHaltTokenCheck = false ; <nl> } <nl> <nl> return array ( <nl>
|
the things I wanted from the phar fix
|
facebook/hhvm
|
c0af21be463b4349413ab90d0444205d4260d501
|
2014-10-29T20:30:26Z
|
mmm a / src / serializer / types . hpp <nl> ppp b / src / serializer / types . hpp <nl> struct serializer_traits_t < serializer_t > { <nl> typedef standard_block_token_t block_token_type ; <nl> } ; <nl> <nl> - / / TODO : time_t is disgusting . <nl> + / / TODO : time_t ' s size is system - dependent . <nl> typedef time_t creation_timestamp_t ; <nl> <nl> # endif / / __SERIALIZER_TYPES_HPP__ <nl>
|
Clarified beef with time_t .
|
rethinkdb/rethinkdb
|
b4185fb97f77b64ebf7a43109336e83e50993ee6
|
2011-08-21T22:36:53Z
|
mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> void TypeChecker : : checkConformancesInContext ( DeclContext * dc , <nl> / / Diagnose @ NSCoding on file / fileprivate / nested / generic classes , which <nl> / / have unstable archival names . <nl> if ( auto classDecl = dc - > getAsClassOrClassExtensionContext ( ) ) { <nl> - if ( isNSCoding ( conformance - > getProtocol ( ) ) ) { <nl> + if ( Context . LangOpts . EnableObjCInterop & & <nl> + isNSCoding ( conformance - > getProtocol ( ) ) ) { <nl> / / Note : these ' kind ' values are synchronized with <nl> / / diag : : nscoding_unstable_mangled_name . <nl> Optional < unsigned > kind ; <nl>
|
Merge pull request from DougGregor / nscoding - objc - interop
|
apple/swift
|
e987d04a21c20fbff1b0b0b856befdd3987980fe
|
2017-05-11T06:01:04Z
|
mmm a / src / core / hle / service / ldn / ldn . cpp <nl> ppp b / src / core / hle / service / ldn / ldn . cpp <nl> class IUserLocalCommunicationService final <nl> { 304 , nullptr , " Disconnect " } , <nl> { 400 , nullptr , " Initialize " } , <nl> { 401 , nullptr , " Finalize " } , <nl> - { 402 , nullptr , " SetOperationMode " } , <nl> + { 402 , & IUserLocalCommunicationService : : Initialize2 , " Initialize2 " } , / / 7 . 0 . 0 + <nl> } ; <nl> / / clang - format on <nl> <nl> RegisterHandlers ( functions ) ; <nl> } <nl> + <nl> + void Initialize2 ( Kernel : : HLERequestContext & ctx ) { <nl> + LOG_WARNING ( Service_LDN , " ( STUBBED ) called " ) ; <nl> + / / Result success seem make this services start network and continue . <nl> + / / If we just pass result error then it will stop and maybe try again and again . <nl> + IPC : : ResponseBuilder rb { ctx , 2 } ; <nl> + rb . Push ( RESULT_UNKNOWN ) ; <nl> + } <nl> } ; <nl> <nl> class LDNS final : public ServiceFramework < LDNS > { <nl>
|
Merge pull request from namkazt / patch - 1
|
yuzu-emu/yuzu
|
af29e9d98e9ffa12cb83625b423498fbb42db53d
|
2020-02-16T09:01:42Z
|
mmm a / PowerEditor / bin / change . log <nl> ppp b / PowerEditor / bin / change . log <nl> <nl> + Notepad + + v5 . 0 . 2 fixed bugs and added features ( from v5 . 0 . 1 ) : <nl> + <nl> + 1 . Fix crash bug for tags match highlighting . <nl> + 2 . Fix the huge file makes notepad + + crash issue . <nl> + 3 . Fix adding item in the history file list while deleting file from Notepad + + bug . <nl> + 4 . Fix a bug that file detection options set are not saved due to doc monitor plugin . <nl> + 5 . Improve opening file performance . <nl> + 6 . Fix bug when closing file using close button . <nl> + <nl> + <nl> + <nl> Notepad + + v5 . 0 . 1 fixed bugs and added features ( from v5 ) : <nl> <nl> 1 . Fix tags match highlighter bug - more accurate . <nl> mmm a / PowerEditor / installer / nppSetup . nsi <nl> ppp b / PowerEditor / installer / nppSetup . nsi <nl> <nl> <nl> ; Define the application name <nl> ! define APPNAME " Notepad + + " <nl> - ! define APPNAMEANDVERSION " Notepad + + v5 . 0 . 1 " <nl> + ! define APPNAMEANDVERSION " Notepad + + v5 . 0 . 2 " <nl> <nl> ! define VERSION_MAJOR 5 <nl> - ! define VERSION_MINOR 01 <nl> + ! define VERSION_MINOR 02 <nl> <nl> ; Main Install settings <nl> Name " $ { APPNAMEANDVERSION } " <nl> InstallDir " $ PROGRAMFILES \ Notepad + + " <nl> InstallDirRegKey HKLM " Software \ $ { APPNAME } " " " <nl> - OutFile " . . \ bin \ npp . 5 . 0 . 1 . Installer . exe " <nl> + OutFile " . . \ bin \ npp . 5 . 0 . 2 . Installer . exe " <nl> <nl> ; GetWindowsVersion <nl> ; <nl> mmm a / PowerEditor / src / resource . h <nl> ppp b / PowerEditor / src / resource . h <nl> <nl> # ifndef RESOURCE_H <nl> # define RESOURCE_H <nl> <nl> - # define NOTEPAD_PLUS_VERSION " Notepad + + v5 . 0 . 1 " <nl> - # define VERSION_VALUE " 5 . 01 \ 0 " / / should be X . Y : ie . if VERSION_DIGITALVALUE = = 4 , 7 , 1 , 0 , then X = 4 , Y = 71 <nl> - # define VERSION_DIGITALVALUE 5 , 0 , 1 , 0 <nl> + # define NOTEPAD_PLUS_VERSION " Notepad + + v5 . 0 . 2 " <nl> + # define VERSION_VALUE " 5 . 02 \ 0 " / / should be X . Y : ie . if VERSION_DIGITALVALUE = = 4 , 7 , 1 , 0 , then X = 4 , Y = 71 <nl> + # define VERSION_DIGITALVALUE 5 , 0 , 2 , 0 <nl> <nl> # ifndef IDC_STATIC <nl> # define IDC_STATIC - 1 <nl>
|
[ RELEASE ] v5 . 0 . 2 release .
|
notepad-plus-plus/notepad-plus-plus
|
1d9f93b2a0ff39bd14b58f3ca00f321d942e1b4a
|
2008-07-21T22:33:22Z
|
mmm a / xbmc / cores / VideoPlayer / DVDCodecs / Video / VAAPI . cpp <nl> ppp b / xbmc / cores / VideoPlayer / DVDCodecs / Video / VAAPI . cpp <nl> long CDecoder : : Release ( ) <nl> if ( g_advancedSettings . CanLogComponent ( LOGVIDEO ) ) <nl> CLog : : Log ( LOGDEBUG , " VAAPI : : Release pre - cleanup " ) ; <nl> <nl> + CSingleLock lock1 ( g_graphicsContext ) ; <nl> Message * reply ; <nl> if ( m_vaapiOutput . m_controlPort . SendOutMessageSync ( COutputControlProtocol : : PRECLEANUP , <nl> & reply , <nl>
|
Merge pull request from FernetMenta / vaapilock
|
xbmc/xbmc
|
d4deb6296b2efecae84c6a4a701aecfea90efb05
|
2016-09-19T16:03:44Z
|
mmm a / include / swift / AST / Expr . h <nl> ppp b / include / swift / AST / Expr . h <nl> class AutoClosureExpr : public AbstractClosureExpr { <nl> / / / The body of an autoclosure always consists of a single expression . <nl> Expr * getSingleExpressionBody ( ) const ; <nl> <nl> - / / / Unwraps a curry thunk . <nl> + / / / Unwraps a curry thunk . Basically , this gives you what the old AST looked <nl> + / / / like , before Sema started building curry thunks . This is really only <nl> + / / / meant for legacy usages . <nl> / / / <nl> - / / / If this is a double curry thunk , return the original DeclRefExpr . <nl> - / / / If this is a single curry thunk , return the ApplyExpr for the self call . <nl> - / / / Otherwise , return null . <nl> + / / / The behavior is as follows , based on the kind : <nl> + / / / - for double curry thunks , returns the original DeclRefExpr . <nl> + / / / - for single curry thunks , returns the ApplyExpr for the self call . <nl> + / / / - otherwise , returns nullptr for convenience . <nl> Expr * getUnwrappedCurryThunkExpr ( ) const ; <nl> <nl> / / Implement isa / cast / dyncast / etc . <nl> mmm a / lib / Sema / CSApply . cpp <nl> ppp b / lib / Sema / CSApply . cpp <nl> namespace { <nl> cs . cacheExprTypes ( base ) ; <nl> <nl> return buildMemberRef ( base , SourceLoc ( ) , overload , loc , locator , <nl> - locator , implicit , semantics ) ; <nl> + locator , implicit , / * extraUncurryLevel = * / false , <nl> + semantics ) ; <nl> } <nl> <nl> if ( isa < TypeDecl > ( decl ) & & ! isa < ModuleDecl > ( decl ) ) { <nl> namespace { <nl> prev = result ; <nl> } <nl> <nl> - / / Invalid case - - direct call of a metatype . Has one less argument <nl> - / / application because there ' s no " . init " . <nl> - if ( isa < ApplyExpr > ( ExprStack . back ( ) ) ) <nl> - argCount - - ; <nl> - <nl> return argCount ; <nl> } <nl> <nl> namespace { <nl> unsigned maxArgCount = getNaturalArgumentCount ( member ) ; <nl> unsigned depth = ExprStack . size ( ) - getArgCount ( maxArgCount ) ; <nl> <nl> + / / Invalid case - - direct call of a metatype . Has one less argument <nl> + / / application because there ' s no " . init " . <nl> + if ( isa < ApplyExpr > ( ExprStack . back ( ) ) ) <nl> + depth + + ; <nl> + <nl> / / Create the opaque opened value . If we started with a <nl> / / metatype , it ' s a metatype . <nl> Type opaqueType = archetype ; <nl> namespace { <nl> SelectedOverload overload , DeclNameLoc memberLoc , <nl> ConstraintLocatorBuilder locator , <nl> ConstraintLocatorBuilder memberLocator , bool Implicit , <nl> - AccessSemantics semantics ) { <nl> + bool extraUncurryLevel , AccessSemantics semantics ) { <nl> auto choice = overload . choice ; <nl> auto openedType = overload . openedType ; <nl> auto openedFullType = overload . openedFullType ; <nl> namespace { <nl> <nl> / / Build a member reference . <nl> auto memberRef = resolveConcreteDeclRef ( member , memberLocator ) ; <nl> - auto refTy = solution . simplifyType ( openedFullType ) ; <nl> <nl> / / If we ' re referring to the member of a module , it ' s just a simple <nl> / / reference . <nl> namespace { <nl> assert ( semantics = = AccessSemantics : : Ordinary & & <nl> " Direct property access doesn ' t make sense for this " ) ; <nl> auto ref = new ( context ) DeclRefExpr ( memberRef , memberLoc , Implicit ) ; <nl> - cs . setType ( ref , refTy ) ; <nl> + cs . setType ( ref , simplifyType ( openedFullType ) ) ; <nl> ref - > setFunctionRefKind ( choice . getFunctionRefKind ( ) ) ; <nl> auto * DSBI = cs . cacheType ( new ( context ) DotSyntaxBaseIgnoredExpr ( <nl> base , dotLoc , ref , cs . getType ( ref ) ) ) ; <nl> namespace { <nl> return result ; <nl> } <nl> <nl> + bool isUnboundInstanceMember = <nl> + ( ! baseIsInstance & & member - > isInstanceMember ( ) ) ; <nl> + <nl> + auto refTy = simplifyType ( openedFullType ) ; <nl> + <nl> / / The formal type of the ' self ' value for the member ' s declaration . <nl> Type containerTy = getBaseType ( refTy - > castTo < FunctionType > ( ) ) ; <nl> <nl> namespace { <nl> <nl> / / If we opened up an existential when referencing this member , update <nl> / / the base accordingly . <nl> + bool openedExistential = false ; <nl> + <nl> + / / For a partial application , we have to open the existential inside <nl> + / / the thunk itself . <nl> auto knownOpened = solution . OpenedExistentialTypes . find ( <nl> getConstraintSystem ( ) . getConstraintLocator ( <nl> memberLocator ) ) ; <nl> - bool openedExistential = false ; <nl> if ( knownOpened ! = solution . OpenedExistentialTypes . end ( ) ) { <nl> + / / Open the existential before performing the member reference . <nl> base = openExistentialReference ( base , knownOpened - > second , member ) ; <nl> baseTy = knownOpened - > second ; <nl> selfTy = baseTy ; <nl> openedExistential = true ; <nl> } <nl> <nl> - / / If this is a method whose result type is dynamic Self , or a <nl> - / / construction , replace the result type with the actual object type . <nl> - Type dynamicSelfFnType ; <nl> - if ( ! member - > getDeclContext ( ) - > getSelfProtocolDecl ( ) ) { <nl> - if ( auto func = dyn_cast < AbstractFunctionDecl > ( member ) ) { <nl> - if ( func - > hasDynamicSelfResult ( ) & & <nl> - ! baseTy - > getOptionalObjectType ( ) ) { <nl> - refTy = refTy - > replaceCovariantResultType ( containerTy , 2 ) ; <nl> - if ( ! baseTy - > isEqual ( containerTy ) ) { <nl> - dynamicSelfFnType = refTy - > replaceCovariantResultType ( baseTy , 2 ) ; <nl> - } <nl> - } <nl> - } else if ( auto * decl = dyn_cast < VarDecl > ( member ) ) { <nl> - if ( decl - > getValueInterfaceType ( ) - > hasDynamicSelfType ( ) ) { <nl> - refTy = refTy - > replaceCovariantResultType ( containerTy , 1 ) ; <nl> - if ( ! baseTy - > isEqual ( containerTy ) ) { <nl> - dynamicSelfFnType = refTy - > replaceCovariantResultType ( baseTy , 1 ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> / / References to properties with accessors and storage usually go <nl> / / through the accessors , but sometimes are direct . <nl> if ( auto * VD = dyn_cast < VarDecl > ( member ) ) { <nl> namespace { <nl> <nl> / / If the base was an opened existential , erase the opened <nl> / / existential . <nl> - if ( openedExistential & & <nl> - refType - > hasOpenedExistential ( knownOpened - > second ) ) { <nl> - refType = refType - > eraseOpenedExistential ( knownOpened - > second ) ; <nl> + if ( openedExistential ) { <nl> + refType = refType - > eraseOpenedExistential ( <nl> + baseTy - > castTo < OpenedArchetypeType > ( ) ) ; <nl> } <nl> <nl> cs . setType ( ref , refType ) ; <nl> namespace { <nl> <nl> / / For properties , build member references . <nl> if ( isa < VarDecl > ( member ) ) { <nl> - if ( ! baseIsInstance & & member - > isInstanceMember ( ) ) { <nl> + if ( isUnboundInstanceMember ) { <nl> assert ( memberLocator . getBaseLocator ( ) & & <nl> cs . UnevaluatedRootExprs . count ( <nl> memberLocator . getBaseLocator ( ) - > getAnchor ( ) ) & & <nl> namespace { <nl> memberLoc , Implicit , semantics ) ; <nl> memberRefExpr - > setIsSuper ( isSuper ) ; <nl> <nl> - / / Skip the synthesized ' self ' input type of the opened type . <nl> cs . setType ( memberRefExpr , simplifyType ( openedType ) ) ; <nl> Expr * result = memberRefExpr ; <nl> closeExistential ( result , locator ) ; <nl> - if ( dynamicSelfFnType ) { <nl> - result = new ( context ) CovariantReturnConversionExpr ( result , <nl> - dynamicSelfFnType ) ; <nl> - cs . cacheType ( result ) ; <nl> - cs . setType ( result , simplifyType ( openedType ) ) ; <nl> + <nl> + if ( cast < VarDecl > ( member ) - > getValueInterfaceType ( ) <nl> + - > hasDynamicSelfType ( ) ) { <nl> + if ( ! baseTy - > isEqual ( containerTy ) ) { <nl> + result = new ( context ) CovariantReturnConversionExpr ( <nl> + result , simplifyType ( openedType ) ) ; <nl> + cs . cacheType ( result ) ; <nl> + } <nl> } <nl> return forceUnwrapIfExpected ( result , choice , memberLocator ) ; <nl> } <nl> - <nl> + <nl> + if ( member - > getInterfaceType ( ) - > hasDynamicSelfType ( ) ) <nl> + refTy = refTy - > replaceCovariantResultType ( containerTy , 2 ) ; <nl> + <nl> / / Handle all other references . <nl> auto declRefExpr = new ( context ) DeclRefExpr ( memberRef , memberLoc , <nl> Implicit , semantics ) ; <nl> declRefExpr - > setFunctionRefKind ( choice . getFunctionRefKind ( ) ) ; <nl> + declRefExpr - > setType ( refTy ) ; <nl> cs . setType ( declRefExpr , refTy ) ; <nl> Expr * ref = declRefExpr ; <nl> <nl> - / / If the reference needs to be converted , do so now . <nl> - if ( dynamicSelfFnType ) { <nl> - ref = new ( context ) CovariantFunctionConversionExpr ( ref , <nl> + / / If this is a method whose result type is dynamic Self , or a <nl> + / / construction , replace the result type with the actual object type . <nl> + if ( ! member - > getDeclContext ( ) - > getSelfProtocolDecl ( ) ) { <nl> + if ( auto func = dyn_cast < AbstractFunctionDecl > ( member ) ) { <nl> + if ( func - > hasDynamicSelfResult ( ) & & <nl> + ! baseTy - > getOptionalObjectType ( ) ) { <nl> + if ( ! baseTy - > isEqual ( containerTy ) ) { <nl> + auto dynamicSelfFnType = refTy - > replaceCovariantResultType ( baseTy , 2 ) ; <nl> + ref = new ( context ) CovariantFunctionConversionExpr ( ref , <nl> dynamicSelfFnType ) ; <nl> - cs . cacheType ( ref ) ; <nl> + cs . cacheType ( ref ) ; <nl> + } <nl> + } <nl> + } <nl> } <nl> <nl> ApplyExpr * apply ; <nl> namespace { <nl> / / FIXME : Provide type annotation . <nl> ref = forceUnwrapIfExpected ( ref , choice , memberLocator ) ; <nl> apply = new ( context ) ConstructorRefCallExpr ( ref , base ) ; <nl> - } else if ( ! baseIsInstance & & member - > isInstanceMember ( ) ) { <nl> + } else if ( isUnboundInstanceMember ) { <nl> + auto refType = cs . simplifyType ( openedType ) ; <nl> + if ( ! cs . getType ( ref ) - > isEqual ( refType ) ) { <nl> + ref = new ( context ) FunctionConversionExpr ( ref , refType ) ; <nl> + cs . cacheType ( ref ) ; <nl> + } <nl> + <nl> / / Reference to an unbound instance method . <nl> Expr * result = new ( context ) DotSyntaxBaseIgnoredExpr ( base , dotLoc , <nl> ref , <nl> namespace { <nl> return buildMemberRef ( <nl> expr - > getBase ( ) , expr - > getDotLoc ( ) , selected , expr - > getNameLoc ( ) , <nl> cs . getConstraintLocator ( expr ) , memberLocator , expr - > isImplicit ( ) , <nl> - expr - > getAccessSemantics ( ) ) ; <nl> + / * extraUncurryLevel = * / false , expr - > getAccessSemantics ( ) ) ; <nl> } <nl> <nl> Expr * visitDynamicMemberRefExpr ( DynamicMemberRefExpr * expr ) { <nl> namespace { <nl> auto * exprLoc = cs . getConstraintLocator ( expr ) ; <nl> auto result = buildMemberRef ( <nl> base , expr - > getDotLoc ( ) , selected , expr - > getNameLoc ( ) , exprLoc , <nl> - memberLocator , expr - > isImplicit ( ) , AccessSemantics : : Ordinary ) ; <nl> + memberLocator , expr - > isImplicit ( ) , / * extraUncurryLevel = * / true , <nl> + AccessSemantics : : Ordinary ) ; <nl> if ( ! result ) <nl> return nullptr ; <nl> <nl> namespace { <nl> if ( cs . getType ( base ) - > is < AnyMetatypeType > ( ) ) { <nl> return buildMemberRef ( <nl> base , dotLoc , overload , nameLoc , cs . getConstraintLocator ( expr ) , <nl> - ctorLocator , implicit , AccessSemantics : : Ordinary ) ; <nl> + ctorLocator , implicit , / * extraUncurryLevel = * / true , <nl> + AccessSemantics : : Ordinary ) ; <nl> } <nl> <nl> / / The subexpression must be either ' self ' or ' super ' . <nl> namespace { <nl> case OverloadChoiceKind : : DeclViaDynamic : <nl> return buildMemberRef ( base , dotLoc , selected , nameLoc , <nl> cs . getConstraintLocator ( expr ) , memberLocator , <nl> - implicit , AccessSemantics : : Ordinary ) ; <nl> + implicit , / * extraUncurryLevel = * / false , <nl> + AccessSemantics : : Ordinary ) ; <nl> <nl> case OverloadChoiceKind : : TupleIndex : { <nl> Type toType = simplifyType ( cs . getType ( expr ) ) ; <nl> static Expr * buildCallAsFunctionMethodRef ( <nl> auto * fn = apply - > getFn ( ) ; <nl> auto * declRef = rewriter . buildMemberRef ( <nl> fn , / * dotLoc * / SourceLoc ( ) , selected , DeclNameLoc ( fn - > getEndLoc ( ) ) , <nl> - calleeLoc , calleeLoc , / * implicit * / true , AccessSemantics : : Ordinary ) ; <nl> + calleeLoc , calleeLoc , / * implicit * / true , <nl> + / * extraUncurryLevel = * / true , AccessSemantics : : Ordinary ) ; <nl> if ( ! declRef ) <nl> return nullptr ; <nl> declRef - > setImplicit ( apply - > isImplicit ( ) ) ; <nl> ExprRewriter : : finishApplyDynamicCallable ( ApplyExpr * apply , <nl> / / Construct expression referencing the ` dynamicallyCall ` method . <nl> auto member = buildMemberRef ( fn , SourceLoc ( ) , selected , <nl> DeclNameLoc ( method - > getNameLoc ( ) ) , loc , loc , <nl> - / * implicit * / true , AccessSemantics : : Ordinary ) ; <nl> + / * implicit = * / true , / * extraUncurryLevel = * / true , <nl> + AccessSemantics : : Ordinary ) ; <nl> <nl> / / Construct argument to the method ( either an array or dictionary <nl> / / expression ) . <nl> Expr * ExprRewriter : : finishApply ( ApplyExpr * apply , Type openedType , <nl> / / constructor call expr itself has the apply ' s ' implicitness ' . <nl> Expr * declRef = buildMemberRef ( fn , / * dotLoc = * / SourceLoc ( ) , * selected , <nl> DeclNameLoc ( fn - > getEndLoc ( ) ) , locator , <nl> - ctorLocator , / * Implicit = * / true , <nl> + ctorLocator , / * implicit = * / true , <nl> + / * extraUncurryLevel = * / true , <nl> AccessSemantics : : Ordinary ) ; <nl> if ( ! declRef ) <nl> return nullptr ; <nl> mmm a / lib / Sema / ConstraintSystem . cpp <nl> ppp b / lib / Sema / ConstraintSystem . cpp <nl> ConstraintSystem : : getTypeOfMemberReference ( <nl> <nl> openedType = openedType - > removeArgumentLabels ( numRemovedArgumentLabels ) ; <nl> <nl> - if ( ! outerDC - > getSelfProtocolDecl ( ) ) { <nl> - / / Class methods returning Self as well as constructors get the <nl> - / / result replaced with the base object type . <nl> - if ( auto func = dyn_cast < AbstractFunctionDecl > ( value ) ) { <nl> - if ( func - > hasDynamicSelfResult ( ) & & <nl> - ! baseObjTy - > getOptionalObjectType ( ) ) { <nl> - openedType = openedType - > replaceCovariantResultType ( baseObjTy , 2 ) ; <nl> - } <nl> - } else if ( auto * decl = dyn_cast < SubscriptDecl > ( value ) ) { <nl> - if ( decl - > getElementInterfaceType ( ) - > hasDynamicSelfType ( ) ) { <nl> - openedType = openedType - > replaceCovariantResultType ( baseObjTy , 2 ) ; <nl> - } <nl> - } else if ( auto * decl = dyn_cast < VarDecl > ( value ) ) { <nl> - if ( decl - > getValueInterfaceType ( ) - > hasDynamicSelfType ( ) ) { <nl> - openedType = openedType - > replaceCovariantResultType ( baseObjTy , 1 ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> / / If we are looking at a member of an existential , open the existential . <nl> Type baseOpenedTy = baseObjTy ; <nl> - <nl> if ( baseObjTy - > isExistentialType ( ) ) { <nl> auto openedArchetype = OpenedArchetypeType : : get ( baseObjTy ) ; <nl> OpenedExistentialTypes . push_back ( { getConstraintLocator ( locator ) , <nl> ConstraintSystem : : getTypeOfMemberReference ( <nl> } <nl> <nl> / / Constrain the ' self ' object type . <nl> - auto openedFnType = openedType - > castTo < FunctionType > ( ) ; <nl> - auto openedParams = openedFnType - > getParams ( ) ; <nl> + auto openedParams = openedType - > castTo < FunctionType > ( ) - > getParams ( ) ; <nl> assert ( openedParams . size ( ) = = 1 ) ; <nl> <nl> Type selfObjTy = openedParams . front ( ) . getPlainType ( ) - > getMetatypeInstanceType ( ) ; <nl> ConstraintSystem : : getTypeOfMemberReference ( <nl> } <nl> <nl> / / Compute the type of the reference . <nl> - Type type ; <nl> + Type type = openedType ; <nl> + <nl> + if ( ! outerDC - > getSelfProtocolDecl ( ) ) { <nl> + / / Class methods returning Self as well as constructors get the <nl> + / / result replaced with the base object type . <nl> + if ( auto func = dyn_cast < AbstractFunctionDecl > ( value ) ) { <nl> + if ( func - > hasDynamicSelfResult ( ) & & <nl> + ! baseObjTy - > getOptionalObjectType ( ) ) { <nl> + type = type - > replaceCovariantResultType ( baseObjTy , 2 ) ; <nl> + } <nl> + } else if ( auto * decl = dyn_cast < SubscriptDecl > ( value ) ) { <nl> + if ( decl - > getElementInterfaceType ( ) - > hasDynamicSelfType ( ) ) { <nl> + type = type - > replaceCovariantResultType ( baseObjTy , 2 ) ; <nl> + } <nl> + } else if ( auto * decl = dyn_cast < VarDecl > ( value ) ) { <nl> + if ( decl - > getValueInterfaceType ( ) - > hasDynamicSelfType ( ) ) { <nl> + type = type - > replaceCovariantResultType ( baseObjTy , 1 ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> if ( hasAppliedSelf ) { <nl> / / For a static member referenced through a metatype or an instance <nl> / / member referenced through an instance , strip off the ' self ' . <nl> - type = openedFnType - > getResult ( ) ; <nl> + type = type - > castTo < FunctionType > ( ) - > getResult ( ) ; <nl> } else { <nl> / / For an unbound instance method reference , replace the ' Self ' <nl> / / parameter with the base type . <nl> - openedType = openedFnType - > replaceSelfParameterType ( baseObjTy ) ; <nl> - type = openedType ; <nl> + type = type - > replaceSelfParameterType ( baseObjTy ) ; <nl> } <nl> <nl> / / When accessing protocol members with an existential base , replace <nl>
|
Sema : Refactor CSApply in preparation for curry thunks
|
apple/swift
|
90ee606de75dbe433d972af78be8e419f276ca1c
|
2020-02-27T04:10:07Z
|
mmm a / src / core / lib / iomgr / ev_epoll_linux . c <nl> ppp b / src / core / lib / iomgr / ev_epoll_linux . c <nl> static void pollset_work_and_unlock ( grpc_exec_ctx * exec_ctx , <nl> append_error ( error , grpc_wakeup_fd_consume_wakeup ( & global_wakeup_fd ) , <nl> err_desc ) ; <nl> } else if ( data_ptr = = & pi - > workqueue_wakeup_fd ) { <nl> - append_error ( error , grpc_wakeup_fd_consume_wakeup ( & global_wakeup_fd ) , <nl> + append_error ( error , <nl> + grpc_wakeup_fd_consume_wakeup ( & pi - > workqueue_wakeup_fd ) , <nl> err_desc ) ; <nl> maybe_do_workqueue_work ( exec_ctx , pi ) ; <nl> } else if ( data_ptr = = & polling_island_wakeup_fd ) { <nl>
|
Merge pull request from ctiller / cp
|
grpc/grpc
|
1291fd4b2f9f502f412c3d6cd5dd5fdc18092842
|
2017-01-26T20:40:51Z
|
mmm a / include / swift / AST / DiagnosticsSema . def <nl> ppp b / include / swift / AST / DiagnosticsSema . def <nl> ERROR ( requirement_restricts_self , none , <nl> " ' Self ' " , <nl> ( DescriptiveDeclKind , DeclName , StringRef , unsigned , StringRef ) ) <nl> ERROR ( witness_argument_name_mismatch , none , <nl> - " % select { method | initializer } 0 % 1 has different argument labels from those " <nl> - " required by protocol % 2 ( % 3 ) " , ( bool , DeclName , Type , DeclName ) ) <nl> + " % 0 % 1 has different argument labels " <nl> + " from those required by protocol % 2 ( % 3 ) " , <nl> + ( DescriptiveDeclKind , DeclName , Type , DeclName ) ) <nl> ERROR ( witness_initializer_not_required , none , <nl> " initializer requirement % 0 can only be satisfied by a ' required ' " <nl> " initializer in % select { | the definition of } 1 non - final class % 2 " , <nl> NOTE ( protocol_witness_throws_conflict , none , <nl> " candidate throws , but protocol does not allow it " , ( ) ) <nl> NOTE ( protocol_witness_not_objc , none , <nl> " candidate is explicitly ' @ nonobjc ' " , ( ) ) <nl> + NOTE ( protocol_witness_enum_case_payload , none , <nl> + " candidate is an enum case with associated values , " <nl> + " but protocol does not allow it " , ( ) ) <nl> <nl> NOTE ( protocol_witness_type , none , <nl> " possibly intended match " , ( ) ) <nl> mmm a / include / swift / SILOptimizer / Utils / InstOptUtils . h <nl> ppp b / include / swift / SILOptimizer / Utils / InstOptUtils . h <nl> bool calleesAreStaticallyKnowable ( SILModule & module , SILDeclRef decl ) ; <nl> / / / be reached by calling the function represented by Decl ? <nl> bool calleesAreStaticallyKnowable ( SILModule & module , AbstractFunctionDecl * afd ) ; <nl> <nl> + / / / Do we have enough information to determine all callees that could <nl> + / / / be reached by calling the function represented by Decl ? <nl> + bool calleesAreStaticallyKnowable ( SILModule & module , EnumElementDecl * eed ) ; <nl> + <nl> / / Attempt to get the instance for , whose static type is the same as <nl> / / its exact dynamic type , returning a null SILValue ( ) if we cannot find it . <nl> / / The information that a static type is the same as the exact dynamic , <nl> mmm a / lib / SIL / SILDeclRef . cpp <nl> ppp b / lib / SIL / SILDeclRef . cpp <nl> SILLinkage SILDeclRef : : getLinkage ( ForDefinition_t forDefinition ) const { <nl> limit = Limit : : OnDemand ; <nl> } <nl> } <nl> - <nl> + <nl> auto effectiveAccess = d - > getEffectiveAccess ( ) ; <nl> <nl> / / Private setter implementations for an internal storage declaration should <nl> mmm a / lib / SILGen / SILGenType . cpp <nl> ppp b / lib / SILGen / SILGenType . cpp <nl> template < typename T > class SILGenWitnessTable : public SILWitnessVisitor < T > { <nl> <nl> public : <nl> void addMethod ( SILDeclRef requirementRef ) { <nl> - auto reqAccessor = dyn_cast < AccessorDecl > ( requirementRef . getDecl ( ) ) ; <nl> + auto reqDecl = requirementRef . getDecl ( ) ; <nl> + <nl> + / / Static functions can be witnessed by enum cases with payload <nl> + if ( ! ( isa < AccessorDecl > ( reqDecl ) | | isa < ConstructorDecl > ( reqDecl ) ) ) { <nl> + auto FD = cast < FuncDecl > ( reqDecl ) ; <nl> + if ( auto witness = asDerived ( ) . getWitness ( FD ) ) { <nl> + if ( auto EED = dyn_cast < EnumElementDecl > ( witness . getDecl ( ) ) ) { <nl> + return addMethodImplementation ( <nl> + requirementRef , SILDeclRef ( EED , SILDeclRef : : Kind : : EnumElement ) , <nl> + witness ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + auto reqAccessor = dyn_cast < AccessorDecl > ( reqDecl ) ; <nl> <nl> / / If it ' s not an accessor , just look for the witness . <nl> if ( ! reqAccessor ) { <nl> - if ( auto witness = asDerived ( ) . getWitness ( requirementRef . getDecl ( ) ) ) { <nl> + if ( auto witness = asDerived ( ) . getWitness ( reqDecl ) ) { <nl> return addMethodImplementation ( <nl> requirementRef , requirementRef . withDecl ( witness . getDecl ( ) ) , <nl> witness ) ; <nl> template < typename T > class SILGenWitnessTable : public SILWitnessVisitor < T > { <nl> if ( ! witness ) <nl> return asDerived ( ) . addMissingMethod ( requirementRef ) ; <nl> <nl> + / / Static properties can be witnessed by enum cases without payload <nl> + if ( auto EED = dyn_cast < EnumElementDecl > ( witness . getDecl ( ) ) ) { <nl> + return addMethodImplementation ( <nl> + requirementRef , SILDeclRef ( EED , SILDeclRef : : Kind : : EnumElement ) , <nl> + witness ) ; <nl> + } <nl> + <nl> auto witnessStorage = cast < AbstractStorageDecl > ( witness . getDecl ( ) ) ; <nl> if ( reqAccessor - > isSetter ( ) & & ! witnessStorage - > supportsMutation ( ) ) <nl> return asDerived ( ) . addMissingMethod ( requirementRef ) ; <nl> class SILGenConformance : public SILGenWitnessTable < SILGenConformance > { <nl> witnessLinkage = SILLinkage : : Shared ; <nl> } <nl> <nl> + if ( isa < EnumElementDecl > ( witnessRef . getDecl ( ) ) ) { <nl> + assert ( witnessRef . isEnumElement ( ) & & " Witness decl , but different kind ? " ) ; <nl> + } <nl> + <nl> SILFunction * witnessFn = SGM . emitProtocolWitness ( <nl> ProtocolConformanceRef ( Conformance ) , witnessLinkage , witnessSerialized , <nl> requirementRef , witnessRef , isFree , witness ) ; <nl> mmm a / lib / SILOptimizer / Utils / InstOptUtils . cpp <nl> ppp b / lib / SILOptimizer / Utils / InstOptUtils . cpp <nl> bool swift : : calleesAreStaticallyKnowable ( SILModule & module , SILDeclRef decl ) { <nl> if ( decl . isForeign ) <nl> return false ; <nl> <nl> + if ( decl . isEnumElement ( ) ) { <nl> + return calleesAreStaticallyKnowable ( module , <nl> + cast < EnumElementDecl > ( decl . getDecl ( ) ) ) ; <nl> + } <nl> + <nl> auto * afd = decl . getAbstractFunctionDecl ( ) ; <nl> assert ( afd & & " Expected abstract function decl ! " ) ; <nl> return calleesAreStaticallyKnowable ( module , afd ) ; <nl> bool swift : : calleesAreStaticallyKnowable ( SILModule & module , <nl> llvm_unreachable ( " Unhandled access level in switch . " ) ; <nl> } <nl> <nl> + / / / Are the callees that could be called through Decl statically <nl> + / / / knowable based on the Decl and the compilation mode ? <nl> + / / FIXME : Merge this with calleesAreStaticallyKnowable above <nl> + bool swift : : calleesAreStaticallyKnowable ( SILModule & module , <nl> + EnumElementDecl * eed ) { <nl> + const DeclContext * assocDC = module . getAssociatedContext ( ) ; <nl> + if ( ! assocDC ) <nl> + return false ; <nl> + <nl> + / / Only handle members defined within the SILModule ' s associated context . <nl> + if ( ! eed - > isChildContextOf ( assocDC ) ) <nl> + return false ; <nl> + <nl> + if ( eed - > isDynamic ( ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + if ( ! eed - > hasAccess ( ) ) <nl> + return false ; <nl> + <nl> + / / Only consider ' private ' members , unless we are in whole - module compilation . <nl> + switch ( eed - > getEffectiveAccess ( ) ) { <nl> + case AccessLevel : : Open : <nl> + return false ; <nl> + case AccessLevel : : Public : <nl> + case AccessLevel : : Internal : <nl> + return module . isWholeModule ( ) ; <nl> + case AccessLevel : : FilePrivate : <nl> + case AccessLevel : : Private : <nl> + return true ; <nl> + } <nl> + <nl> + llvm_unreachable ( " Unhandled access level in switch . " ) ; <nl> + } <nl> + <nl> Optional < FindLocalApplySitesResult > <nl> swift : : findLocalApplySites ( FunctionRefBaseInst * fri ) { <nl> SmallVector < Operand * , 32 > worklist ( fri - > use_begin ( ) , fri - > use_end ( ) ) ; <nl> mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> swift : : matchWitness ( <nl> assert ( ! req - > isInvalid ( ) & & " Cannot have an invalid requirement here " ) ; <nl> <nl> / / / Make sure the witness is of the same kind as the requirement . <nl> - if ( req - > getKind ( ) ! = witness - > getKind ( ) ) <nl> - return RequirementMatch ( witness , MatchKind : : KindConflict ) ; <nl> + if ( req - > getKind ( ) ! = witness - > getKind ( ) ) { <nl> + / / An enum case can witness : <nl> + / / 1 . A static get - only property requirement , as long as the property ' s <nl> + / / type is ` Self ` or it matches the type of the enum explicitly . <nl> + / / 2 . A static function requirement , if the enum case has a payload <nl> + / / and the payload types and labels match the function and the <nl> + / / function returns ` Self ` or the type of the enum . <nl> + / / <nl> + / / If there are any discrepencies , we ' ll diagnose it later . For now , <nl> + / / let ' s assume the match is valid . <nl> + if ( ! ( ( isa < VarDecl > ( req ) | | isa < FuncDecl > ( req ) ) & & <nl> + isa < EnumElementDecl > ( witness ) ) ) <nl> + return RequirementMatch ( witness , MatchKind : : KindConflict ) ; <nl> + } <nl> <nl> / / If we ' re currently validating the witness , bail out . <nl> if ( witness - > isRecursiveValidation ( ) ) <nl> swift : : matchWitness ( <nl> / / Perform basic matching of the requirement and witness . <nl> bool decomposeFunctionType = false ; <nl> bool ignoreReturnType = false ; <nl> - if ( auto funcReq = dyn_cast < FuncDecl > ( req ) ) { <nl> + if ( isa < FuncDecl > ( req ) & & isa < FuncDecl > ( witness ) ) { <nl> + auto funcReq = cast < FuncDecl > ( req ) ; <nl> auto funcWitness = cast < FuncDecl > ( witness ) ; <nl> <nl> / / Either both must be ' static ' or neither . <nl> swift : : matchWitness ( <nl> } else if ( isa < ConstructorDecl > ( witness ) ) { <nl> decomposeFunctionType = true ; <nl> ignoreReturnType = true ; <nl> + } else if ( isa < EnumElementDecl > ( witness ) ) { <nl> + auto enumCase = cast < EnumElementDecl > ( witness ) ; <nl> + if ( enumCase - > hasAssociatedValues ( ) & & isa < VarDecl > ( req ) ) <nl> + return RequirementMatch ( witness , MatchKind : : EnumCaseWithAssociatedValues ) ; <nl> + auto isValid = isa < VarDecl > ( req ) | | isa < FuncDecl > ( req ) ; <nl> + if ( ! isValid ) <nl> + return RequirementMatch ( witness , MatchKind : : KindConflict ) ; <nl> + if ( ! cast < ValueDecl > ( req ) - > isStatic ( ) ) <nl> + return RequirementMatch ( witness , MatchKind : : StaticNonStaticConflict ) ; <nl> + if ( isa < VarDecl > ( req ) & & <nl> + cast < VarDecl > ( req ) - > getParsedAccessor ( AccessorKind : : Set ) ) <nl> + return RequirementMatch ( witness , MatchKind : : SettableConflict ) ; <nl> } <nl> <nl> / / If the requirement is @ objc , the witness must not be marked with @ nonobjc . <nl> diagnoseMatch ( ModuleDecl * module , NormalProtocolConformance * conformance , <nl> if ( match . Kind ! = MatchKind : : RenamedMatch & & <nl> ! match . Witness - > getAttrs ( ) . hasAttribute < ImplementsAttr > ( ) & & <nl> match . Witness - > getFullName ( ) & & <nl> - req - > getFullName ( ) ! = match . Witness - > getFullName ( ) ) <nl> + req - > getFullName ( ) ! = match . Witness - > getFullName ( ) & & <nl> + ! isa < EnumElementDecl > ( match . Witness ) ) <nl> return ; <nl> <nl> / / Form a string describing the associated type deductions . <nl> diagnoseMatch ( ModuleDecl * module , NormalProtocolConformance * conformance , <nl> break ; <nl> <nl> case MatchKind : : TypeConflict : { <nl> - if ( ! isa < TypeDecl > ( req ) ) { <nl> + if ( ! isa < TypeDecl > ( req ) & & ! isa < EnumElementDecl > ( match . Witness ) ) { <nl> computeFixitsForOverridenDeclaration ( match . Witness , req , [ & ] ( bool ) { <nl> return diags . diagnose ( match . Witness , <nl> diag : : protocol_witness_type_conflict , <nl> diagnoseMatch ( ModuleDecl * module , NormalProtocolConformance * conformance , <nl> auto witness = match . Witness ; <nl> auto diag = diags . diagnose ( witness , diag : : protocol_witness_static_conflict , <nl> ! req - > isInstanceMember ( ) ) ; <nl> + if ( isa < EnumElementDecl > ( witness ) ) <nl> + break ; <nl> if ( req - > isInstanceMember ( ) ) { <nl> SourceLoc loc ; <nl> if ( auto FD = dyn_cast < FuncDecl > ( witness ) ) { <nl> diagnoseMatch ( ModuleDecl * module , NormalProtocolConformance * conformance , <nl> } <nl> break ; <nl> } <nl> + case MatchKind : : EnumCaseWithAssociatedValues : <nl> + diags . diagnose ( match . Witness , diag : : protocol_witness_enum_case_payload ) ; <nl> + break ; <nl> } <nl> } <nl> <nl> ConformanceChecker : : resolveWitnessViaLookup ( ValueDecl * requirement ) { <nl> auto & diags = proto - > getASTContext ( ) . Diags ; <nl> { <nl> SourceLoc diagLoc = getLocForDiagnosingWitness ( conformance , witness ) ; <nl> - auto diag = diags . diagnose ( diagLoc , <nl> - diag : : witness_argument_name_mismatch , <nl> - isa < ConstructorDecl > ( witness ) , <nl> - witness - > getFullName ( ) , <nl> - proto - > getDeclaredType ( ) , <nl> - requirement - > getFullName ( ) ) ; <nl> + auto diag = diags . diagnose ( <nl> + diagLoc , diag : : witness_argument_name_mismatch , <nl> + witness - > getDescriptiveKind ( ) , witness - > getFullName ( ) , <nl> + proto - > getDeclaredType ( ) , requirement - > getFullName ( ) ) ; <nl> if ( diagLoc = = witness - > getLoc ( ) ) { <nl> fixDeclarationName ( diag , witness , requirement - > getFullName ( ) ) ; <nl> } else { <nl> mmm a / lib / Sema / TypeCheckProtocol . h <nl> ppp b / lib / Sema / TypeCheckProtocol . h <nl> enum class MatchKind : uint8_t { <nl> <nl> / / / The witness is missing a ` @ differentiable ` attribute from the requirement . <nl> MissingDifferentiableAttr , <nl> + <nl> + / / / The witness did not match because it is an enum case with <nl> + / / / associated values . <nl> + EnumCaseWithAssociatedValues , <nl> } ; <nl> <nl> / / / Describes the kind of optional adjustment performed when <nl> struct RequirementMatch { <nl> case MatchKind : : ThrowsConflict : <nl> case MatchKind : : NonObjC : <nl> case MatchKind : : MissingDifferentiableAttr : <nl> + case MatchKind : : EnumCaseWithAssociatedValues : <nl> return false ; <nl> } <nl> <nl> struct RequirementMatch { <nl> case MatchKind : : ThrowsConflict : <nl> case MatchKind : : NonObjC : <nl> case MatchKind : : MissingDifferentiableAttr : <nl> + case MatchKind : : EnumCaseWithAssociatedValues : <nl> return false ; <nl> } <nl> <nl> mmm a / lib / TBDGen / TBDGen . cpp <nl> ppp b / lib / TBDGen / TBDGen . cpp <nl> void TBDGenVisitor : : addConformances ( DeclContext * DC ) { <nl> } <nl> } ; <nl> <nl> - rootConformance - > forEachValueWitness ( <nl> - [ & ] ( ValueDecl * valueReq , Witness witness ) { <nl> - auto witnessDecl = witness . getDecl ( ) ; <nl> - if ( isa < AbstractFunctionDecl > ( valueReq ) ) { <nl> - addSymbolIfNecessary ( valueReq , witnessDecl ) ; <nl> - } else if ( auto * storage = dyn_cast < AbstractStorageDecl > ( valueReq ) ) { <nl> - auto witnessStorage = cast < AbstractStorageDecl > ( witnessDecl ) ; <nl> - storage - > visitOpaqueAccessors ( [ & ] ( AccessorDecl * reqtAccessor ) { <nl> - auto witnessAccessor = <nl> - witnessStorage - > getSynthesizedAccessor ( <nl> - reqtAccessor - > getAccessorKind ( ) ) ; <nl> - addSymbolIfNecessary ( reqtAccessor , witnessAccessor ) ; <nl> - } ) ; <nl> - } <nl> - } ) ; <nl> + rootConformance - > forEachValueWitness ( [ & ] ( ValueDecl * valueReq , <nl> + Witness witness ) { <nl> + auto witnessDecl = witness . getDecl ( ) ; <nl> + if ( isa < AbstractFunctionDecl > ( valueReq ) ) { <nl> + addSymbolIfNecessary ( valueReq , witnessDecl ) ; <nl> + } else if ( auto * storage = dyn_cast < AbstractStorageDecl > ( valueReq ) ) { <nl> + if ( auto witnessStorage = dyn_cast < AbstractStorageDecl > ( witnessDecl ) ) { <nl> + storage - > visitOpaqueAccessors ( [ & ] ( AccessorDecl * reqtAccessor ) { <nl> + auto witnessAccessor = witnessStorage - > getSynthesizedAccessor ( <nl> + reqtAccessor - > getAccessorKind ( ) ) ; <nl> + addSymbolIfNecessary ( reqtAccessor , witnessAccessor ) ; <nl> + } ) ; <nl> + } else if ( isa < EnumElementDecl > ( witnessDecl ) ) { <nl> + addSymbolIfNecessary ( valueReq , witnessDecl ) ; <nl> + } <nl> + } <nl> + } ) ; <nl> } <nl> } <nl> <nl> new file mode 100644 <nl> index 000000000000 . . f05560804d1e <nl> mmm / dev / null <nl> ppp b / test / SILGen / protocol_enum_witness . swift <nl> <nl> + / / RUN : % target - swift - emit - silgen % s | % FileCheck % s <nl> + <nl> + protocol Foo { <nl> + static var button : Self { get } <nl> + } <nl> + <nl> + enum Bar : Foo { <nl> + case button <nl> + } <nl> + <nl> + protocol AnotherFoo { <nl> + static func bar ( arg : Int ) - > Self <nl> + } <nl> + <nl> + enum AnotherBar : AnotherFoo { <nl> + case bar ( arg : Int ) <nl> + } <nl> + <nl> + / / CHECK - LABEL : sil private [ transparent ] [ thunk ] [ ossa ] @ $ s21protocol_enum_witness3BarOAA3FooA2aDP6buttonxvgZTW : $ @ convention ( witness_method : Foo ) ( @ thick Bar . Type ) - > @ out Bar { <nl> + / / CHECK : bb0 ( [ [ BAR : % . * ] ] : $ * Bar , [ [ BAR_TYPE : % . * ] ] : $ @ thick Bar . Type ) : <nl> + / / CHECK - NEXT : [ [ META_TYPE : % . * ] ] = metatype $ @ thin Bar . Type <nl> + / / CHECK : [ [ REF : % . * ] ] = function_ref @ $ s21protocol_enum_witness3BarO6buttonyA2CmF : $ @ convention ( method ) ( @ thin Bar . Type ) - > Bar <nl> + / / CHECK - NEXT : [ [ RESULT : % . * ] ] = apply [ [ REF ] ] ( [ [ META_TYPE ] ] ) : $ @ convention ( method ) ( @ thin Bar . Type ) - > Bar <nl> + / / CHECK - NEXT : store [ [ RESULT ] ] to [ trivial ] [ [ BAR ] ] : $ * Bar <nl> + / / CHECK - NEXT : [ [ TUPLE : % . * ] ] = tuple ( ) <nl> + / / CHECK - NEXT : return [ [ TUPLE ] ] : $ ( ) <nl> + / / CHECK - END : } <nl> + <nl> + / / CHECK - LABEL : sil hidden [ transparent ] [ ossa ] @ $ s21protocol_enum_witness3BarO6buttonyA2CmF : $ @ convention ( method ) ( @ thin Bar . Type ) - > Bar { <nl> + / / CHECK : bb0 ( { { % . * } } : $ @ thin Bar . Type ) : <nl> + / / CHECK - NEXT : [ [ CASE : % . * ] ] = enum $ Bar , # Bar . button ! enumelt <nl> + / / CHECK - NEXT : return [ [ CASE ] ] : $ Bar <nl> + / / CHECK - END : } <nl> + <nl> + / / CHECK - LABEL : sil private [ transparent ] [ thunk ] [ ossa ] @ $ s21protocol_enum_witness10AnotherBarOAA0D3FooA2aDP3bar3argxSi_tFZTW : $ @ convention ( witness_method : AnotherFoo ) ( Int , @ thick AnotherBar . Type ) - > @ out AnotherBar { <nl> + / / CHECK : bb0 ( [ [ ANOTHER_BAR : % . * ] ] : $ * AnotherBar , [ [ INT_ARG : % . * ] ] : $ Int , [ [ ANOTHER_BAR_TYPE : % . * ] ] : $ @ thick AnotherBar . Type ) : <nl> + / / CHECK - NEXT : [ [ META_TYPE : % . * ] ] = metatype $ @ thin AnotherBar . Type <nl> + / / CHECK : [ [ REF : % . * ] ] = function_ref @ $ s21protocol_enum_witness10AnotherBarO3baryACSi_tcACmF : $ @ convention ( method ) ( Int , @ thin AnotherBar . Type ) - > AnotherBar <nl> + / / CHECK - NEXT : [ [ RESULT : % . * ] ] = apply [ [ REF ] ] ( [ [ INT_ARG ] ] , [ [ META_TYPE ] ] ) : $ @ convention ( method ) ( Int , @ thin AnotherBar . Type ) - > AnotherBar <nl> + / / CHECK - NEXT : store [ [ RESULT ] ] to [ trivial ] [ [ ANOTHER_BAR ] ] : $ * AnotherBar <nl> + / / CHECK - NEXT : [ [ TUPLE : % . * ] ] = tuple ( ) <nl> + / / CHECK - NEXT : return [ [ TUPLE ] ] : $ ( ) <nl> + / / CHECK - END : } <nl> + <nl> + / / CHECK - LABEL : sil_witness_table hidden Bar : Foo module protocol_enum_witness { <nl> + / / CHECK : method # Foo . button ! getter : < Self where Self : Foo > ( Self . Type ) - > ( ) - > Self : @ $ s21protocol_enum_witness3BarOAA3FooA2aDP6buttonxvgZTW <nl> + <nl> + / / CHECK - LABEL : sil_witness_table hidden AnotherBar : AnotherFoo module protocol_enum_witness { <nl> + / / CHECK : method # AnotherFoo . bar : < Self where Self : AnotherFoo > ( Self . Type ) - > ( Int ) - > Self : @ $ s21protocol_enum_witness10AnotherBarOAA0D3FooA2aDP3bar3argxSi_tFZTW <nl> new file mode 100644 <nl> index 000000000000 . . 7a9698a9f88b <nl> mmm / dev / null <nl> ppp b / test / decl / protocol / protocol_enum_witness . swift <nl> <nl> + / / RUN : % target - typecheck - verify - swift <nl> + <nl> + / / / / / / WITNESS MATCHING FOR PAYLOAD - LESS ENUMS / / / / / / <nl> + <nl> + / / Requirement is settable , so witness cannot satisfy it / / <nl> + <nl> + protocol Foo1 { <nl> + static var bar : Self { get set } / / expected - note { { protocol requires property ' bar ' with type ' Bar1 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar1 : Foo1 { / / expected - error { { type ' Bar1 ' does not conform to protocol ' Foo1 ' } } <nl> + case bar / / expected - note { { candidate is not settable , but protocol requires it } } <nl> + } <nl> + <nl> + / / Witness has associated values , which is unsupported / / <nl> + <nl> + protocol Foo2 { <nl> + static var bar : Self { get set } / / expected - note { { protocol requires property ' bar ' with type ' Bar2 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar2 : Foo2 { / / expected - error { { type ' Bar2 ' does not conform to protocol ' Foo2 ' } } <nl> + case bar ( Int ) / / expected - note { { candidate is an enum case with associated values , but protocol does not allow it } } <nl> + } <nl> + <nl> + protocol Foo3 { <nl> + static var bar : Self { get } / / expected - note { { protocol requires property ' bar ' with type ' Bar3 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar3 : Foo3 { / / expected - error { { type ' Bar3 ' does not conform to protocol ' Foo3 ' } } <nl> + case bar ( Int ) / / expected - note { { candidate is an enum case with associated values , but protocol does not allow it } } <nl> + } <nl> + <nl> + / / Requirement is not static , so it cannot be witnessed by the enum case / / <nl> + <nl> + protocol Foo4 { <nl> + var bar : Self { get } / / expected - note { { protocol requires property ' bar ' with type ' Bar4 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar4 : Foo4 { / / expected - error { { type ' Bar4 ' does not conform to protocol ' Foo4 ' } } <nl> + case bar / / expected - note { { candidate operates on a type , not an instance as required } } <nl> + } <nl> + <nl> + protocol Foo5 { <nl> + var bar : Self { get set } / / expected - note { { protocol requires property ' bar ' with type ' Bar5 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar5 : Foo5 { / / expected - error { { type ' Bar5 ' does not conform to protocol ' Foo5 ' } } <nl> + case bar / / expected - note { { candidate operates on a type , not an instance as required } } <nl> + } <nl> + <nl> + / / Requirement does not have Self type , so it cannot be witnessed by the enum case / / <nl> + <nl> + protocol Foo6 { <nl> + static var bar : Int { get } / / expected - note { { protocol requires property ' bar ' with type ' Int ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar6 : Foo6 { / / expected - error { { type ' Bar6 ' does not conform to protocol ' Foo6 ' } } <nl> + case bar / / expected - note { { candidate has non - matching type ' ( Bar6 . Type ) - > Bar6 ' } } <nl> + } <nl> + <nl> + / / Valid cases <nl> + <nl> + protocol Foo7 { <nl> + static var bar : Self { get } <nl> + } <nl> + <nl> + enum Bar7 : Foo7 { <nl> + case bar / / Okay <nl> + } <nl> + <nl> + protocol Foo8 { <nl> + static var bar : Bar8 { get } <nl> + } <nl> + <nl> + enum Bar8 : Foo8 { <nl> + case bar / / Okay <nl> + } <nl> + <nl> + / / / / / / WITNESS MATCHING FOR PAYLOAD ENUMS / / / / / / <nl> + <nl> + / / Witness does not have argument label , but requirement does <nl> + <nl> + protocol Foo9 { <nl> + static func bar ( f : Int ) - > Self / / expected - note { { protocol requires function ' bar ( f : ) ' with type ' ( Int ) - > Bar9 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar9 : Foo9 { / / expected - error { { type ' Bar9 ' does not conform to protocol ' Foo9 ' } } <nl> + case bar ( _ f : Int ) / / expected - note { { candidate has non - matching type ' ( Bar9 . Type ) - > ( Int ) - > Bar9 ' } } <nl> + } <nl> + <nl> + / / Witness does not have any labels , but requirement does <nl> + <nl> + protocol Foo10 { <nl> + static func bar ( g : Int ) - > Self / / expected - note { { protocol requires function ' bar ( g : ) ' with type ' ( Int ) - > Bar10 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar10 : Foo10 { / / expected - error { { type ' Bar10 ' does not conform to protocol ' Foo10 ' } } <nl> + case bar ( Int ) / / expected - note { { candidate has non - matching type ' ( Bar10 . Type ) - > ( Int ) - > Bar10 ' } } <nl> + } <nl> + <nl> + / / Witness does not have a payload , but requirement is a function <nl> + <nl> + protocol Foo11 { <nl> + static func bar ( h : Int ) - > Self / / expected - note { { protocol requires function ' bar ( h : ) ' with type ' ( Int ) - > Bar11 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar11 : Foo11 { / / expected - error { { type ' Bar11 ' does not conform to protocol ' Foo11 ' } } <nl> + case bar / / expected - note { { candidate has non - matching type ' ( Bar11 . Type ) - > Bar11 ' } } <nl> + } <nl> + <nl> + / / Witness is static , but requirement is not <nl> + <nl> + protocol Foo12 { <nl> + func bar ( i : Int ) - > Self / / expected - note { { protocol requires function ' bar ( i : ) ' with type ' ( Int ) - > Bar12 ' ; do you want to add a stub ? } } <nl> + } <nl> + <nl> + enum Bar12 : Foo12 { / / expected - error { { type ' Bar12 ' does not conform to protocol ' Foo12 ' } } <nl> + case bar / / expected - note { { candidate operates on a type , not an instance as required } } <nl> + } <nl> + <nl> + / / Valid cases <nl> + <nl> + protocol Foo13 { <nl> + static func bar ( j : Int ) - > Self <nl> + static func baz ( _ k : String ) - > Bar13 <nl> + } <nl> + <nl> + enum Bar13 : Foo13 { <nl> + case bar ( j : Int ) / / Okay <nl> + case baz ( _ k : String ) / / Okay <nl> + } <nl> mmm a / test / decl / protocol / req / name_mismatch . swift <nl> ppp b / test / decl / protocol / req / name_mismatch . swift <nl> protocol P3 { <nl> } <nl> <nl> class MislabeledSubscript : P3 { <nl> - subscript ( val : String , label : String ) - > Int { / / expected - error { { method ' subscript ( _ : _ : ) ' has different argument labels from those required by protocol ' P3 ' ( ' subscript ( _ : label : ) ' ) } } <nl> + subscript ( val : String , label : String ) - > Int { / / expected - error { { subscript ' subscript ( _ : _ : ) ' has different argument labels from those required by protocol ' P3 ' ( ' subscript ( _ : label : ) ' ) } } <nl> return 1 <nl> } <nl> } <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
f3e761531a6ca395e90600a471f7207149f1970e
|
2020-03-28T11:00:15Z
|
mmm a / include / swift / AST / SearchPathOptions . h <nl> ppp b / include / swift / AST / SearchPathOptions . h <nl> class SearchPathOptions { <nl> / / / Don ' t look in for compiler - provided modules . <nl> bool SkipRuntimeLibraryImportPaths = false ; <nl> <nl> + / / / When set , don ' t validate module system dependencies . <nl> + / / / <nl> + / / / If a system header is modified and this is not set , the compiler will <nl> + / / / rebuild PCMs and compiled swiftmodules that depend on them , just like it <nl> + / / / would for a non - system header . <nl> + bool DisableModulesValidateSystemDependencies = false ; <nl> + <nl> / / / Return a hash code of any components from these options that should <nl> / / / contribute to a Swift Bridging PCH hash . <nl> llvm : : hash_code getPCHHashComponents ( ) const { <nl> class SearchPathOptions { <nl> for ( auto RuntimeLibraryImportPath : RuntimeLibraryImportPaths ) { <nl> Code = hash_combine ( Code , RuntimeLibraryImportPath ) ; <nl> } <nl> + Code = hash_combine ( Code , DisableModulesValidateSystemDependencies ) ; <nl> return Code ; <nl> } <nl> } ; <nl> mmm a / include / swift / ClangImporter / ClangImporterOptions . h <nl> ppp b / include / swift / ClangImporter / ClangImporterOptions . h <nl> class ClangImporterOptions { <nl> / / / If true ignore the swift bridged attribute . <nl> bool DisableSwiftBridgeAttr = false ; <nl> <nl> - / / / When set , don ' t validate module system headers . If a header is modified <nl> - / / / and this is not set , clang will rebuild the module . <nl> - bool DisableModulesValidateSystemHeaders = false ; <nl> - <nl> / / / When set , don ' t look for or load overlays . <nl> bool DisableOverlayModules = false ; <nl> <nl> class ClangImporterOptions { <nl> Code = hash_combine ( Code , ImportForwardDeclarations ) ; <nl> Code = hash_combine ( Code , InferImportAsMember ) ; <nl> Code = hash_combine ( Code , DisableSwiftBridgeAttr ) ; <nl> - Code = hash_combine ( Code , DisableModulesValidateSystemHeaders ) ; <nl> Code = hash_combine ( Code , DisableOverlayModules ) ; <nl> return Code ; <nl> } <nl> mmm a / lib / ClangImporter / ClangImporter . cpp <nl> ppp b / lib / ClangImporter / ClangImporter . cpp <nl> getNormalInvocationArguments ( std : : vector < std : : string > & invocationArgStrs , <nl> invocationArgStrs . back ( ) . append ( moduleCachePath ) ; <nl> } <nl> <nl> - if ( importerOpts . DisableModulesValidateSystemHeaders ) { <nl> + if ( ctx . SearchPathOpts . DisableModulesValidateSystemDependencies ) { <nl> invocationArgStrs . push_back ( " - fno - modules - validate - system - headers " ) ; <nl> } else { <nl> invocationArgStrs . push_back ( " - fmodules - validate - system - headers " ) ; <nl> mmm a / lib / Frontend / CompilerInvocation . cpp <nl> ppp b / lib / Frontend / CompilerInvocation . cpp <nl> static bool ParseClangImporterArgs ( ClangImporterOptions & Opts , <nl> Opts . BridgingHeader = A - > getValue ( ) ; <nl> Opts . DisableSwiftBridgeAttr | = Args . hasArg ( OPT_disable_swift_bridge_attr ) ; <nl> <nl> - Opts . DisableModulesValidateSystemHeaders | = Args . hasArg ( OPT_disable_modules_validate_system_headers ) ; <nl> - <nl> Opts . DisableOverlayModules | = Args . hasArg ( OPT_emit_imported_modules ) ; <nl> <nl> if ( const Arg * A = Args . getLastArg ( OPT_pch_output_dir ) ) { <nl> static bool ParseSearchPathArgs ( SearchPathOptions & Opts , <nl> <nl> Opts . SkipRuntimeLibraryImportPaths | = Args . hasArg ( OPT_nostdimport ) ; <nl> <nl> + Opts . DisableModulesValidateSystemDependencies | = <nl> + Args . hasArg ( OPT_disable_modules_validate_system_headers ) ; <nl> + <nl> / / Opts . RuntimeIncludePath is set by calls to <nl> / / setRuntimeIncludePath ( ) or setMainExecutablePath ( ) . <nl> / / Opts . RuntimeImportPath is set by calls to <nl> mmm a / lib / Frontend / ParseableInterfaceModuleLoader . cpp <nl> ppp b / lib / Frontend / ParseableInterfaceModuleLoader . cpp <nl> struct ForwardingModule { <nl> std : : string path ; <nl> uint64_t size ; <nl> uint64_t lastModificationTime ; <nl> + bool isSDKRelative ; <nl> } ; <nl> std : : vector < Dependency > dependencies ; <nl> unsigned version = 1 ; <nl> struct ForwardingModule { <nl> static llvm : : ErrorOr < ForwardingModule > load ( const llvm : : MemoryBuffer & buf ) ; <nl> <nl> / / / Adds a given dependency to the dependencies list . <nl> - void addDependency ( StringRef path , uint64_t size , uint64_t modTime ) { <nl> - dependencies . push_back ( { path . str ( ) , size , modTime } ) ; <nl> + void addDependency ( StringRef path , bool isSDKRelative , uint64_t size , <nl> + uint64_t modTime ) { <nl> + dependencies . push_back ( { path . str ( ) , size , modTime , isSDKRelative } ) ; <nl> } <nl> } ; <nl> <nl> namespace llvm { <nl> io . mapRequired ( " mtime " , dep . lastModificationTime ) ; <nl> io . mapRequired ( " path " , dep . path ) ; <nl> io . mapRequired ( " size " , dep . size ) ; <nl> + io . mapOptional ( " sdk_relative " , dep . isSDKRelative , / * default * / false ) ; <nl> } <nl> } ; <nl> <nl> class ParseableInterfaceModuleLoaderImpl { <nl> / / Check if all the provided file dependencies are up - to - date compared to <nl> / / what ' s currently on disk . <nl> bool dependenciesAreUpToDate ( StringRef modulePath , <nl> - ArrayRef < FileDependency > deps ) { <nl> + ArrayRef < FileDependency > deps , <nl> + bool skipSystemDependencies ) { <nl> SmallString < 128 > SDKRelativeBuffer ; <nl> for ( auto & in : deps ) { <nl> + if ( skipSystemDependencies & & in . isSDKRelative ( ) & & <nl> + in . isModificationTimeBased ( ) ) { <nl> + continue ; <nl> + } <nl> StringRef fullPath = getFullDependencyPath ( in , SDKRelativeBuffer ) ; <nl> switch ( checkDependency ( modulePath , in , fullPath ) ) { <nl> case DependencyStatus : : UpToDate : <nl> class ParseableInterfaceModuleLoaderImpl { <nl> return false ; <nl> } <nl> <nl> - return dependenciesAreUpToDate ( path , allDeps ) ; <nl> + bool skipCheckingSystemDependencies = <nl> + ctx . SearchPathOpts . DisableModulesValidateSystemDependencies ; <nl> + return dependenciesAreUpToDate ( path , allDeps , <nl> + skipCheckingSystemDependencies ) ; <nl> } <nl> <nl> / / Check that the output . swiftmodule file is at least as new as all the <nl> class ParseableInterfaceModuleLoaderImpl { <nl> <nl> / / Next , check the dependencies in the forwarding file . <nl> for ( auto & dep : fwd . dependencies ) { <nl> - / / Forwarding modules expand SDKRelative paths when generated , so are <nl> - / / guaranteed to be absolute . <nl> deps . push_back ( <nl> FileDependency : : modTimeBased ( <nl> - dep . path , / * isSDKRelative = * / false , dep . size , <nl> - dep . lastModificationTime ) ) ; <nl> + dep . path , dep . isSDKRelative , dep . size , dep . lastModificationTime ) ) ; <nl> } <nl> - if ( ! dependenciesAreUpToDate ( path , deps ) ) <nl> + <nl> + bool skipCheckingSystemDependencies = <nl> + ctx . SearchPathOpts . DisableModulesValidateSystemDependencies ; <nl> + if ( ! dependenciesAreUpToDate ( path , deps , skipCheckingSystemDependencies ) ) <nl> return false ; <nl> <nl> moduleBuffer = std : : move ( * modBuf ) ; <nl> class ParseableInterfaceModuleLoaderImpl { <nl> <nl> / / FIXME : We need to avoid re - statting all these dependencies , otherwise <nl> / / we may record out - of - date information . <nl> - auto addDependency = [ & ] ( StringRef path ) - > FileDependency { <nl> - auto status = fs . status ( path ) ; <nl> + SmallString < 128 > SDKRelativeBuffer ; <nl> + auto addDependency = [ & ] ( FileDependency dep ) - > FileDependency { <nl> + auto status = fs . status ( getFullDependencyPath ( dep , SDKRelativeBuffer ) ) ; <nl> uint64_t mtime = <nl> status - > getLastModificationTime ( ) . time_since_epoch ( ) . count ( ) ; <nl> - fwd . addDependency ( path , status - > getSize ( ) , mtime ) ; <nl> + fwd . addDependency ( dep . getPath ( ) , dep . isSDKRelative ( ) , status - > getSize ( ) , <nl> + mtime ) ; <nl> <nl> / / Construct new FileDependency matching what we ' ve added to the <nl> - / / forwarding module . This is no longer SDK - relative because the absolute <nl> - / / path has already been resolved . <nl> - return FileDependency : : modTimeBased ( path , / * isSDKRelative * / false , <nl> + / / forwarding module . <nl> + return FileDependency : : modTimeBased ( dep . getPath ( ) , dep . isSDKRelative ( ) , <nl> status - > getSize ( ) , mtime ) ; <nl> } ; <nl> <nl> / / Add the prebuilt module as a dependency of the forwarding module , but <nl> / / don ' t add it to the outer dependency list . <nl> - ( void ) addDependency ( fwd . underlyingModulePath ) ; <nl> + ( void ) addDependency ( FileDependency : : hashBased ( fwd . underlyingModulePath , <nl> + / * SDKRelative * / false , <nl> + / * size * / 0 , / * hash * / 0 ) ) ; <nl> <nl> / / Add all the dependencies from the prebuilt module , and update our list <nl> / / of dependencies to reflect what ' s recorded in the forwarding module . <nl> - SmallString < 128 > SDKRelativeBuffer ; <nl> for ( auto dep : deps ) { <nl> - auto adjustedDep = <nl> - addDependency ( getFullDependencyPath ( dep , SDKRelativeBuffer ) ) ; <nl> + auto adjustedDep = addDependency ( dep ) ; <nl> depsAdjustedToMTime . push_back ( adjustedDep ) ; <nl> } <nl> <nl> class ParseableInterfaceModuleLoaderImpl { <nl> findOrBuildLoadableModule ( ) { <nl> <nl> / / Track system dependencies if the parent tracker is set to do so . <nl> - / / FIXME : This means - track - system - dependencies isn ' t honored when the <nl> - / / top - level invocation isn ' t tracking dependencies <nl> bool trackSystemDependencies = false ; <nl> if ( dependencyTracker ) { <nl> auto ClangDependencyTracker = dependencyTracker - > getClangCollector ( ) ; <nl> mmm a / lib / FrontendTool / FrontendTool . cpp <nl> ppp b / lib / FrontendTool / FrontendTool . cpp <nl> int swift : : performFrontend ( ArrayRef < const char * > Args , <nl> <nl> if ( Invocation . getFrontendOptions ( ) <nl> . InputsAndOutputs . hasDependencyTrackerPath ( ) | | <nl> - ! Invocation . getFrontendOptions ( ) . IndexStorePath . empty ( ) ) <nl> - Instance - > createDependencyTracker ( Invocation . getFrontendOptions ( ) . TrackSystemDeps ) ; <nl> + ! Invocation . getFrontendOptions ( ) . IndexStorePath . empty ( ) | | <nl> + Invocation . getFrontendOptions ( ) . TrackSystemDeps ) { <nl> + / / Note that we ' re tracking dependencies even when we don ' t need to write <nl> + / / them directly ; in particular , - track - system - dependencies affects how <nl> + / / module interfaces get loaded , and so we need to be consistently tracking <nl> + / / system dependencies throughout the compiler . <nl> + Instance - > createDependencyTracker ( <nl> + Invocation . getFrontendOptions ( ) . TrackSystemDeps ) ; <nl> + } <nl> <nl> if ( Instance - > setup ( Invocation ) ) { <nl> return finishDiagProcessing ( 1 ) ; <nl> new file mode 100644 <nl> index 000000000000 . . a80c2d591e58 <nl> mmm / dev / null <nl> ppp b / test / ParseableInterface / ModuleCache / SDKDependencies - disable - validation . swift <nl> <nl> + / / RUN : % empty - directory ( % t ) <nl> + <nl> + / / 1 ) Build a prebuilt cache for our SDK <nl> + / / <nl> + / / RUN : mkdir % t / MCP % t / prebuilt - cache % t / my - sdk <nl> + / / RUN : cp - r % S / Inputs / mock - sdk / . % t / my - sdk <nl> + / / RUN : % target - swift - frontend - build - module - from - parseable - interface - serialize - parseable - module - interface - dependency - hashes - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - I % t / my - sdk - module - cache - path % t / MCP - o % t / prebuilt - cache / ExportedLib . swiftmodule - track - system - dependencies - module - name ExportedLib % t / my - sdk / ExportedLib . swiftinterface <nl> + / / RUN : % target - swift - frontend - build - module - from - parseable - interface - serialize - parseable - module - interface - dependency - hashes - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - I % t / my - sdk - module - cache - path % t / MCP - o % t / prebuilt - cache / SdkLib . swiftmodule - track - system - dependencies - module - name SdkLib % t / my - sdk / SdkLib . swiftinterface <nl> + / / <nl> + / / Check the prebuilt modules don ' t contain dependencies in the module cache , prebuilt cache , or resource dir <nl> + / / RUN : llvm - bcanalyzer - dump % t / prebuilt - cache / ExportedLib . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / RUN : llvm - bcanalyzer - dump % t / prebuilt - cache / SdkLib . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / <nl> + / / PREBUILT : MODULE_BLOCK <nl> + / / PREBUILT - NOT : FILE_DEPENDENCY { { . * [ / \ \ ] MCP [ / \ \ ] } } <nl> + / / PREBUILT - NOT : FILE_DEPENDENCY { { . * [ / \ \ ] prebuilt - cache [ / \ \ ] } } <nl> + / / PREBUILD - NOT : FILE_DEPENDENCY { { . * [ / \ \ ] lib [ / \ \ ] swift [ / \ \ ] } } <nl> + / / <nl> + / / Re - build them in the opposite order <nl> + / / RUN : % empty - directory ( % t / prebuilt - cache ) <nl> + / / RUN : % empty - directory ( % t / MCP ) <nl> + / / RUN : % target - swift - frontend - build - module - from - parseable - interface - serialize - parseable - module - interface - dependency - hashes - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - I % t / my - sdk - module - cache - path % t / MCP - o % t / prebuilt - cache / SdkLib . swiftmodule - track - system - dependencies - module - name SdkLib % t / my - sdk / SdkLib . swiftinterface <nl> + / / RUN : % target - swift - frontend - build - module - from - parseable - interface - serialize - parseable - module - interface - dependency - hashes - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - I % t / my - sdk - module - cache - path % t / MCP - o % t / prebuilt - cache / ExportedLib . swiftmodule - track - system - dependencies - module - name ExportedLib % t / my - sdk / ExportedLib . swiftinterface <nl> + / / <nl> + / / Check they still don ' t contain dependencies in the module cache or prebuilt cache <nl> + / / RUN : llvm - bcanalyzer - dump % t / prebuilt - cache / ExportedLib . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / RUN : llvm - bcanalyzer - dump % t / prebuilt - cache / SdkLib . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / <nl> + / / RUN : % empty - directory ( % t / MCP ) <nl> + / / RUN : echo ' 1 : PASSED ' <nl> + <nl> + <nl> + / / 2 ) Baseline check : Make sure we use the interface when not passing the prebuilt module cache path <nl> + / / <nl> + / / RUN : % target - swift - frontend - typecheck - I % t / my - sdk - sdk % t / my - sdk - module - cache - path % t / MCP - emit - dependencies - path % t / dummy . d - track - system - dependencies - disable - modules - validate - system - headers % s <nl> + / / <nl> + / / Check SdkLib and ExportedLib are in the module cache <nl> + / / RUN : test - f % t / MCP / ExportedLib - * . swiftmodule <nl> + / / RUN : test - f % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / Check they are * not * forwarding modules <nl> + / / RUN : not % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : not % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check they don ' t contain dependencies in the module cache ( . . or prebuilt cache ) <nl> + / / RUN : llvm - bcanalyzer - dump % t / MCP / SdkLib - * . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / RUN : llvm - bcanalyzer - dump % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / <nl> + / / Check we didn ' t emit anything from the cache in the . d file either <nl> + / / RUN : cat % t / dummy . d | % FileCheck % s - check - prefix = DEPFILE - NEGATIVE <nl> + / / RUN : cat % t / dummy . d | % FileCheck % s - check - prefix = DEPFILE <nl> + / / <nl> + / / DEPFILE - NEGATIVE - NOT : { { [ / \ \ ] MCP [ / \ \ ] } } <nl> + / / DEPFILE - NEGATIVE - NOT : { { [ / \ \ ] prebuilt - cache [ / \ \ ] } } <nl> + / / <nl> + / / DEPFILE - DAG : SomeCModule . h <nl> + / / DEPFILE - DAG : SdkLib . swiftinterface <nl> + / / DEPFILE - DAG : ExportedLib . swiftinterface <nl> + / / DEPFILE - DAG : SDKDependencies - disable - validation . swift <nl> + / / <nl> + / / RUN : % empty - directory ( % t / MCP ) <nl> + / / RUN : echo ' 2 : PASSED ' <nl> + <nl> + <nl> + / / 3 ) Baseline check : Make sure we use the the prebuilt module cache when using the SDK it was built with <nl> + / / <nl> + / / RUN : % target - swift - frontend - typecheck - I % t / my - sdk - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - module - cache - path % t / MCP - emit - dependencies - path % t / dummy . d - track - system - dependencies - disable - modules - validate - system - headers % s <nl> + / / <nl> + / / Check SdkLib and ExportedLib are in the module cache <nl> + / / RUN : test - f % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : test - f % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check they * are * forwarding modules <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check they contain the expected dependencies <nl> + / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = EXLIB <nl> + / / RUN : cat % t / MCP / SdkLib - * . swiftmodule | % FileCheck % s - check - prefixes = EXLIB , SDKLIB <nl> + / / <nl> + / / EXLIB : dependencies : <nl> + / / EXLIB - DAG : path : ' { { usr [ / \ \ ] include [ / \ \ ] } } module . modulemap ' <nl> + / / EXLIB - DAG : path : ' { { usr [ / \ \ ] include [ / \ \ ] } } SomeCModule . h ' <nl> + / / EXLIB - DAG : path : ExportedLib . swiftinterface <nl> + / / SDKLIB - DAG : SdkLib . swiftinterface <nl> + / / <nl> + / / Check they don ' t contain any dependencies from either cache other than themselves <nl> + / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = NOCACHE - DLIB_NAME = ExportedLib <nl> + / / RUN : cat % t / MCP / SdkLib - * . swiftmodule | % FileCheck % s - check - prefix = NOCACHE - DLIB_NAME = SdkLib <nl> + / / <nl> + / / NOCACHE : dependencies : <nl> + / / NOCACHE - NOT : { { [ / \ \ ] prebuilt - cache [ / \ \ ] } } <nl> + / / NOCACHE - NOT : { { [ / \ \ ] MCP [ / \ \ ] } } <nl> + / / NOCACHE : { { [ / \ \ ] prebuilt - cache [ / \ \ ] } } [ [ LIB_NAME ] ] . swiftmodule <nl> + / / NOCACHE - NOT : { { [ / \ \ ] prebuilt - cache [ / \ \ ] } } <nl> + / / NOCACHE - NOT : { { [ / \ \ ] MCP [ / \ \ ] } } <nl> + / / <nl> + / / Check we didn ' t emit anything from the cache in the . d file either <nl> + / / RUN : cat % t / dummy . d | % FileCheck % s - check - prefix = DEPFILE - NEGATIVE <nl> + / / RUN : cat % t / dummy . d | % FileCheck % s - check - prefix = DEPFILE <nl> + / / <nl> + / / RUN : echo ' 3 : PASSED ' <nl> + <nl> + <nl> + / / 4 ) Now change the SDK ' s content WITHOUT clearing the module cache and check <nl> + / / that it doesn ' t change anything . . . <nl> + / / <nl> + / / RUN : echo " / / size change " > > % t / my - sdk / SdkLib . swiftinterface <nl> + / / RUN : % target - swift - frontend - typecheck - I % t / my - sdk - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - module - cache - path % t / MCP - emit - dependencies - path % t / dummy . d - track - system - dependencies - disable - modules - validate - system - headers % s <nl> + / / <nl> + / / Check SDKLib and ExportedLib are in the module cache <nl> + / / RUN : test - f % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : test - f % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check that they ' re both still forwarding modules , because we didn ' t stat <nl> + / / the system dependencies . <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / ExportedLib - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / Check ExportedLib still contains the same dependencies <nl> + / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = EXLIB <nl> + / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = NOCACHE - DLIB_NAME = ExportedLib <nl> + / / <nl> + / / RUN : echo ' 4 : PASSED ' <nl> + <nl> + / / 5 ) . . . but if we clear the module cache and start over , we won ' t be using the <nl> + / / prebuilt module anymore for SDKLib . <nl> + / / <nl> + / / RUN : % empty - directory ( % t / MCP ) <nl> + / / RUN : % target - swift - frontend - typecheck - I % t / my - sdk - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - module - cache - path % t / MCP - emit - dependencies - path % t / dummy . d - track - system - dependencies - disable - modules - validate - system - headers % s <nl> + / / <nl> + / / Check SDKLib and ExportedLib are in the module cache <nl> + / / RUN : test - f % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : test - f % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check ExportedLib is still a forwarding module and SdkLib is not <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / ExportedLib - * . swiftmodule <nl> + / / RUN : not % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / Check ExportedLib still contains the same dependencies <nl> + / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = EXLIB <nl> + / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = NOCACHE - DLIB_NAME = ExportedLib <nl> + / / <nl> + / / Check SdkLib doesn ' t contain dependencies in the module cache or prebuilt cache <nl> + / / RUN : llvm - bcanalyzer - dump % t / MCP / SdkLib - * . swiftmodule | % FileCheck % s - check - prefix = PREBUILT <nl> + / / <nl> + / / RUN : echo ' 5 : PASSED ' <nl> + <nl> + / / 6 ) If we do one more change , we won ' t rebuild SdkLib * again * . . . <nl> + / / <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : echo " / / size change " > > % t / my - sdk / SdkLib . swiftinterface <nl> + / / RUN : % target - swift - frontend - typecheck - I % t / my - sdk - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - module - cache - path % t / MCP - emit - dependencies - path % t / dummy . d - track - system - dependencies - disable - modules - validate - system - headers % s <nl> + / / <nl> + / / Check SDKLib and ExportedLib are in the module cache <nl> + / / RUN : test - f % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : test - f % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check ExportedLib is still a forwarding module and SdkLib is not <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / ExportedLib - * . swiftmodule <nl> + / / RUN : not % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / Check SdkLib hasn ' t been rebuilt . <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / RUN : echo ' 6 : PASSED ' <nl> + <nl> + / / 7 ) . . . until we turn off - disable - modules - validate - system - headers . <nl> + / / <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : echo " / / size change " > > % t / my - sdk / SdkLib . swiftinterface <nl> + / / RUN : % target - swift - frontend - typecheck - I % t / my - sdk - sdk % t / my - sdk - prebuilt - module - cache - path % t / prebuilt - cache - module - cache - path % t / MCP - emit - dependencies - path % t / dummy . d - track - system - dependencies % s <nl> + / / <nl> + / / Check SDKLib and ExportedLib are in the module cache <nl> + / / RUN : test - f % t / MCP / SdkLib - * . swiftmodule <nl> + / / RUN : test - f % t / MCP / ExportedLib - * . swiftmodule <nl> + / / <nl> + / / Check ExportedLib is still a forwarding module and SdkLib is not <nl> + / / RUN : % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / ExportedLib - * . swiftmodule <nl> + / / RUN : not % { python } % S / Inputs / check - is - forwarding - module . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / Check SdkLib has been rebuilt . <nl> + / / RUN : not % { python } % S / Inputs / check - is - old . py % t / MCP / SdkLib - * . swiftmodule <nl> + / / <nl> + / / RUN : echo ' 7 : PASSED ' <nl> + <nl> + <nl> + import SdkLib <nl> + <nl> + func foo ( ) - > ExportedInterface { <nl> + return x > 3 ? testValue : testValue2 <nl> + } <nl> mmm a / test / ParseableInterface / ModuleCache / SDKDependencies . swift <nl> ppp b / test / ParseableInterface / ModuleCache / SDKDependencies . swift <nl> <nl> / / RUN : cat % t / MCP / SdkLib - * . swiftmodule | % FileCheck % s - check - prefixes = EXLIB , SDKLIB <nl> / / <nl> / / EXLIB : dependencies : <nl> - / / EXLIB - DAG : { { [ / \ \ ] my - sdk [ / \ \ ] usr [ / \ \ ] include [ / \ \ ] } } module . modulemap <nl> - / / EXLIB - DAG : { { [ / \ \ ] my - sdk [ / \ \ ] usr [ / \ \ ] include [ / \ \ ] } } SomeCModule . h <nl> - / / EXLIB - DAG : { { [ / \ \ ] my - sdk [ / \ \ ] } } ExportedLib . swiftinterface <nl> - / / SDKLIB - DAG : { { [ / \ \ ] my - sdk [ / \ \ ] } } SdkLib . swiftinterface <nl> + / / EXLIB - DAG : path : ' { { usr [ / \ \ ] include [ / \ \ ] } } module . modulemap ' <nl> + / / EXLIB - DAG : path : ' { { usr [ / \ \ ] include [ / \ \ ] } } SomeCModule . h ' <nl> + / / EXLIB - DAG : path : ExportedLib . swiftinterface <nl> + / / SDKLIB - DAG : SdkLib . swiftinterface <nl> / / <nl> / / Check they don ' t contain any dependencies from either cache other than themselves <nl> / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = NOCACHE - DLIB_NAME = ExportedLib <nl> <nl> / / RUN : cat % t / MCP / ExportedLib - * . swiftmodule | % FileCheck % s - check - prefix = NEW - EXLIB <nl> / / RUN : cat % t / MCP / SdkLib - * . swiftmodule | % FileCheck % s - check - prefixes = NEW - EXLIB , NEW - SDKLIB <nl> / / <nl> - / / NEW - EXLIB - DAG : { { [ / \ \ ] my - new - sdk [ / \ \ ] usr [ / \ \ ] include [ / \ \ ] } } module . modulemap <nl> - / / NEW - EXLIB - DAG : { { [ / \ \ ] my - new - sdk [ / \ \ ] usr [ / \ \ ] include [ / \ \ ] } } SomeCModule . h <nl> - / / NEW - EXLIB - DAG : { { [ / \ \ ] my - new - sdk [ / \ \ ] } } ExportedLib . swiftinterface <nl> - / / NEW - SDKLIB - DAG : { { [ / \ \ ] my - new - sdk [ / \ \ ] } } SdkLib . swiftinterface <nl> + / / NEW - EXLIB - DAG : path : ' { { usr [ / \ \ ] include [ / \ \ ] } } module . modulemap ' <nl> + / / NEW - EXLIB - DAG : path : ' { { usr [ / \ \ ] include [ / \ \ ] } } SomeCModule . h ' <nl> + / / NEW - EXLIB - DAG : path : ExportedLib . swiftinterface <nl> + / / NEW - SDKLIB - DAG : path : SdkLib . swiftinterface <nl> / / <nl> / / Check they don ' t contain dependencies from the module cache , old prebuilt <nl> / / cache , or new prebuilt cache <nl>
|
Merge pull request from jrose - apple / einstein
|
apple/swift
|
493c07f718399b090634eb7d29f2a883712344c6
|
2019-07-22T22:51:54Z
|
mmm a / lib / SILGen / SILGenPattern . cpp <nl> ppp b / lib / SILGen / SILGenPattern . cpp <nl> void SILGenFunction : : emitCatchDispatch ( DoCatchStmt * S , ManagedValue exn , <nl> <nl> / / Set up an initial clause matrix . <nl> ClauseMatrix clauseMatrix ( clauseRows ) ; <nl> - ConsumableManagedValue subject ; <nl> - if ( F . getModule ( ) . getOptions ( ) . EnableSILOwnership & & <nl> - exn . getType ( ) . isObject ( ) ) { <nl> - subject = { exn . borrow ( * this , S ) , CastConsumptionKind : : BorrowAlways } ; <nl> - } else { <nl> - subject = { exn , CastConsumptionKind : : TakeOnSuccess } ; <nl> - } <nl> + <nl> + assert ( exn . getType ( ) . isObject ( ) & & <nl> + " Error is special and should always be an object " ) ; <nl> + / / Our model is that sub - cases get the exception at + 0 and the throw ( if we <nl> + / / need to rethrow the exception ) gets the exception at + 1 since we need to <nl> + / / trampoline it ' s ownership to our caller . <nl> + ConsumableManagedValue subject = { exn . borrow ( * this , S ) , <nl> + CastConsumptionKind : : BorrowAlways } ; <nl> <nl> auto failure = [ & ] ( SILLocation location ) { <nl> / / If we fail to match anything , just rethrow the exception . <nl> void SILGenFunction : : emitCatchDispatch ( DoCatchStmt * S , ManagedValue exn , <nl> return ; <nl> } <nl> <nl> - / / Don ' t actually kill the exception ' s cleanup . <nl> + / / Since we borrowed exn before sending it to our subcases , we know that it <nl> + / / must be at + 1 at this point . That being said , SILGenPattern will <nl> + / / potentially invoke this for each of the catch statements , so we need to <nl> + / / copy before we pass it into the throw . <nl> CleanupStateRestorationScope scope ( Cleanups ) ; <nl> if ( exn . hasCleanup ( ) ) { <nl> scope . pushCleanupState ( exn . getCleanup ( ) , <nl> mmm a / lib / SILGen / SILGenStmt . cpp <nl> ppp b / lib / SILGen / SILGenStmt . cpp <nl> void StmtEmitter : : visitDoCatchStmt ( DoCatchStmt * S ) { <nl> / / Emit all the catch clauses , branching to the end destination if <nl> / / we fall out of one . <nl> SGF . emitCatchDispatch ( S , exn , S - > getCatches ( ) , endDest ) ; <nl> + <nl> + / / We assume that exn ' s cleanup is still valid at this point . To ensure that <nl> + / / we do not re - emit it and do a double consume , we rely on us having <nl> + / / finished emitting code and thus unsetting the insertion point here . This <nl> + / / assert is to make sure this invariant is clear in the code and validated . <nl> + assert ( ! SGF . B . hasValidInsertionPoint ( ) ) ; <nl> } <nl> <nl> if ( hasLabel ) { <nl> mmm a / test / SILGen / errors . swift <nl> ppp b / test / SILGen / errors . swift <nl> <nl> / / RUN : % target - swift - emit - silgen - parse - stdlib - enable - sil - ownership - Xllvm - sil - print - debuginfo - verify - primary - file % s % S / Inputs / errors_other . swift | % FileCheck % s <nl> <nl> - / / TODO : Turn back on ownership verification . I turned off the verification on <nl> - / / this file since it shows an ownership error that does not affect <nl> - / / codegen . Specifically when we destroy the temporary array we use for the <nl> - / / variadic tuple , we try to borrow the temporary array when we pass it to the <nl> - / / destroy function . This makes the ownership verifier think that the owned <nl> - / / value we are trying to destroy is not cleaned up . But once ownership is <nl> - / / stripped out , the destroy array function still does what it needs to do . The <nl> - / / actual fix for this would require a bunch of surgery in SILGenApply around <nl> - / / how function types are computed and preserving non - canonical function types <nl> - / / through SILGenApply . This is something that can be done after + 0 is turned <nl> - / / on . <nl> - <nl> import Swift <nl> <nl> class Cat { } <nl> func all_together_now ( _ flag : Bool ) - > Cat { <nl> } <nl> } <nl> <nl> + / / Make sure that if we catch an error in a throwing function we borrow the <nl> + / / error and only consume the error in the rethrow block . <nl> + / / <nl> + / / CHECK - LABEL : sil hidden @ $ s6errors20all_together_now_twoyAA3CatCSgSbKF : $ @ convention ( thin ) ( Bool ) - > ( @ owned Optional < Cat > , @ error Error ) { <nl> + / / CHECK : bb0 ( <nl> + / / CHECK - NOT : bb1 <nl> + / / CHECK : try_apply { { . * } } , normal [ [ NORMAL_BB : bb [ 0 - 9 ] + ] ] , error [ [ ERROR_BB : bb [ 0 - 9 ] + ] ] <nl> + / / <nl> + / / CHECK : [ [ ERROR_BB ] ] ( [ [ ERROR : % . * ] ] : @ owned $ Error ) : <nl> + / / CHECK : [ [ BORROWED_ERROR : % . * ] ] = begin_borrow [ [ ERROR ] ] <nl> + / / CHECK : [ [ COPIED_ERROR : % . * ] ] = copy_value [ [ BORROWED_ERROR ] ] <nl> + / / CHECK : store [ [ COPIED_ERROR ] ] to [ init ] [ [ CAST_INPUT_MEM : % . * ] ] : $ * Error <nl> + / / CHECK : checked_cast_addr_br copy_on_success Error in [ [ CAST_INPUT_MEM ] ] : $ * Error to HomeworkError in [ [ CAST_OUTPUT_MEM : % . * ] ] : $ * HomeworkError , [ [ CAST_YES_BB : bb [ 0 - 9 ] + ] ] , [ [ CAST_NO_BB : bb [ 0 - 9 ] + ] ] , <nl> + / / <nl> + / / CHECK : [ [ CAST_YES_BB ] ] : <nl> + / / CHECK : [ [ SUBERROR : % . * ] ] = load [ take ] [ [ CAST_OUTPUT_MEM ] ] <nl> + / / CHECK : switch_enum [ [ SUBERROR ] ] : $ HomeworkError , case # HomeworkError . TooHard ! enumelt : { { bb [ 0 - 9 ] + } } , default [ [ SWITCH_MATCH_FAIL_BB : bb [ 0 - 9 ] + ] ] , <nl> + / / <nl> + / / CHECK : [ [ SWITCH_MATCH_FAIL_BB ] ] ( [ [ SUBERROR : % . * ] ] : @ owned $ HomeworkError ) : <nl> + / / CHECK : destroy_value [ [ SUBERROR ] ] <nl> + / / CHECK : end_borrow [ [ BORROWED_ERROR ] ] <nl> + / / CHECK : br [ [ RETHROW_BB : bb [ 0 - 9 ] + ] ] ( [ [ ERROR ] ] : $ Error ) <nl> + / / <nl> + / / CHECK : [ [ CAST_NO_BB ] ] : <nl> + / / CHECK : end_borrow [ [ BORROWED_ERROR ] ] <nl> + / / CHECK : br [ [ RETHROW_BB ] ] ( [ [ ERROR ] ] : $ Error ) <nl> + / / <nl> + / / CHECK : [ [ RETHROW_BB ] ] ( [ [ ERROR_FOR_RETHROW : % . * ] ] : @ owned $ Error ) : <nl> + / / CHECK : throw [ [ ERROR_FOR_RETHROW ] ] <nl> + / / CHECK : } / / end sil function ' $ s6errors20all_together_now_twoyAA3CatCSgSbKF ' <nl> + func all_together_now_two ( _ flag : Bool ) throws - > Cat ? { <nl> + do { <nl> + return try dont_return ( Cat ( ) ) <nl> + } catch HomeworkError . TooHard { <nl> + return nil <nl> + } <nl> + } <nl> + <nl> + / / Same as the previous test , but with multiple cases instead of just one . <nl> + / / <nl> + / / CHECK - LABEL : sil hidden @ $ s6errors22all_together_now_threeyAA3CatCSgSbKF : $ @ convention ( thin ) ( Bool ) - > ( @ owned Optional < Cat > , @ error Error ) { <nl> + / / CHECK : bb0 ( <nl> + / / CHECK - NOT : bb1 <nl> + / / CHECK : try_apply { { . * } } , normal [ [ NORMAL_BB : bb [ 0 - 9 ] + ] ] , error [ [ ERROR_BB : bb [ 0 - 9 ] + ] ] <nl> + / / <nl> + / / CHECK : [ [ ERROR_BB ] ] ( [ [ ERROR : % . * ] ] : @ owned $ Error ) : <nl> + / / CHECK : [ [ BORROWED_ERROR : % . * ] ] = begin_borrow [ [ ERROR ] ] <nl> + / / CHECK : [ [ COPIED_ERROR : % . * ] ] = copy_value [ [ BORROWED_ERROR ] ] <nl> + / / CHECK : store [ [ COPIED_ERROR ] ] to [ init ] [ [ CAST_INPUT_MEM : % . * ] ] : $ * Error <nl> + / / CHECK : checked_cast_addr_br copy_on_success Error in [ [ CAST_INPUT_MEM ] ] : $ * Error to HomeworkError in [ [ CAST_OUTPUT_MEM : % . * ] ] : $ * HomeworkError , [ [ CAST_YES_BB : bb [ 0 - 9 ] + ] ] , [ [ CAST_NO_BB : bb [ 0 - 9 ] + ] ] , <nl> + / / <nl> + / / CHECK : [ [ CAST_YES_BB ] ] : <nl> + / / CHECK : [ [ SUBERROR : % . * ] ] = load [ take ] [ [ CAST_OUTPUT_MEM ] ] <nl> + / / CHECK : switch_enum [ [ SUBERROR ] ] : $ HomeworkError , case # HomeworkError . TooHard ! enumelt : { { bb [ 0 - 9 ] + } } , case # HomeworkError . TooMuch ! enumelt : { { bb [ 0 - 9 ] + } } , default [ [ SWITCH_MATCH_FAIL_BB : bb [ 0 - 9 ] + ] ] , <nl> + / / <nl> + / / CHECK : [ [ SWITCH_MATCH_FAIL_BB ] ] ( [ [ SUBERROR : % . * ] ] : @ owned $ HomeworkError ) : <nl> + / / CHECK : destroy_value [ [ SUBERROR ] ] <nl> + / / CHECK : end_borrow [ [ BORROWED_ERROR ] ] <nl> + / / CHECK : br [ [ RETHROW_BB : bb [ 0 - 9 ] + ] ] ( [ [ ERROR ] ] : $ Error ) <nl> + / / <nl> + / / CHECK : [ [ CAST_NO_BB ] ] : <nl> + / / CHECK : end_borrow [ [ BORROWED_ERROR ] ] <nl> + / / CHECK : br [ [ RETHROW_BB ] ] ( [ [ ERROR ] ] : $ Error ) <nl> + / / <nl> + / / CHECK : [ [ RETHROW_BB ] ] ( [ [ ERROR_FOR_RETHROW : % . * ] ] : @ owned $ Error ) : <nl> + / / CHECK : throw [ [ ERROR_FOR_RETHROW ] ] <nl> + / / CHECK : } / / end sil function ' $ s6errors22all_together_now_threeyAA3CatCSgSbKF ' <nl> + func all_together_now_three ( _ flag : Bool ) throws - > Cat ? { <nl> + do { <nl> + return try dont_return ( Cat ( ) ) <nl> + } catch HomeworkError . TooHard { <nl> + return nil <nl> + } catch HomeworkError . TooMuch { <nl> + return nil <nl> + } <nl> + } <nl> + <nl> / / Catch in non - throwing context . <nl> / / CHECK - LABEL : sil hidden @ $ s6errors11catch_a_catAA3CatCyF : $ @ convention ( thin ) ( ) - > @ owned Cat <nl> / / CHECK - NEXT : bb0 : <nl>
|
[ silgenpattern ] Change catch emission to not be conditional on ownership verification being enabled .
|
apple/swift
|
447a11a19a8dab73f0a87035d97b658a2e5c89d2
|
2018-10-23T17:05:35Z
|
mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> static bool valueMemberMatches ( ValueDecl * Candidate , ValueDecl * Requirement , <nl> if ( ! RequiredTy - > isEqual ( getInstanceUsageType ( Candidate , Context ) ) ) <nl> return false ; <nl> if ( FuncDecl * FD = dyn_cast < FuncDecl > ( Candidate ) ) { <nl> - if ( FD - > isStatic ( ) ! = cast < FuncDecl > ( Requirement ) - > isStatic ( ) ) <nl> + FuncDecl * ReqFD = cast < FuncDecl > ( Requirement ) ; <nl> + if ( FD - > isStatic ( ) ! = ReqFD - > isStatic ( ) | | <nl> + FD - > getAttrs ( ) . isPrefix ( ) ! = ReqFD - > getAttrs ( ) . isPrefix ( ) | | <nl> + FD - > getAttrs ( ) . isPostfix ( ) ! = ReqFD - > getAttrs ( ) . isPostfix ( ) ) <nl> return false ; <nl> } <nl> return true ; <nl>
|
Match prefix / postfix attributes when matching witnesses to requirements in protocol conformance checking .
|
apple/swift
|
68bcae90f64d961be485a6b6b2c532ca5bd492a9
|
2013-06-06T17:51:51Z
|
mmm a / brightray / browser / inspectable_web_contents . h <nl> ppp b / brightray / browser / inspectable_web_contents . h <nl> class InspectableWebContents { <nl> virtual void ShowDevTools ( ) = 0 ; <nl> virtual void CloseDevTools ( ) = 0 ; <nl> virtual bool IsDevToolsViewShowing ( ) = 0 ; <nl> - virtual void AttachTo ( const scoped_refptr < content : : DevToolsAgentHost > & ) = 0 ; <nl> + virtual void AttachTo ( scoped_refptr < content : : DevToolsAgentHost > ) = 0 ; <nl> virtual void Detach ( ) = 0 ; <nl> virtual void CallClientFunction ( const std : : string & function_name , <nl> const base : : Value * arg1 = nullptr , <nl> mmm a / brightray / browser / inspectable_web_contents_impl . cc <nl> ppp b / brightray / browser / inspectable_web_contents_impl . cc <nl> void InspectableWebContentsImpl : : ShowDevTools ( ) { <nl> Observe ( devtools_web_contents_ . get ( ) ) ; <nl> devtools_web_contents_ - > SetDelegate ( this ) ; <nl> <nl> - agent_host_ = content : : DevToolsAgentHost : : GetOrCreateFor ( web_contents_ . get ( ) ) ; <nl> - agent_host_ - > AttachClient ( this ) ; <nl> + AttachTo ( std : : move ( <nl> + content : : DevToolsAgentHost : : GetOrCreateFor ( web_contents_ . get ( ) ) ) ) ; <nl> <nl> devtools_web_contents_ - > GetController ( ) . LoadURL ( <nl> GetDevToolsURL ( can_dock_ ) , <nl> bool InspectableWebContentsImpl : : IsDevToolsViewShowing ( ) { <nl> return devtools_web_contents_ & & view_ - > IsDevToolsViewShowing ( ) ; <nl> } <nl> <nl> - void InspectableWebContentsImpl : : AttachTo ( const scoped_refptr < content : : DevToolsAgentHost > & host ) { <nl> + void InspectableWebContentsImpl : : AttachTo ( <nl> + scoped_refptr < content : : DevToolsAgentHost > host ) { <nl> if ( agent_host_ . get ( ) ) <nl> Detach ( ) ; <nl> agent_host_ = host ; <nl> - agent_host_ - > AttachClient ( this ) ; <nl> + / / Terminate existing debugging connections and start debugging . <nl> + agent_host_ - > ForceAttachClient ( this ) ; <nl> } <nl> <nl> void InspectableWebContentsImpl : : Detach ( ) { <nl> mmm a / brightray / browser / inspectable_web_contents_impl . h <nl> ppp b / brightray / browser / inspectable_web_contents_impl . h <nl> class InspectableWebContentsImpl : <nl> void ShowDevTools ( ) override ; <nl> void CloseDevTools ( ) override ; <nl> bool IsDevToolsViewShowing ( ) override ; <nl> - void AttachTo ( const scoped_refptr < content : : DevToolsAgentHost > & ) override ; <nl> + void AttachTo ( scoped_refptr < content : : DevToolsAgentHost > ) override ; <nl> void Detach ( ) override ; <nl> void CallClientFunction ( const std : : string & function_name , <nl> const base : : Value * arg1 , <nl>
|
Merge pull request from deepak1556 / devtools_remote_detach_patch
|
electron/electron
|
cda2e0c181977d449b55d875d1726d837f18e671
|
2017-01-12T01:26:12Z
|
mmm a / modules / gdscript / gd_compiler . h <nl> ppp b / modules / gdscript / gd_compiler . h <nl> class GDCompiler { <nl> <nl> const GDParser * parser ; <nl> struct CodeGen { <nl> - <nl> - <nl> GDScript * script ; <nl> const GDParser : : ClassNode * class_node ; <nl> const GDParser : : FunctionNode * function_node ; <nl> - <nl> - <nl> - bool debug_stack ; <nl> - <nl> - <nl> - List < Map < StringName , int > > stack_id_stack ; <nl> - Map < StringName , int > stack_identifiers ; <nl> - <nl> - List < GDFunction : : StackDebug > stack_debug ; <nl> - List < Map < StringName , int > > block_identifier_stack ; <nl> - Map < StringName , int > block_identifiers ; <nl> - <nl> - <nl> - void add_stack_identifier ( const StringName & p_id , int p_stackpos ) { <nl> - <nl> - stack_identifiers [ p_id ] = p_stackpos ; <nl> - if ( debug_stack ) { <nl> - <nl> - block_identifiers [ p_id ] = p_stackpos ; <nl> - GDFunction : : StackDebug sd ; <nl> - sd . added = true ; <nl> - sd . line = current_line ; <nl> - sd . identifier = p_id ; <nl> - sd . pos = p_stackpos ; <nl> - stack_debug . push_back ( sd ) ; <nl> - } <nl> - } <nl> - <nl> - void push_stack_identifiers ( ) { <nl> - <nl> - stack_id_stack . push_back ( stack_identifiers ) ; <nl> - if ( debug_stack ) { <nl> - <nl> - block_identifier_stack . push_back ( block_identifiers ) ; <nl> - block_identifiers . clear ( ) ; <nl> - } <nl> - } <nl> - <nl> - void pop_stack_identifiers ( ) { <nl> - <nl> - stack_identifiers = stack_id_stack . back ( ) - > get ( ) ; <nl> - stack_id_stack . pop_back ( ) ; <nl> - <nl> - if ( debug_stack ) { <nl> - for ( Map < StringName , int > : : Element * E = block_identifiers . front ( ) ; E ; E = E - > next ( ) ) { <nl> - <nl> - GDFunction : : StackDebug sd ; <nl> - sd . added = false ; <nl> - sd . identifier = E - > key ( ) ; <nl> - sd . line = current_line ; <nl> - sd . pos = E - > get ( ) ; <nl> - stack_debug . push_back ( sd ) ; <nl> - } <nl> - block_identifiers = block_identifier_stack . back ( ) - > get ( ) ; <nl> - block_identifier_stack . pop_back ( ) ; <nl> - } <nl> - <nl> - } <nl> - <nl> - <nl> - / / int get_identifier_pos ( const StringName & p_dentifier ) const ; <nl> + bool debug_stack ; <nl> + <nl> + List < Map < StringName , int > > stack_id_stack ; <nl> + Map < StringName , int > stack_identifiers ; <nl> + <nl> + List < GDFunction : : StackDebug > stack_debug ; <nl> + List < Map < StringName , int > > block_identifier_stack ; <nl> + Map < StringName , int > block_identifiers ; <nl> + <nl> + void add_stack_identifier ( const StringName & p_id , int p_stackpos ) { <nl> + stack_identifiers [ p_id ] = p_stackpos ; <nl> + if ( debug_stack ) { <nl> + block_identifiers [ p_id ] = p_stackpos ; <nl> + GDFunction : : StackDebug sd ; <nl> + sd . added = true ; <nl> + sd . line = current_line ; <nl> + sd . identifier = p_id ; <nl> + sd . pos = p_stackpos ; <nl> + stack_debug . push_back ( sd ) ; <nl> + } <nl> + } <nl> + <nl> + void push_stack_identifiers ( ) { <nl> + stack_id_stack . push_back ( stack_identifiers ) ; <nl> + if ( debug_stack ) { <nl> + <nl> + block_identifier_stack . push_back ( block_identifiers ) ; <nl> + block_identifiers . clear ( ) ; <nl> + } <nl> + } <nl> + <nl> + void pop_stack_identifiers ( ) { <nl> + stack_identifiers = stack_id_stack . back ( ) - > get ( ) ; <nl> + stack_id_stack . pop_back ( ) ; <nl> + <nl> + if ( debug_stack ) { <nl> + for ( Map < StringName , int > : : Element * E = block_identifiers . front ( ) ; E ; E = E - > next ( ) ) { <nl> + <nl> + GDFunction : : StackDebug sd ; <nl> + sd . added = false ; <nl> + sd . identifier = E - > key ( ) ; <nl> + sd . line = current_line ; <nl> + sd . pos = E - > get ( ) ; <nl> + stack_debug . push_back ( sd ) ; <nl> + } <nl> + block_identifiers = block_identifier_stack . back ( ) - > get ( ) ; <nl> + block_identifier_stack . pop_back ( ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + / / int get_identifier_pos ( const StringName & p_dentifier ) const ; <nl> HashMap < Variant , int , VariantHasher > constant_map ; <nl> Map < StringName , int > name_map ; <nl> <nl> int get_name_map_pos ( const StringName & p_identifier ) { <nl> - <nl> int ret ; <nl> if ( ! name_map . has ( p_identifier ) ) { <nl> ret = name_map . size ( ) ; <nl> class GDCompiler { <nl> return ret ; <nl> } <nl> <nl> - <nl> - <nl> int get_constant_pos ( const Variant & p_constant ) { <nl> - <nl> - <nl> if ( constant_map . has ( p_constant ) ) <nl> return constant_map [ p_constant ] ; <nl> int pos = constant_map . size ( ) ; <nl> class GDCompiler { <nl> void alloc_stack ( int p_level ) { if ( p_level > = stack_max ) stack_max = p_level + 1 ; } <nl> void alloc_call ( int p_params ) { if ( p_params > = call_max ) call_max = p_params ; } <nl> <nl> - int current_line ; <nl> + int current_line ; <nl> int stack_max ; <nl> int call_max ; <nl> } ; <nl>
|
Cleaned up formating in gd_compiler . h
|
godotengine/godot
|
3d3b1937ddf74d96376d889a7b8dac4974b8eda2
|
2015-01-14T15:37:24Z
|
mmm a / documentation / sphinx / source / backups . rst <nl> ppp b / documentation / sphinx / source / backups . rst <nl> The ` ` start ` ` subcommand is used to start a DR backup . If there is already a DR <nl> <nl> The ` ` switch ` ` subcommand is used to swap the source and destination database clusters of an active DR in differential mode . This means the destination will be unlocked and start streaming data into the source database , which will subsequently be locked . <nl> <nl> - This command requires both databases to be available . While the switch command is working , both databases will be locked for a few seconds . <nl> + This command requires both databases to be available . On the destination cluster , a ` ` dr_agent ` ` that points to the source cluster must be running . While the switch command is working , both databases will be locked for a few seconds . <nl> <nl> . . program : : fdbdr abort <nl> <nl>
|
Merge pull request from cdonati / docs - dr - switch - agent
|
apple/foundationdb
|
df718280a256bb12ee73d683fc0942f78dc1fa67
|
2019-01-23T16:43:00Z
|
mmm a / contracts / exchange / CMakeLists . txt <nl> ppp b / contracts / exchange / CMakeLists . txt <nl> <nl> file ( GLOB ABI_FILES " * . abi " ) <nl> add_wast_executable ( TARGET exchange <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES libc + + libc eosiolib <nl> + LIBRARIES libc + + libc eosiolib libc libc + + <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> add_dependencies ( exchange currency ) <nl> <nl> add_executable ( test_exchange test_exchange . cpp ) <nl> + # bfp / lib / pack . c bfp / lib / posit . cpp bfp / lib / util . c bfp / lib / op2 . c ) <nl> target_link_libraries ( test_exchange fc ) <nl> + target_include_directories ( test_exchange PUBLIC fixed_point / include ) <nl> mmm a / contracts / exchange / exchange . cpp <nl> ppp b / contracts / exchange / exchange . cpp <nl> <nl> + # include < math . h > <nl> # include " exchange . hpp " <nl> <nl> + / * <nl> extern " C " { <nl> / / / The apply method implements the dispatch of events to this contract <nl> void apply ( uint64_t code , uint64_t act ) { <nl> extern " C " { <nl> exchange < N ( exchange ) , S ( 4 , EXC ) , eos , cur > : : apply ( code , act ) ; <nl> } <nl> } <nl> + * / <nl> + <nl> + extern " C " { <nl> + void apply ( ) { <nl> + } <nl> + } <nl> mmm a / contracts / exchange / test_exchange . cpp <nl> ppp b / contracts / exchange / test_exchange . cpp <nl> <nl> # include < string > <nl> # include < cstdint > <nl> # include < iostream > <nl> + # include < math . h > <nl> + # include < fc / exception / exception . hpp > <nl> + / * <nl> + # include < boost / multiprecision / cpp_dec_float . hpp > <nl> + # include < boost / multiprecision / cpp_bin_float . hpp > <nl> + # include < boost / multiprecision / cpp_bin_float . hpp > <nl> + # include < boost / rational . hpp > <nl> + <nl> + # include < sg14 / fixed_point > <nl> + # include " fixed . hpp " <nl> + * / <nl> + <nl> + # include < fc / time . hpp > <nl> + # include < fc / log / logger . hpp > <nl> + <nl> + / / # include " bfp / lib / posit . h " <nl> <nl> using namespace std ; <nl> <nl> + typedef double real_type ; <nl> + typedef int64_t token_type ; <nl> + <nl> + <nl> + / * <nl> + struct margin_position { <nl> + account_name owner ; <nl> + uint64_t exchange_id ; <nl> + asset lent ; <nl> + asset collateral ; <nl> + uint64_t open_time ; <nl> + <nl> + uint64_t primary_key ( ) const { return owner ; } <nl> + uint256_t by_owner_ex_lent_collateral ( ) const { <nl> + <nl> + } <nl> + <nl> + real_type by_call_price ( ) const { <nl> + return collateral . amount / real_type ( lent . amount ) ; <nl> + } <nl> + } ; <nl> + * / <nl> + <nl> + <nl> + <nl> + template < typename Real > <nl> + Real Abs ( Real Nbr ) <nl> + { <nl> + if ( Nbr > = 0 ) <nl> + return Nbr ; <nl> + else <nl> + return - Nbr ; <nl> + } <nl> + <nl> + template < typename Real > <nl> + Real sqrt_safe ( const Real Nbr ) <nl> + { <nl> + / / return sqrt ( Nbr ) ; <nl> + / / cout < < " " < < Nbr < < " \ n " ; ; <nl> + Real Number = Nbr / Real ( 2 . 0 ) ; <nl> + const Real Tolerance = Real ( double ( 1 . 0e - 12 ) ) ; <nl> + / / cout < < " tol : " < < Tolerance < < " \ n " ; <nl> + <nl> + Real Sq ; <nl> + Real Er ; <nl> + do { <nl> + auto tmp = Nbr / Number ; <nl> + tmp + = Number ; <nl> + tmp / = real_type ( 2 . 0 ) ; <nl> + if ( Number = = tmp ) break ; <nl> + Number = tmp ; <nl> + Sq = Number * Number ; <nl> + Er = Abs ( Sq - Nbr ) ; <nl> + / / wdump ( ( Er . getDouble ( ) ) ( 1 . 0e - 8 ) ( Tolerance . getDouble ( ) ) ) ; <nl> + / / wdump ( ( ( Er - Tolerance ) . getDouble ( ) ) ) ; <nl> + } while ( Er > = Tolerance ) ; <nl> + <nl> + return Number ; <nl> + } <nl> + <nl> typedef __uint128_t uint128_t ; <nl> typedef string account_name ; <nl> typedef string symbol_type ; <nl> typedef string symbol_type ; <nl> static const symbol_type exchange_symbol = " EXC " ; <nl> <nl> struct asset { <nl> - int64_t amount ; <nl> + token_type amount ; <nl> symbol_type symbol ; <nl> } ; <nl> <nl> + struct margin_key { <nl> + symbol_type lent ; <nl> + symbol_type collat ; <nl> + } ; <nl> + <nl> + struct margin { <nl> + asset lent ; <nl> + symbol_type collateral_symbol ; <nl> + real_type least_collateralized_rate ; <nl> + } ; <nl> + <nl> + struct user_margin { <nl> + asset lent ; <nl> + asset collateral ; <nl> + <nl> + real_type call_price ( ) const { <nl> + return collateral . amount / real_type ( lent . amount ) ; <nl> + } <nl> + } ; <nl> + <nl> struct exchange_state ; <nl> struct connector { <nl> - uint32_t weight ; <nl> - asset balance ; <nl> - <nl> + asset balance ; <nl> + token_type total_lent ; / / / lent from maker to users <nl> + token_type total_borrowed ; / / / borrowed from users to maker <nl> + token_type total_available_to_lend ; / / / amount available to borrow <nl> + token_type interest_pool ; / / / total interest earned but not claimed , <nl> + / / / each user can claim user_lent <nl> + <nl> + void borrow ( exchange_state & ex , const asset & amount_to_borrow ) ; <nl> asset convert_to_exchange ( exchange_state & ex , const asset & input ) ; <nl> asset convert_from_exchange ( exchange_state & ex , const asset & input ) ; <nl> } ; <nl> struct balance_key { <nl> } <nl> } ; <nl> <nl> + real_type fee = 1 ; / / . 9995 ; <nl> + <nl> + <nl> + int64_t maxtrade = 2000000000ll ; <nl> + <nl> struct exchange_state { <nl> - int64_t supply ; <nl> - uint64_t total_weight = 1000 * 1000 ; <nl> + token_type supply ; <nl> + symbol_type symbol = exchange_symbol ; <nl> <nl> connector base ; <nl> connector quote ; <nl> <nl> - map < balance_key , int64_t > output ; <nl> + void transfer ( account_name user , asset q ) { <nl> + output [ balance_key { user , q . symbol } ] + = q . amount ; <nl> + } <nl> + map < balance_key , token_type > output ; <nl> + vector < margin > margins ; <nl> } ; <nl> <nl> - asset connector : : convert_to_exchange ( exchange_state & ex , const asset & input ) { <nl> - uint64_t relevant_ex_shares = ( ex . supply * weight ) / ex . total_weight ; <nl> - <nl> - double init_ex_per_in = double ( balance . amount ) / relevant_ex_shares ; <nl> - / / std : : cerr < < " init_ex_per_in : " < < init_ex_per_in < < " \ n " ; <nl> - double init_out = init_ex_per_in * input . amount ; <nl> - / / std : : cerr < < " init out : " < < init_out < < " \ n " ; <nl> + / * <nl> + void connector : : borrow ( exchange_state & ex , account_name user , <nl> + asset amount_to_borrow , <nl> + asset collateral , <nl> + user_margin & marg ) { <nl> + FC_ASSERT ( amount_to_borrow . amount < balance . amount , " attempt to borrow too much " ) ; <nl> + lent . amount + = amount_to_borrow . amount ; <nl> + balance . amount - = amount_to_borrow . amount ; <nl> + ex . transfer ( user , amount_to_borrow ) ; <nl> + <nl> + marg . collateral . amount + = collateral . amount ; <nl> + marg . lent . amount + = amount_to_borrow . amount ; <nl> + auto p = marg . price ( ) ; <nl> + <nl> + if ( collateral . symbol = = ex . symbol ) { <nl> + if ( p > ex_margin . least_collateralized_rate ) <nl> + ex_margin . least_collateralized_rate = p ; <nl> + } <nl> + else if ( collateral . symbol = = peer_margin . collateral . symbol ) { <nl> + if ( p > peer_margin . least_collateralized_rate ) <nl> + peer_margin . least_collateralized_rate = p ; <nl> + } <nl> + } <nl> + * / <nl> <nl> + asset connector : : convert_to_exchange ( exchange_state & ex , const asset & input ) { <nl> <nl> - double final_ex_per_in = double ( balance . amount + input . amount ) / ( relevant_ex_shares + init_out ) ; <nl> - double final_out = final_ex_per_in * input . amount ; <nl> + typedef double real_type ; <nl> <nl> - / * <nl> - std : : cerr < < " input : " < < input . amount < < " " < < input . symbol < < " \ n " ; <nl> - std : : cerr < < " final_ex_per_in : " < < final_ex_per_in < < " \ n " ; <nl> - std : : cerr < < " final out : " < < final_out < < " \ n " ; <nl> - * / <nl> + auto real_issued = real_type ( ex . supply ) * ( sqrt_safe ( 1 . 0 + ( real_type ( input . amount ) / ( balance . amount + input . amount ) ) ) - 1 . 0 ) ; <nl> + token_type issued = real_issued ; <nl> <nl> - ex . supply + = int64_t ( final_out ) ; <nl> + ex . supply + = issued ; <nl> balance . amount + = input . amount ; <nl> <nl> - return asset { int64_t ( final_out ) , exchange_symbol } ; <nl> + return asset { issued , exchange_symbol } ; <nl> } <nl> <nl> asset connector : : convert_from_exchange ( exchange_state & ex , const asset & input ) { <nl> <nl> - uint64_t relevant_ex_shares = ( ex . supply * weight ) / ex . total_weight ; <nl> + / / typedef boost : : multiprecision : : int256_t i256 ; <nl> <nl> - double init_in_per_out = relevant_ex_shares / double ( balance . amount ) ; <nl> - double init_out = init_in_per_out * input . amount ; <nl> + / * <nl> + typedef __int128_t i256 ; <nl> + <nl> + const uint64_t precision = ( 1ll < < 40 ) ; / / 1000 * 1000 * 1000ll ; <nl> + i256 in ( input . amount ) ; in * = precision ; / / / 53 + 30 = > 83 <nl> + auto b = ( in / ( ex . supply - input . amount ) ) + precision ; / / 83 <nl> <nl> - double final_in_per_out = ( relevant_ex_shares - input . amount ) / ( balance . amount - init_out ) ; <nl> - int64_t final_out = final_in_per_out * input . amount ; <nl> + b * = b ; / / 166 <nl> + b / = precision ; / / 136 <nl> + b - = precision ; / / 136 <nl> + b * = balance . amount ; / / 189 <nl> + b / = precision ; / / 159 <nl> + * / <nl> <nl> - ex . supply - = input . amount ; <nl> - balance . amount - = final_out ; <nl> + typedef double real_type ; <nl> + real_type base = real_type ( 1 . 0 ) + ( real_type ( input . amount ) / real_type ( ex . supply - input . amount ) ) ; <nl> + auto out = ( balance . amount * ( base * base - real_type ( 1 . 0 ) ) ) ; / / . getDouble ( ) ; <nl> <nl> - return asset { final_out , balance . symbol } ; <nl> + / / std : : cout < < " out : " < < int64_t ( out . getDouble ( ) ) < < " vs " < < int64_t ( b ) < < " \ n " ; <nl> + ex . supply - = input . amount ; <nl> + balance . amount - = token_type ( out ) ; <nl> + return asset { token_type ( out ) , balance . symbol } ; <nl> } <nl> <nl> <nl> void eosio_assert ( bool test , const string & msg ) { <nl> <nl> void print_state ( const exchange_state & e ) ; <nl> <nl> + <nl> + <nl> / * * <nl> * Given the current state , calculate the new state <nl> * / <nl> exchange_state convert ( const exchange_state & current , <nl> account_name user , <nl> asset input , <nl> - asset min_output ) { <nl> + asset min_output , <nl> + asset * out = nullptr ) { <nl> <nl> eosio_assert ( min_output . symbol ! = input . symbol , " cannot convert " ) ; <nl> <nl> exchange_state convert ( const exchange_state & current , <nl> <nl> asset final_output = initial_output ; <nl> <nl> - / * <nl> - if ( min_output . symbol ! = initial_output . symbol ) { <nl> - if ( min_output . symbol = = result . base . balance . symbol ) { <nl> - final_output = result . base . convert_from_exchange ( result , initial_output ) ; <nl> - } <nl> - else if ( min_output . symbol = = result . quote . balance . symbol ) { <nl> - final_output = result . quote . convert_from_exchange ( result , initial_output ) ; <nl> - } <nl> - else eosio_assert ( false , " invalid symbol " ) ; <nl> + / / std : : cerr < < " \ n \ nconvert " < < input . amount < < " " < < input . symbol < < " = > " < < final_output . amount < < " " < < final_output . symbol < < " final : " < < min_output . symbol < < " \ n " ; <nl> + <nl> + result . output [ balance_key { user , final_output . symbol } ] + = final_output . amount ; <nl> + result . output [ balance_key { user , input . symbol } ] - = input . amount ; <nl> + <nl> + if ( min_output . symbol ! = final_output . symbol ) { <nl> + return convert ( result , user , final_output , min_output , out ) ; <nl> } <nl> <nl> - / / std : : cerr < < " output : " < < final_output . amount < < " " < < final_output . symbol < < " \ n " ; <nl> - * / <nl> + if ( out ) * out = final_output ; <nl> + return result ; <nl> + } <nl> <nl> + / * VALIDATE MARGIN ALGORITHM <nl> + * <nl> + * Given an initial condition , verify that all margin positions can be filled . <nl> + * <nl> + * Assume 3 assets , B , Q , and X and the notation LENT - COLLAT we get the following <nl> + * pairs : <nl> + * <nl> + * B - X <nl> + * B - A <nl> + * A - X <nl> + * A - B <nl> + * X - A <nl> + * X - B <nl> + * <nl> + * We assume that pairs of the same lent - type have to be simultainously filled , <nl> + * as filling one could make it impossible to fill the other . <nl> + * <nl> + * <nl> + void validate_margin ( exchange_state & e ) { <nl> + for ( const auto & pos : e . margins ) { <nl> + token_type min_collat = pos . lent . amount * pos . least_collateralized_rate ; <nl> + asset received ; <nl> + e = convert ( e , " user " , asset { min_collat , pos . first . collat } , pos . lent , & received ) ; <nl> + FC_ASSERT ( received > pos . lent . amount , " insufficient collateral " ) ; <nl> + <nl> + received . amount - = pos . lent . amount ; <nl> + e = convert ( e , " user " , received , asset { token_type ( 0 ) , pos . collateral_symbol } ) ; <nl> + } <nl> + } <nl> + * / <nl> <nl> - std : : cerr < < " \ n \ nconvert " < < input . amount < < " " < < input . symbol < < " = > " < < final_output . amount < < " " < < final_output . symbol < < " final : " < < min_output . symbol < < " \ n " ; <nl> <nl> - result . output [ balance_key { user , final_output . symbol } ] + = final_output . amount ; <nl> - result . output [ balance_key { user , input . symbol } ] - = input . amount ; <nl> <nl> - print_state ( result ) ; <nl> <nl> <nl> - if ( min_output . symbol ! = final_output . symbol ) { <nl> - return convert ( result , user , final_output , min_output ) ; <nl> - } <nl> + / * * <nl> + * A user has Collateral C and wishes to borrow B , so we give user B <nl> + * provided that C is enough to buy B back after removing it from market and <nl> + * that no margin calls would be triggered . <nl> + * / <nl> + exchange_state borrow ( const exchange_state & current , account_name user , <nl> + asset amount_to_borrow , <nl> + asset collateral_provided ) { <nl> + FC_ASSERT ( amount_to_borrow . symbol ! = collateral_provided . symbol ) ; <nl> + <nl> + / / / lookup the margin position for user <nl> + / / / update user ' s margin position <nl> + / / / update least collateralized margin position on state <nl> + / / / remove amount_to_borrow from exchange <nl> + / / / lock collateral for user <nl> + / / / simulate complete margin calls <nl> + } <nl> <nl> + exchange_state cover ( const exchange_state & current , account_name user , <nl> + asset amount_to_cover , asset collateral_to_cover_with ) <nl> + { <nl> + / / / lookup existing position for user / debt / collat <nl> + / / / verify collat > collateral_to_cover_with <nl> + / / / sell collateral_to_cover_with for debt on market <nl> + / / / reduce debt by proceeds <nl> + / / / add proceeds to connector <nl> + / / - if borrowed from user , reduce borrowed from user <nl> + / / / calculate new call price and update least collateralized position <nl> + / / / simulate complete margin calls <nl> <nl> - return result ; <nl> } <nl> <nl> + exchange_state lend ( const exchange_state & current , account_name lender , <nl> + asset asset_to_lend ) { <nl> + / / / add to pool of funds available for lending and buy SHARES in <nl> + / / / interest pool at current rate . <nl> + <nl> + } <nl> + <nl> + exchange_state unlend ( const exchange_state & current , account_name lender , <nl> + asset asset_to_lend ) { <nl> + / / / sell shares in interest pool at current rate <nl> + / / / this is permitable so long as total borrowed from users remains less than <nl> + / / / total available to lend . Otherwise , margin is called on the least <nl> + / / / collateralized position . <nl> + } <nl> + <nl> + <nl> <nl> void print_state ( const exchange_state & e ) { <nl> std : : cerr < < " \ nmmmmmmmmmmmmmmmmmmmmmmmmmmm - - \ n " ; <nl> void print_state ( const exchange_state & e ) { <nl> <nl> <nl> int main ( int argc , char * * argv ) { <nl> + / / std : : cerr < < " root : " < < double ( root . numerator ( ) ) / root . denominator ( ) < < " \ n " ; <nl> + <nl> <nl> exchange_state state ; <nl> - state . supply = 1000000 ; <nl> - state . total_weight = 1000000 ; <nl> - state . base . weight = state . total_weight / 2 ; <nl> - state . base . balance . amount = 10000 ; <nl> + state . supply = 100000000000ll ; <nl> + / / state . base . weight = state . total_weight / 2 . ; <nl> + state . base . balance . amount = 100000000 ; <nl> state . base . balance . symbol = " USD " ; <nl> - state . quote . weight = state . total_weight / 2 ; <nl> - state . quote . balance . amount = 10000 ; <nl> + / / state . quote . weight = state . total_weight / 2 . ; <nl> + state . quote . balance . amount = state . base . balance . amount ; <nl> state . quote . balance . symbol = " BTC " ; <nl> <nl> print_state ( state ) ; <nl> <nl> - auto new_state = convert ( state , " dan " , asset { 500 , " USD " } , asset { 0 , " BTC " } ) ; <nl> - / / new_state = convert ( new_state , " dan " , asset { 10 , " EXC " } , asset { 0 , " USD " } ) ; <nl> - / / new_state = convert ( state , " dan " , asset { 500 , " BTC " } , asset { 0 , " EXC " } ) ; <nl> - / / new_state = convert ( new_state , " dan " , asset { 10 , " EXC " } , asset { 0 , " USD " } ) ; <nl> - / / <nl> + / / state = convert ( state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + <nl> + auto start = fc : : time_point : : now ( ) ; <nl> + for ( uint32_t i = 0 ; i < 100000 ; + + i ) { <nl> + if ( rand ( ) % 2 = = 0 ) <nl> + state = convert ( state , " dan " , asset { token_type ( uint32_t ( rand ( ) ) % maxtrade ) , " USD " } , asset { 0 , " BTC " } ) ; <nl> + else <nl> + state = convert ( state , " dan " , asset { token_type ( uint32_t ( rand ( ) ) % maxtrade ) , " BTC " } , asset { 0 , " USD " } ) ; <nl> + } <nl> + for ( const auto & item : state . output ) { <nl> + if ( item . second > 0 ) { <nl> + if ( item . first . symbol = = " USD " ) <nl> + state = convert ( state , " dan " , asset { item . second , item . first . symbol } , asset { 0 , " BTC " } ) ; <nl> + else <nl> + state = convert ( state , " dan " , asset { item . second , item . first . symbol } , asset { 0 , " USD " } ) ; <nl> + break ; <nl> + } <nl> + } <nl> + print_state ( state ) ; <nl> <nl> - new_state = convert ( state , " dan " , asset { 500 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + auto end = fc : : time_point : : now ( ) ; <nl> + wdump ( ( end - start ) ) ; <nl> + / * <nl> + auto new_state = convert ( state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " USD " } , asset { 0 , " BTC " } ) ; <nl> + <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 92 . 5 - 0 . 08 - . 53 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 100 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + * / <nl> + <nl> + / / new_state = convert ( new_state , " dan " , asset { 442 + 487 - 733 + 280 + 349 + 4 . 493 + 62 . 9 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + / * <nl> + auto new_state = convert ( state , " dan " , asset { 500 , " USD " } , asset { 0 , " BTC " } ) ; <nl> new_state = convert ( new_state , " dan " , asset { 500 , " USD " } , asset { 0 , " BTC " } ) ; <nl> - new_state = convert ( new_state , " dan " , asset { 526 , " BTC " } , asset { 0 , " USD " } ) ; <nl> - new_state = convert ( new_state , " dan " , asset { 526 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 442 + 487 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + * / <nl> + / * <nl> + new_state = convert ( new_state , " dan " , asset { 487 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + new_state = convert ( new_state , " dan " , asset { 442 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + * / <nl> + / / new_state = convert ( new_state , " dan " , asset { 526 , " BTC " } , asset { 0 , " USD " } ) ; <nl> + / / new_state = convert ( new_state , " dan " , asset { 558 , " BTC " } , asset { 0 , " USD " } ) ; <nl> / / new_state = convert ( new_state , " dan " , asset { 1746 , " BTC " } , asset { 0 , " USD " } ) ; <nl> / * <nl> new_state = convert ( new_state , " dan " , asset { 526 , " BTC " } , asset { 0 , " USD " } ) ; <nl> int main ( int argc , char * * argv ) { <nl> <nl> return 0 ; <nl> } <nl> + <nl> + <nl> + <nl> + # if 0 <nl> + <nl> + 0 . if ( margin_fault ) <nl> + Convert Least Collateral <nl> + if ( margin fault ) ) <nl> + defer <nl> + <nl> + if ( margin_fault ) assert ( false , " busy calling " ) ; <nl> + <nl> + 1 . Fill Incoming Order <nl> + 2 . Check Counter Order <nl> + 3 . if ( margin fault ) <nl> + Defer Trx to finish margin call <nl> + <nl> + <nl> + # endif <nl>
|
progress on exchange
|
EOSIO/eos
|
3e02040710fc84f66500e869934f8b691d57700d
|
2018-03-05T02:54:31Z
|
mmm a / lib / AST / ASTPrinter . cpp <nl> ppp b / lib / AST / ASTPrinter . cpp <nl> void PrintAST : : printPattern ( const Pattern * pattern ) { <nl> } <nl> <nl> / / / If we can ' t find the depth of a type , return ErrorDepth . <nl> - const unsigned ErrorDepth = ~ 0U ; <nl> + static const unsigned ErrorDepth = ~ 0U ; <nl> / / / A helper function to return the depth of a type . <nl> static unsigned getDepthOfType ( Type ty ) { <nl> - if ( auto paramTy = ty - > getAs < GenericTypeParamType > ( ) ) <nl> - return paramTy - > getDepth ( ) ; <nl> + unsigned depth = ErrorDepth ; <nl> + <nl> + auto combineDepth = [ & depth ] ( unsigned newDepth ) - > bool { <nl> + / / If there is no current depth ( depth = = ErrorDepth ) , then assign to <nl> + / / newDepth ; otherwise , choose the deeper of the current and new depth . <nl> + <nl> + / / Since ErrorDepth = = ~ 0U , ErrorDepth + 1 = = 0 , which is smaller than any <nl> + / / valid depth + 1 . <nl> + depth = std : : max ( depth + 1U , newDepth + 1U ) - 1U ; <nl> + return false ; <nl> + } ; <nl> + <nl> + ty . findIf ( [ combineDepth ] ( Type t ) - > bool { <nl> + if ( auto paramTy = t - > getAs < GenericTypeParamType > ( ) ) <nl> + return combineDepth ( paramTy - > getDepth ( ) ) ; <nl> <nl> - if ( auto depMemTy = dyn_cast < DependentMemberType > ( ty - > getCanonicalType ( ) ) ) { <nl> - CanType rootTy ; <nl> - do { <nl> - rootTy = depMemTy . getBase ( ) ; <nl> - } while ( ( depMemTy = dyn_cast < DependentMemberType > ( rootTy ) ) ) ; <nl> - if ( auto rootParamTy = dyn_cast < GenericTypeParamType > ( rootTy ) ) <nl> - return rootParamTy - > getDepth ( ) ; <nl> - return ErrorDepth ; <nl> - } <nl> + if ( auto depMemTy = dyn_cast < DependentMemberType > ( t - > getCanonicalType ( ) ) ) { <nl> + CanType rootTy ; <nl> + do { <nl> + rootTy = depMemTy . getBase ( ) ; <nl> + } while ( ( depMemTy = dyn_cast < DependentMemberType > ( rootTy ) ) ) ; <nl> + if ( auto rootParamTy = dyn_cast < GenericTypeParamType > ( rootTy ) ) <nl> + return combineDepth ( rootParamTy - > getDepth ( ) ) ; <nl> + } <nl> <nl> - return ErrorDepth ; <nl> + return false ; <nl> + } ) ; <nl> + <nl> + return depth ; <nl> } <nl> <nl> namespace { <nl> static unsigned getDepthOfRequirement ( const Requirement & req ) { <nl> switch ( req . getKind ( ) ) { <nl> case RequirementKind : : Conformance : <nl> case RequirementKind : : Layout : <nl> - case RequirementKind : : Superclass : <nl> return getDepthOfType ( req . getFirstType ( ) ) ; <nl> <nl> + case RequirementKind : : Superclass : <nl> case RequirementKind : : SameType : { <nl> / / Return the max valid depth of firstType and secondType . <nl> unsigned firstDepth = getDepthOfType ( req . getFirstType ( ) ) ; <nl> new file mode 100644 <nl> index 000000000000 . . 0319fdaeeddf <nl> mmm / dev / null <nl> ppp b / test / SILGen / same_type_across_generic_depths . swift <nl> <nl> + / / RUN : rm - rf % t <nl> + / / RUN : mkdir - p % t <nl> + / / RUN : % target - swift - frontend - emit - silgen % s > % t / out . sil <nl> + / / RUN : % target - swift - frontend - emit - silgen % t / out . sil | % FileCheck % s <nl> + class X < A > { } <nl> + struct Foo < T > { <nl> + / / CHECK - LABEL : sil hidden @ { { . * } } Foo { { . * } } bar { { . * } } : $ @ convention ( method ) < T > < U where T = = X < U > > <nl> + func bar < U > ( _ : U ) where T = = X < U > { } <nl> + <nl> + / / CHECK - LABEL : sil hidden @ { { . * } } Foo { { . * } } bar { { . * } } : $ @ convention ( method ) < T > < U where T : X < U > > <nl> + func bar < U > ( _ : U ) where T : X < U > { } <nl> + } <nl>
|
Fix AST printer of generic signatures to consider depths of generic parameters at … depth
|
apple/swift
|
f887044f01044452303010f23c2683112695b2c3
|
2017-04-21T18:49:09Z
|
mmm a / tensorflow / core / ops / ops . pbtxt <nl> ppp b / tensorflow / core / ops / ops . pbtxt <nl> op { <nl> name : " num_parallel_batches " <nl> type : DT_INT64 <nl> } <nl> + input_arg { <nl> + name : " drop_remainder " <nl> + type : DT_BOOL <nl> + } <nl> output_arg { <nl> name : " handle " <nl> type : DT_VARIANT <nl>
|
Update ops - related pbtxt files .
|
tensorflow/tensorflow
|
6832756b26af035535c9349fec9cad77091584ba
|
2018-03-21T18:22:08Z
|
mmm a / . travis . yml <nl> ppp b / . travis . yml <nl> script : <nl> # RA_CONTROL_PANEL <nl> # <nl> - restore_configs <nl> - - opt_enable RA_CONTROL_PANEL <nl> + - opt_enable RA_CONTROL_PANEL PINS_DEBUGGING <nl> - build_marlin <nl> # <nl> # # # # # # # # I2C LCD / PANELS # # # # # # # # # # # # # # <nl> mmm a / Marlin / Marlin_main . cpp <nl> ppp b / Marlin / Marlin_main . cpp <nl> inline void gcode_M42 ( ) { <nl> # if ! ( NUM_SERVOS > = 1 & & HAS_SERVO_0 ) <nl> SERIAL_ERROR_START ; <nl> SERIAL_ERRORLNPGM ( " SERVO not setup " ) ; <nl> + # elif ! HAS_Z_SERVO_ENDSTOP <nl> + SERIAL_ERROR_START ; <nl> + SERIAL_ERRORLNPGM ( " Z_ENDSTOP_SERVO_NR not setup " ) ; <nl> # else <nl> - <nl> - # if ! defined ( z_servo_angle ) <nl> - const int z_servo_angle [ 2 ] = Z_SERVO_ANGLES ; <nl> - # endif <nl> - uint8_t probe_index = code_seen ( ' P ' ) ? code_value_byte ( ) : 0 ; <nl> + uint8_t probe_index = code_seen ( ' P ' ) ? code_value_byte ( ) : Z_ENDSTOP_SERVO_NR ; <nl> SERIAL_PROTOCOLLNPGM ( " Servo probe test " ) ; <nl> SERIAL_PROTOCOLLNPAIR ( " . using index : " , probe_index ) ; <nl> SERIAL_PROTOCOLLNPAIR ( " . deploy angle : " , z_servo_angle [ 0 ] ) ; <nl> inline void gcode_M42 ( ) { <nl> probe_inverting = Z_MIN_ENDSTOP_INVERTING ; <nl> # elif ENABLED ( Z_MIN_PROBE_ENDSTOP ) <nl> # define PROBE_TEST_PIN Z_MIN_PROBE_PIN <nl> - <nl> SERIAL_PROTOCOLLNPAIR ( " . probe uses Z_MIN_PROBE_PIN : " , PROBE_TEST_PIN ) ; <nl> SERIAL_PROTOCOLLNPGM ( " . uses Z_MIN_PROBE_ENDSTOP_INVERTING ( ignores Z_MIN_ENDSTOP_INVERTING ) " ) ; <nl> SERIAL_PROTOCOLPGM ( " . Z_MIN_PROBE_ENDSTOP_INVERTING : " ) ; <nl> inline void gcode_M42 ( ) { <nl> if ( probe_inverting ! = deploy_state ) SERIAL_PROTOCOLLNPGM ( " WARNING - INVERTING setting probably backwards " ) ; <nl> refresh_cmd_timeout ( ) ; <nl> if ( deploy_state ! = stow_state ) { <nl> - SERIAL_PROTOCOLLNPGM ( " TLTouch detected " ) ; / / BLTouch clone ? <nl> + SERIAL_PROTOCOLLNPGM ( " BLTouch clone detected " ) ; <nl> if ( deploy_state ) { <nl> SERIAL_PROTOCOLLNPGM ( " . DEPLOYED state : HIGH ( logic 1 ) " ) ; <nl> SERIAL_PROTOCOLLNPGM ( " . STOWED ( triggered ) state : LOW ( logic 0 ) " ) ; <nl> inline void gcode_M42 ( ) { <nl> SERIAL_PROTOCOLLNPGM ( " . DEPLOYED state : LOW ( logic 0 ) " ) ; <nl> SERIAL_PROTOCOLLNPGM ( " . STOWED ( triggered ) state : HIGH ( logic 1 ) " ) ; <nl> } <nl> + # if ENABLED ( BLTOUCH ) <nl> + SERIAL_PROTOCOLLNPGM ( " ERROR : BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true . " ) ; <nl> + # endif <nl> + <nl> } <nl> else { / / measure active signal length <nl> servo [ probe_index ] . move ( z_servo_angle [ 0 ] ) ; / / deploy <nl>
|
Merge pull request from Bob - the - Kuhn / M43 - toggle - & - Z - probe - fixes
|
MarlinFirmware/Marlin
|
de569e3d4eafbbf7093a541969762aea685a7ca9
|
2017-04-18T08:21:57Z
|
mmm a / modules / dreamview / frontend / proto_bundle / sim_world_proto_bundle . json <nl> ppp b / modules / dreamview / frontend / proto_bundle / sim_world_proto_bundle . json <nl> <nl> " ScenarioType " : { <nl> " values " : { <nl> " LANE_FOLLOW " : 0 , <nl> - " CHANGE_LANE " : 1 , <nl> - " BARE_INTERSECTION_UNPROTECTED " : 3 , <nl> - " STOP_SIGN_PROTECTED " : 4 , <nl> - " STOP_SIGN_UNPROTECTED " : 5 , <nl> - " TRAFFIC_LIGHT_PROTECTED " : 6 , <nl> - " TRAFFIC_LIGHT_UNPROTECTED_LEFT_TURN " : 7 , <nl> - " TRAFFIC_LIGHT_UNPROTECTED_RIGHT_TURN " : 8 , <nl> - " YIELD_SIGN " : 9 , <nl> - " PULL_OVER " : 10 , <nl> - " VALET_PARKING " : 11 , <nl> - " EMERGENCY_PULL_OVER " : 12 , <nl> - " EMERGENCY_STOP " : 13 , <nl> - " NARROW_STREET_U_TURN " : 14 , <nl> - " PARK_AND_GO " : 15 <nl> + " BARE_INTERSECTION_UNPROTECTED " : 2 , <nl> + " STOP_SIGN_PROTECTED " : 3 , <nl> + " STOP_SIGN_UNPROTECTED " : 4 , <nl> + " TRAFFIC_LIGHT_PROTECTED " : 5 , <nl> + " TRAFFIC_LIGHT_UNPROTECTED_LEFT_TURN " : 6 , <nl> + " TRAFFIC_LIGHT_UNPROTECTED_RIGHT_TURN " : 7 , <nl> + " YIELD_SIGN " : 8 , <nl> + " PULL_OVER " : 9 , <nl> + " VALET_PARKING " : 10 , <nl> + " EMERGENCY_PULL_OVER " : 11 , <nl> + " EMERGENCY_STOP " : 12 , <nl> + " NARROW_STREET_U_TURN " : 13 , <nl> + " PARK_AND_GO " : 14 <nl> } <nl> } , <nl> " StageType " : { <nl> <nl> } <nl> } <nl> } , <nl> - " ChangeLaneConfig " : { <nl> - " fields " : { <nl> - " minOvertakeDistance " : { <nl> - " type " : " double " , <nl> - " id " : 1 , <nl> - " options " : { <nl> - " default " : 10 <nl> - } <nl> - } , <nl> - " minOvertakeTime " : { <nl> - " type " : " double " , <nl> - " id " : 2 , <nl> - " options " : { <nl> - " default " : 2 <nl> - } <nl> - } , <nl> - " enableGuardObstacle " : { <nl> - " type " : " bool " , <nl> - " id " : 3 , <nl> - " options " : { <nl> - " default " : false <nl> - } <nl> - } , <nl> - " guardDistance " : { <nl> - " type " : " double " , <nl> - " id " : 4 , <nl> - " options " : { <nl> - " default " : 100 <nl> - } <nl> - } , <nl> - " minGuardSpeed " : { <nl> - " type " : " double " , <nl> - " id " : 5 , <nl> - " options " : { <nl> - " default " : 1 <nl> - } <nl> - } <nl> - } <nl> - } , <nl> - " CreepConfig " : { <nl> - " fields " : { <nl> - " enabled " : { <nl> - " type " : " bool " , <nl> - " id " : 1 <nl> - } , <nl> - " creepDistanceToStopLine " : { <nl> - " type " : " double " , <nl> - " id " : 2 , <nl> - " options " : { <nl> - " default " : 1 <nl> - } <nl> - } , <nl> - " stopDistance " : { <nl> - " type " : " double " , <nl> - " id " : 3 , <nl> - " options " : { <nl> - " default " : 0 . 5 <nl> - } <nl> - } , <nl> - " speedLimit " : { <nl> - " type " : " double " , <nl> - " id " : 4 , <nl> - " options " : { <nl> - " default " : 1 <nl> - } <nl> - } , <nl> - " maxValidStopDistance " : { <nl> - " type " : " double " , <nl> - " id " : 5 , <nl> - " options " : { <nl> - " default " : 0 . 3 <nl> - } <nl> - } , <nl> - " minBoundaryT " : { <nl> - " type " : " double " , <nl> - " id " : 6 , <nl> - " options " : { <nl> - " default " : 6 <nl> - } <nl> - } , <nl> - " minBoundaryS " : { <nl> - " type " : " double " , <nl> - " id " : 7 , <nl> - " options " : { <nl> - " default " : 3 <nl> - } <nl> - } <nl> - } <nl> - } , <nl> " CrosswalkConfig " : { <nl> " fields " : { <nl> " stopDistance " : { <nl> <nl> " config " : { <nl> " oneof " : [ <nl> " backsideVehicle " , <nl> - " changeLane " , <nl> " crosswalk " , <nl> " destination " , <nl> " keepClear " , <nl> <nl> " type " : " BacksideVehicleConfig " , <nl> " id " : 3 <nl> } , <nl> - " changeLane " : { <nl> - " type " : " ChangeLaneConfig " , <nl> - " id " : 4 <nl> - } , <nl> " crosswalk " : { <nl> " type " : " CrosswalkConfig " , <nl> - " id " : 5 <nl> + " id " : 4 <nl> } , <nl> " destination " : { <nl> " type " : " DestinationConfig " , <nl> - " id " : 6 <nl> + " id " : 5 <nl> } , <nl> " keepClear " : { <nl> " type " : " KeepClearConfig " , <nl> - " id " : 7 <nl> + " id " : 6 <nl> } , <nl> " referenceLineEnd " : { <nl> " type " : " ReferenceLineEndConfig " , <nl> - " id " : 8 <nl> + " id " : 7 <nl> } , <nl> " rerouting " : { <nl> " type " : " ReroutingConfig " , <nl> - " id " : 9 <nl> + " id " : 8 <nl> } , <nl> " stopSign " : { <nl> " type " : " StopSignConfig " , <nl> - " id " : 10 <nl> + " id " : 9 <nl> } , <nl> " trafficLight " : { <nl> " type " : " TrafficLightConfig " , <nl> - " id " : 11 <nl> + " id " : 10 <nl> } , <nl> " yieldSign " : { <nl> " type " : " YieldSignConfig " , <nl> - " id " : 12 <nl> + " id " : 11 <nl> } <nl> } , <nl> " nested " : { <nl> " RuleId " : { <nl> " values " : { <nl> " BACKSIDE_VEHICLE " : 1 , <nl> - " CHANGE_LANE " : 2 , <nl> - " CROSSWALK " : 3 , <nl> - " DESTINATION " : 4 , <nl> - " KEEP_CLEAR " : 5 , <nl> - " REFERENCE_LINE_END " : 6 , <nl> - " REROUTING " : 7 , <nl> - " STOP_SIGN " : 8 , <nl> - " TRAFFIC_LIGHT " : 9 , <nl> - " YIELD_SIGN " : 10 <nl> + " CROSSWALK " : 2 , <nl> + " DESTINATION " : 3 , <nl> + " KEEP_CLEAR " : 4 , <nl> + " REFERENCE_LINE_END " : 5 , <nl> + " REROUTING " : 6 , <nl> + " STOP_SIGN " : 7 , <nl> + " TRAFFIC_LIGHT " : 8 , <nl> + " YIELD_SIGN " : 9 <nl> } <nl> } <nl> } <nl> mmm a / modules / planning / proto / planning_config . proto <nl> ppp b / modules / planning / proto / planning_config . proto <nl> message ScenarioYieldSignConfig { <nl> message ScenarioConfig { <nl> enum ScenarioType { <nl> LANE_FOLLOW = 0 ; / / default scenario <nl> - CHANGE_LANE = 1 ; <nl> <nl> / / intersection involved <nl> - BARE_INTERSECTION_UNPROTECTED = 3 ; <nl> - STOP_SIGN_PROTECTED = 4 ; <nl> - STOP_SIGN_UNPROTECTED = 5 ; <nl> - TRAFFIC_LIGHT_PROTECTED = 6 ; <nl> - TRAFFIC_LIGHT_UNPROTECTED_LEFT_TURN = 7 ; <nl> - TRAFFIC_LIGHT_UNPROTECTED_RIGHT_TURN = 8 ; <nl> - YIELD_SIGN = 9 ; <nl> + BARE_INTERSECTION_UNPROTECTED = 2 ; <nl> + STOP_SIGN_PROTECTED = 3 ; <nl> + STOP_SIGN_UNPROTECTED = 4 ; <nl> + TRAFFIC_LIGHT_PROTECTED = 5 ; <nl> + TRAFFIC_LIGHT_UNPROTECTED_LEFT_TURN = 6 ; <nl> + TRAFFIC_LIGHT_UNPROTECTED_RIGHT_TURN = 7 ; <nl> + YIELD_SIGN = 8 ; <nl> <nl> / / parking <nl> - PULL_OVER = 10 ; <nl> - VALET_PARKING = 11 ; <nl> + PULL_OVER = 9 ; <nl> + VALET_PARKING = 10 ; <nl> <nl> - EMERGENCY_PULL_OVER = 12 ; <nl> - EMERGENCY_STOP = 13 ; <nl> + EMERGENCY_PULL_OVER = 11 ; <nl> + EMERGENCY_STOP = 12 ; <nl> <nl> / / misc <nl> - NARROW_STREET_U_TURN = 14 ; <nl> - PARK_AND_GO = 15 ; <nl> + NARROW_STREET_U_TURN = 13 ; <nl> + PARK_AND_GO = 14 ; <nl> } <nl> <nl> / / StageType is a superset of stages from all scenarios . <nl>
|
planning : cleanup CHANGE_LANE from scenario proto
|
ApolloAuto/apollo
|
eb2b098fc4e627c5a8868b0451268bb6258a93be
|
2019-11-27T02:09:09Z
|
mmm a / evaluate_tflite . py <nl> ppp b / evaluate_tflite . py <nl> <nl> import numpy as np <nl> import wave <nl> import csv <nl> - import sys <nl> import os <nl> <nl> from six . moves import zip , range <nl> - from multiprocessing import JoinableQueue , Pool , Process , Queue , cpu_count <nl> + from multiprocessing import JoinableQueue , Process , cpu_count , Manager <nl> from deepspeech import Model <nl> <nl> - from util . evaluate_tools import process_decode_result , calculate_report <nl> + from util . evaluate_tools import calculate_report <nl> <nl> r ' ' ' <nl> This module should be self - contained : <nl> def tflite_worker ( model , alphabet , lm , trie , queue_in , queue_out , gpu_mask ) : <nl> while True : <nl> msg = queue_in . get ( ) <nl> <nl> - fin = wave . open ( msg [ ' filename ' ] , ' rb ' ) <nl> + filename = msg [ ' filename ' ] <nl> + wavname = os . path . splitext ( os . path . basename ( filename ) ) [ 0 ] <nl> + fin = wave . open ( filename , ' rb ' ) <nl> fs = fin . getframerate ( ) <nl> audio = np . frombuffer ( fin . readframes ( fin . getnframes ( ) ) , np . int16 ) <nl> - audio_length = fin . getnframes ( ) * ( 1 / 16000 ) <nl> fin . close ( ) <nl> - <nl> + <nl> decoded = ds . stt ( audio , fs ) <nl> - <nl> - queue_out . put ( { ' prediction ' : decoded , ' ground_truth ' : msg [ ' transcript ' ] } ) <nl> + <nl> + queue_out . put ( { ' wav ' : wavname , ' prediction ' : decoded , ' ground_truth ' : msg [ ' transcript ' ] } ) <nl> + print ( queue_out . qsize ( ) , end = ' \ r ' ) # Update the current progress <nl> queue_in . task_done ( ) <nl> <nl> def main ( ) : <nl> def main ( ) : <nl> help = ' Path to the CSV source file ' ) <nl> parser . add_argument ( ' - - proc ' , required = False , default = cpu_count ( ) , type = int , <nl> help = ' Number of processes to spawn , defaulting to number of CPUs ' ) <nl> + parser . add_argument ( ' - - dump ' , required = False , action = ' store_true ' , default = False , <nl> + help = ' Dump the results as text file , with one line for each wav : " wav transcription " ' ) <nl> args = parser . parse_args ( ) <nl> <nl> + manager = Manager ( ) <nl> work_todo = JoinableQueue ( ) # this is where we are going to store input data <nl> - work_done = Queue ( ) # this where we are gonna push them out <nl> + work_done = manager . Queue ( ) # this where we are gonna push them out <nl> <nl> processes = [ ] <nl> for i in range ( args . proc ) : <nl> def main ( ) : <nl> <nl> print ( [ x . name for x in processes ] ) <nl> <nl> + wavlist = [ ] <nl> ground_truths = [ ] <nl> predictions = [ ] <nl> losses = [ ] <nl> <nl> with open ( args . csv , ' r ' ) as csvfile : <nl> csvreader = csv . DictReader ( csvfile ) <nl> + count = 0 <nl> for row in csvreader : <nl> + count + = 1 <nl> work_todo . put ( { ' filename ' : row [ ' wav_filename ' ] , ' transcript ' : row [ ' transcript ' ] } ) <nl> + print ( ' Totally % d wav entries found in csv \ n ' % count ) <nl> work_todo . join ( ) <nl> + print ( ' \ nTotally % d wav file transcripted ' % work_done . qsize ( ) ) <nl> <nl> - while ( not work_done . empty ( ) ) : <nl> + while not work_done . empty ( ) : <nl> msg = work_done . get ( ) <nl> losses . append ( 0 . 0 ) <nl> ground_truths . append ( msg [ ' ground_truth ' ] ) <nl> predictions . append ( msg [ ' prediction ' ] ) <nl> + wavlist . append ( msg [ ' wav ' ] ) <nl> <nl> - wer , cer , samples = calculate_report ( ground_truths , predictions , losses ) <nl> + wer , cer , _ = calculate_report ( ground_truths , predictions , losses ) <nl> mean_loss = np . mean ( losses ) <nl> <nl> print ( ' Test - WER : % f , CER : % f , loss : % f ' % <nl> ( wer , cer , mean_loss ) ) <nl> <nl> + if args . dump : <nl> + with open ( args . csv + ' . txt ' , ' w ' ) as ftxt , open ( args . csv + ' . out ' , ' w ' ) as fout : <nl> + for wav , txt , out in zip ( wavlist , ground_truths , predictions ) : <nl> + ftxt . write ( ' % s % s \ n ' % ( wav , txt ) ) <nl> + fout . write ( ' % s % s \ n ' % ( wav , out ) ) <nl> + print ( ' Reference texts dumped to % s . txt ' % args . csv ) <nl> + print ( ' Transcription dumped to % s . out ' % args . csv ) <nl> + <nl> if __name__ = = ' __main__ ' : <nl> main ( ) <nl>
|
evaluate_tflite : Fix shared Queue
|
mozilla/DeepSpeech
|
863c5544ca1a652afeafc826d19ce55c03894b52
|
2019-06-13T17:47:15Z
|
mmm a / libs / filabridge / include / private / filament / Variant . h <nl> ppp b / libs / filabridge / include / private / filament / Variant . h <nl> namespace filament { <nl> / / Reserved X 0 X 1 0 0 <nl> / / <nl> / / Standard variants : <nl> - / / Vertex shader 0 0 X X 0 X <nl> + / / Vertex shader 0 0 X X X X <nl> / / Fragment shader X 0 0 X X X <nl> <nl> uint8_t key = 0 ; <nl> namespace filament { <nl> static constexpr uint8_t FOG = 0x20 ; / / fog <nl> <nl> static constexpr uint8_t VERTEX_MASK = DIRECTIONAL_LIGHTING | <nl> + DYNAMIC_LIGHTING | <nl> SHADOW_RECEIVER | <nl> SKINNING_OR_MORPHING | <nl> DEPTH ; <nl> namespace filament { <nl> static constexpr uint8_t DEPTH_MASK = DIRECTIONAL_LIGHTING | <nl> DYNAMIC_LIGHTING | <nl> SHADOW_RECEIVER | <nl> - DEPTH ; <nl> + DEPTH | <nl> + FOG ; <nl> <nl> / / the depth variant deactivates all variants that make no sense when writing the depth <nl> / / only - - essentially , all fragment - only variants . <nl> namespace filament { <nl> inline void setFog ( bool v ) noexcept { set ( v , FOG ) ; } <nl> <nl> inline constexpr bool isDepthPass ( ) const noexcept { <nl> - return ( key & DEPTH_MASK ) = = DEPTH_VARIANT ; <nl> + return isValidDepthVariant ( key ) ; <nl> + } <nl> + <nl> + inline static constexpr bool isValidDepthVariant ( uint8_t variantKey ) noexcept { <nl> + / / For a variant to be a valid depth variant , all of the bits in DEPTH_MASK must be 0 , <nl> + / / except for DEPTH . <nl> + return ( variantKey & DEPTH_MASK ) = = DEPTH_VARIANT ; <nl> } <nl> <nl> static constexpr bool isReserved ( uint8_t variantKey ) noexcept { <nl> / / reserved variants that should just be skipped <nl> - return ( variantKey & DEPTH_MASK ) > DEPTH | | ( variantKey & 0b010111u ) = = 0b000100u ; <nl> + / / 1 . If the DEPTH bit is set , then it must be a valid depth variant . Otherwise , the <nl> + / / variant is reserved . <nl> + / / 2 . If SRE is set , either DYN or DIR must also be set ( it makes no sense to have <nl> + / / shadows without lights ) . <nl> + return <nl> + ( ( variantKey & DEPTH ) & & ! isValidDepthVariant ( variantKey ) ) | | <nl> + ( variantKey & 0b010111u ) = = 0b000100u ; <nl> } <nl> <nl> static constexpr uint8_t filterVariantVertex ( uint8_t variantKey ) noexcept { <nl> - / / filter out vertex variants that are not needed . For e . g . dynamic lighting <nl> - / / doesn ' t affect the vertex shader . <nl> - return variantKey ; <nl> + / / filter out vertex variants that are not needed . For e . g . fog doesn ' t affect the <nl> + / / vertex shader . <nl> + return variantKey & VERTEX_MASK ; <nl> } <nl> <nl> static constexpr uint8_t filterVariantFragment ( uint8_t variantKey ) noexcept { <nl> namespace filament { <nl> <nl> static constexpr uint8_t filterVariant ( uint8_t variantKey , bool isLit ) noexcept { <nl> / / special case for depth variant <nl> - if ( ( variantKey & DEPTH_MASK ) = = DEPTH_VARIANT ) { <nl> + if ( isValidDepthVariant ( variantKey ) ) { <nl> return variantKey ; <nl> } <nl> / / when the shading mode is unlit , remove all the lighting variants <nl> mmm a / libs / filamat / src / shaders / ShaderGenerator . cpp <nl> ppp b / libs / filamat / src / shaders / ShaderGenerator . cpp <nl> std : : string ShaderGenerator : : createVertexProgram ( filament : : backend : : ShaderModel <nl> <nl> bool litVariants = lit | | material . hasShadowMultiplier ; <nl> cg . generateDefine ( vs , " HAS_DIRECTIONAL_LIGHTING " , litVariants & & variant . hasDirectionalLighting ( ) ) ; <nl> + cg . generateDefine ( vs , " HAS_DYNAMIC_LIGHTING " , litVariants & & variant . hasDynamicLighting ( ) ) ; <nl> cg . generateDefine ( vs , " HAS_SHADOWING " , litVariants & & variant . hasShadowReceiver ( ) ) ; <nl> cg . generateDefine ( vs , " HAS_SHADOW_MULTIPLIER " , material . hasShadowMultiplier ) ; <nl> cg . generateDefine ( vs , " HAS_SKINNING_OR_MORPHING " , variant . hasSkinningOrMorphing ( ) ) ; <nl> mmm a / libs / matdbg / CMakeLists . txt <nl> ppp b / libs / matdbg / CMakeLists . txt <nl> set ( PUBLIC_HDRS <nl> <nl> set ( SRCS <nl> src / CommonWriter . h <nl> + src / CommonWriter . cpp <nl> src / DebugServer . cpp <nl> src / JsonWriter . cpp <nl> src / ShaderReplacer . cpp <nl> new file mode 100644 <nl> index 000000000 . . f5f062c94 <nl> mmm / dev / null <nl> ppp b / libs / matdbg / src / CommonWriter . cpp <nl> <nl> + / * <nl> + * Copyright ( C ) 2020 The Android Open Source Project <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # include " CommonWriter . h " <nl> + <nl> + # include < private / filament / Variant . h > <nl> + <nl> + namespace filament : : matdbg { <nl> + <nl> + std : : string formatVariantString ( uint8_t variant ) noexcept { <nl> + std : : string variantString = " " ; <nl> + <nl> + / / NOTE : The 3 - character nomenclature used here is consistent with the ASCII art seen in the <nl> + / / Variant header file and allows the information to fit in a reasonable amount of space on <nl> + / / the page . The HTML file has a legend . <nl> + if ( variant ) { <nl> + if ( variant & Variant : : DIRECTIONAL_LIGHTING ) variantString + = " DIR | " ; <nl> + if ( variant & Variant : : DYNAMIC_LIGHTING ) variantString + = " DYN | " ; <nl> + if ( variant & Variant : : SHADOW_RECEIVER ) variantString + = " SRE | " ; <nl> + if ( variant & Variant : : SKINNING_OR_MORPHING ) variantString + = " SKN | " ; <nl> + if ( variant & Variant : : DEPTH ) variantString + = " DEP | " ; <nl> + if ( variant & Variant : : FOG ) variantString + = " FOG | " ; <nl> + variantString = variantString . substr ( 0 , variantString . length ( ) - 1 ) ; <nl> + } <nl> + <nl> + return variantString ; <nl> + } <nl> + <nl> + } / / namespace filament : : matdbg <nl> mmm a / libs / matdbg / src / CommonWriter . h <nl> ppp b / libs / matdbg / src / CommonWriter . h <nl> <nl> # include < matdbg / JsonWriter . h > <nl> # include < matdbg / ShaderInfo . h > <nl> <nl> + # include < string > <nl> + <nl> namespace filament { <nl> namespace matdbg { <nl> <nl> const char * toString ( backend : : SamplerFormat format ) noexcept { <nl> } <nl> } <nl> <nl> + / / Returns a human - readable variant description . <nl> + / / For example : DYN | DIR <nl> + std : : string formatVariantString ( uint8_t variant ) noexcept ; <nl> + <nl> } / / namespace matdbg <nl> } / / namespace filament <nl> mmm a / libs / matdbg / src / JsonWriter . cpp <nl> ppp b / libs / matdbg / src / JsonWriter . cpp <nl> static bool printParametersInfo ( ostream & json , const ChunkContainer & container ) <nl> static void printShaderInfo ( ostream & json , const std : : vector < ShaderInfo > & info ) { <nl> for ( uint64_t i = 0 ; i < info . size ( ) ; + + i ) { <nl> const auto & item = info [ i ] ; <nl> - string variantString = " " ; <nl> - <nl> - / / NOTE : The 3 - character nomenclature used here is consistent with the ASCII art seen in the <nl> - / / Variant header file and allows the information to fit in a reasonable amount of space on <nl> - / / the page . The HTML file has a legend . <nl> - if ( item . variant ) { <nl> - if ( item . variant & filament : : Variant : : DIRECTIONAL_LIGHTING ) variantString + = " DIR | " ; <nl> - if ( item . variant & filament : : Variant : : DYNAMIC_LIGHTING ) variantString + = " DYN | " ; <nl> - if ( item . variant & filament : : Variant : : SHADOW_RECEIVER ) variantString + = " SRE | " ; <nl> - if ( item . variant & filament : : Variant : : SKINNING_OR_MORPHING ) variantString + = " SKN | " ; <nl> - if ( item . variant & filament : : Variant : : DEPTH ) variantString + = " DEP | " ; <nl> - variantString = variantString . substr ( 0 , variantString . length ( ) - 1 ) ; <nl> - } <nl> <nl> + string variantString = formatVariantString ( item . variant ) ; <nl> string ps = ( item . pipelineStage = = backend : : ShaderType : : VERTEX ) ? " vertex " : " fragment " ; <nl> json <nl> < < " { " <nl> mmm a / libs / matdbg / src / TextWriter . cpp <nl> ppp b / libs / matdbg / src / TextWriter . cpp <nl> static void printShaderInfo ( ostream & text , const vector < ShaderInfo > & info ) { <nl> text < < " " ; <nl> text < < " 0x " < < hex < < setfill ( ' 0 ' ) < < setw ( 2 ) <nl> < < right < < ( int ) item . variant ; <nl> - text < < setfill ( ' ' ) < < dec < < endl ; <nl> + text < < setfill ( ' ' ) < < dec ; <nl> + text < < " " ; <nl> + text < < formatVariantString ( item . variant ) ; <nl> + text < < endl ; <nl> } <nl> text < < endl ; <nl> } <nl> mmm a / shaders / src / inputs . vs <nl> ppp b / shaders / src / inputs . vs <nl> LAYOUT_LOCATION ( 10 ) out highp vec4 vertex_uv01 ; <nl> LAYOUT_LOCATION ( 11 ) out highp vec4 vertex_lightSpacePosition ; <nl> # endif <nl> <nl> - # if defined ( HAS_SHADOWING ) <nl> + # if defined ( HAS_SHADOWING ) & & defined ( HAS_DYNAMIC_LIGHTING ) <nl> LAYOUT_LOCATION ( 12 ) out highp vec4 vertex_spotLightSpacePosition [ MAX_SHADOW_CASTING_SPOTS ] ; <nl> # endif <nl> mmm a / shaders / src / main . vs <nl> ppp b / shaders / src / main . vs <nl> void main ( ) { <nl> frameUniforms . lightDirection , frameUniforms . shadowBias . y , getLightFromWorldMatrix ( ) ) ; <nl> # endif <nl> <nl> - # if defined ( HAS_SHADOWING ) <nl> + # if defined ( HAS_SHADOWING ) & & defined ( HAS_DYNAMIC_LIGHTING ) <nl> for ( uint l = 0u ; l < uint ( MAX_SHADOW_CASTING_SPOTS ) ; l + + ) { <nl> vec3 dir = shadowUniforms . directionShadowBias [ l ] . xyz ; <nl> float bias = shadowUniforms . directionShadowBias [ l ] . w ; <nl>
|
Audit material variants ( )
|
google/filament
|
d14e29d4d3e783e1cd74daec355cd3b74ef4eeb3
|
2020-08-13T17:58:27Z
|
mmm a / include / envoy / network / address . h <nl> ppp b / include / envoy / network / address . h <nl> <nl> # include " envoy / network / io_handle . h " <nl> <nl> # include " absl / numeric / int128 . h " <nl> + # include " absl / strings / string_view . h " <nl> <nl> namespace Envoy { <nl> namespace Network { <nl> class Instance { <nl> * / <nl> virtual const std : : string & asString ( ) const PURE ; <nl> <nl> + / * * <nl> + * @ return Similar to asString but returns a string view . <nl> + * / <nl> + virtual absl : : string_view asStringView ( ) const PURE ; <nl> + <nl> / * * <nl> * @ return a human readable string for the address that represents the <nl> * logical / unresolved name . <nl> mmm a / source / common / network / address_impl . h <nl> ppp b / source / common / network / address_impl . h <nl> class InstanceBase : public Instance { <nl> public : <nl> / / Network : : Address : : Instance <nl> const std : : string & asString ( ) const override { return friendly_name_ ; } <nl> + absl : : string_view asStringView ( ) const override { return friendly_name_ ; } <nl> / / Default logical name is the human - readable name . <nl> const std : : string & logicalName ( ) const override { return asString ( ) ; } <nl> Type type ( ) const override { return type_ ; } <nl> mmm a / test / common / network / address_impl_test . cc <nl> ppp b / test / common / network / address_impl_test . cc <nl> TEST ( Ipv4InstanceTest , SocketAddress ) { <nl> <nl> Ipv4Instance address ( & addr4 ) ; <nl> EXPECT_EQ ( " 1 . 2 . 3 . 4 : 6502 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " 1 . 2 . 3 . 4 : 6502 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( " 1 . 2 . 3 . 4 : 6502 " , address . logicalName ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 1 . 2 . 3 . 4 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> TEST ( Ipv4InstanceTest , SocketAddress ) { <nl> TEST ( Ipv4InstanceTest , AddressOnly ) { <nl> Ipv4Instance address ( " 3 . 4 . 5 . 6 " ) ; <nl> EXPECT_EQ ( " 3 . 4 . 5 . 6 : 0 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " 3 . 4 . 5 . 6 : 0 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 3 . 4 . 5 . 6 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_EQ ( 0U , address . ip ( ) - > port ( ) ) ; <nl> TEST ( Ipv4InstanceTest , AddressOnly ) { <nl> TEST ( Ipv4InstanceTest , AddressAndPort ) { <nl> Ipv4Instance address ( " 127 . 0 . 0 . 1 " , 80 ) ; <nl> EXPECT_EQ ( " 127 . 0 . 0 . 1 : 80 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " 127 . 0 . 0 . 1 : 80 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 127 . 0 . 0 . 1 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_FALSE ( address . ip ( ) - > isAnyAddress ( ) ) ; <nl> TEST ( Ipv4InstanceTest , AddressAndPort ) { <nl> TEST ( Ipv4InstanceTest , PortOnly ) { <nl> Ipv4Instance address ( 443 ) ; <nl> EXPECT_EQ ( " 0 . 0 . 0 . 0 : 443 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " 0 . 0 . 0 . 0 : 443 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 0 . 0 . 0 . 0 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_TRUE ( address . ip ( ) - > isAnyAddress ( ) ) ; <nl> TEST ( Ipv4InstanceTest , PortOnly ) { <nl> TEST ( Ipv4InstanceTest , Multicast ) { <nl> Ipv4Instance address ( " 230 . 0 . 0 . 1 " ) ; <nl> EXPECT_EQ ( " 230 . 0 . 0 . 1 : 0 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " 230 . 0 . 0 . 1 : 0 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 230 . 0 . 0 . 1 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_FALSE ( address . ip ( ) - > isAnyAddress ( ) ) ; <nl> TEST ( Ipv4InstanceTest , Multicast ) { <nl> TEST ( Ipv4InstanceTest , Broadcast ) { <nl> Ipv4Instance address ( " 255 . 255 . 255 . 255 " ) ; <nl> EXPECT_EQ ( " 255 . 255 . 255 . 255 : 0 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " 255 . 255 . 255 . 255 : 0 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 255 . 255 . 255 . 255 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_EQ ( 0U , address . ip ( ) - > port ( ) ) ; <nl> TEST ( Ipv6InstanceTest , SocketAddress ) { <nl> <nl> Ipv6Instance address ( addr6 ) ; <nl> EXPECT_EQ ( " [ 1 : 23 : : ef ] : 32000 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " [ 1 : 23 : : ef ] : 32000 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 1 : 23 : : ef " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_FALSE ( address . ip ( ) - > isAnyAddress ( ) ) ; <nl> TEST ( Ipv6InstanceTest , SocketAddress ) { <nl> TEST ( Ipv6InstanceTest , AddressOnly ) { <nl> Ipv6Instance address ( " 2001 : 0db8 : 85a3 : 0000 : 0000 : 8a2e : 0370 : 7334 " ) ; <nl> EXPECT_EQ ( " [ 2001 : db8 : 85a3 : : 8a2e : 370 : 7334 ] : 0 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " [ 2001 : db8 : 85a3 : : 8a2e : 370 : 7334 ] : 0 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " 2001 : db8 : 85a3 : : 8a2e : 370 : 7334 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_EQ ( 0U , address . ip ( ) - > port ( ) ) ; <nl> TEST ( Ipv6InstanceTest , AddressOnly ) { <nl> TEST ( Ipv6InstanceTest , AddressAndPort ) { <nl> Ipv6Instance address ( " : : 0001 " , 80 ) ; <nl> EXPECT_EQ ( " [ : : 1 ] : 80 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " [ : : 1 ] : 80 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " : : 1 " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_EQ ( 80U , address . ip ( ) - > port ( ) ) ; <nl> TEST ( Ipv6InstanceTest , AddressAndPort ) { <nl> TEST ( Ipv6InstanceTest , PortOnly ) { <nl> Ipv6Instance address ( 443 ) ; <nl> EXPECT_EQ ( " [ : : ] : 443 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " [ : : ] : 443 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " : : " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_TRUE ( address . ip ( ) - > isAnyAddress ( ) ) ; <nl> TEST ( Ipv6InstanceTest , PortOnly ) { <nl> TEST ( Ipv6InstanceTest , Multicast ) { <nl> Ipv6Instance address ( " FF00 : : " ) ; <nl> EXPECT_EQ ( " [ ff00 : : ] : 0 " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " [ ff00 : : ] : 0 " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Ip , address . type ( ) ) ; <nl> EXPECT_EQ ( " ff00 : : " , address . ip ( ) - > addressAsString ( ) ) ; <nl> EXPECT_FALSE ( address . ip ( ) - > isAnyAddress ( ) ) ; <nl> TEST ( PipeInstanceTest , AbstractNamespace ) { <nl> # if defined ( __linux__ ) <nl> PipeInstance address ( " @ / foo " ) ; <nl> EXPECT_EQ ( " @ / foo " , address . asString ( ) ) ; <nl> + EXPECT_EQ ( " @ / foo " , address . asStringView ( ) ) ; <nl> EXPECT_EQ ( Type : : Pipe , address . type ( ) ) ; <nl> EXPECT_EQ ( nullptr , address . ip ( ) ) ; <nl> # else <nl> mmm a / test / common / network / dns_impl_test . cc <nl> ppp b / test / common / network / dns_impl_test . cc <nl> class CustomInstance : public Address : : Instance { <nl> return asString ( ) = = rhs . asString ( ) ; <nl> } <nl> const std : : string & asString ( ) const override { return antagonistic_name_ ; } <nl> + absl : : string_view asStringView ( ) const override { return antagonistic_name_ ; } <nl> const std : : string & logicalName ( ) const override { return antagonistic_name_ ; } <nl> Api : : SysCallIntResult bind ( int fd ) const override { return instance_ . bind ( fd ) ; } <nl> Api : : SysCallIntResult connect ( int fd ) const override { return instance_ . connect ( fd ) ; } <nl> mmm a / test / mocks / network / mocks . h <nl> ppp b / test / mocks / network / mocks . h <nl> class MockResolvedAddress : public Address : : Instance { <nl> MOCK_CONST_METHOD0 ( sockAddrLen , socklen_t ( ) ) ; <nl> <nl> const std : : string & asString ( ) const override { return physical_ ; } <nl> + absl : : string_view asStringView ( ) const override { return physical_ ; } <nl> const std : : string & logicalName ( ) const override { return logical_ ; } <nl> <nl> const std : : string logical_ ; <nl>
|
cleanup : expose address string_view accessor ( )
|
envoyproxy/envoy
|
fb7e74ee3e33a619eefeeb7bafd5abbb672c8f8b
|
2019-07-26T15:54:32Z
|
mmm a / doc / reference_en . html <nl> ppp b / doc / reference_en . html <nl> < h4 > Distributed subqueries < / h4 > <nl> 2 . The temporary table will be sent to all the remote servers . Transmission does not account for network topology . For example , if 10 remote servers reside in a datacenter that is very remote in relation to the requestor server , the data will be sent 10 times over the channel to the remote datacenter . Try to avoid large data sets when using % % GLOBAL IN % % . <nl> 3 . When transmitting data to remote servers , restrictions on network bandwidth are not configurable . You might overload the network . <nl> 4 . Try to distribute data across servers so that you don & # 39 ; t need to use % % GLOBAL IN % % on a regular basis . <nl> - 5 . If you need to use % % GLOBAL IN % % often , plan the location of the ClickHouse cluster so that a single group of replicas resides in no more than one data center , and there is a fast network between them . <nl> + 5 . If you need to use % % GLOBAL IN % % often , plan the location of the ClickHouse cluster so that in each datacenter , there will be at least one replica of each shard , and there is a fast network between them - for possibility to process query with transferring data only inside datacenter . <nl> <nl> It also makes sense to specify a local table in the % % GLOBAL IN % % clause , in case this local table is only available on the requestor server and you want to use data from it on remote servers . <nl> <nl> mmm a / doc / reference_ru . html <nl> ppp b / doc / reference_ru . html <nl> < h4 > Распределённые подзапросы < / h4 > <nl> 2 . Временная таблица будет передана на все удалённые серверы . Передача не учитывает топологию сети . Например , если 10 удалённых серверов расположены в удалённом относительно сервера - инициатора запроса датацентре , то по каналу в удалённый датацентр данные будет переданы 10 раз . Старайтесь не использовать большие множества при использовании % % GLOBAL IN % % . <nl> 3 . При передаче данных на удалённые серверы не настраивается ограничение использования сетевой полосы . Вы можете перегрузить сеть . <nl> 4 . Старайтесь распределять данные по серверам так , чтобы в % % GLOBAL IN % % - ах не было частой необходимости . <nl> - 5 . Если в % % GLOBAL IN % % есть частая необходимость , то спланируйте размещение кластера ClickHouse таким образом , чтобы одна группа реплик располагалась не более чем в одном датацентре , и среди них была быстрая сеть . <nl> + 5 . Если в % % GLOBAL IN % % есть частая необходимость , то спланируйте размещение кластера ClickHouse таким образом , чтобы в каждом датацентре была хотя бы одна реплика каждого шарда , и среди них была быстрая сеть - чтобы запрос целиком можно было бы выполнить , передавая данные в пределах одного датацентра . <nl> <nl> В секции % % GLOBAL IN % % также имеет смысл указывать локальную таблицу - в случае , если эта локальная таблица есть только на сервере - инициаторе запроса , и вы хотите воспользоваться данными из неё на удалённых серверах . <nl> <nl>
|
doc : Clarifications about distributed subqueries [ # METR - 2944 ] .
|
ClickHouse/ClickHouse
|
6aa533ace4a11cce0f738f347f3e7948050e3baf
|
2016-07-09T00:12:09Z
|
mmm a / Marlin / src / feature / power . cpp <nl> ppp b / Marlin / src / feature / power . cpp <nl> bool Power : : is_power_needed ( ) { <nl> HOTEND_LOOP ( ) if ( thermalManager . degTargetHotend ( e ) > 0 ) return true ; <nl> if ( TERN0 ( HAS_HEATED_BED , thermalManager . degTargetBed ( ) > 0 ) ) return true ; <nl> <nl> - # if HOTENDS & & AUTO_POWER_E_TEMP <nl> + # if HAS_HOTEND & & AUTO_POWER_E_TEMP <nl> HOTEND_LOOP ( ) if ( thermalManager . degHotend ( e ) > = AUTO_POWER_E_TEMP ) return true ; <nl> # endif <nl> <nl> mmm a / Marlin / src / gcode / gcode . cpp <nl> ppp b / Marlin / src / gcode / gcode . cpp <nl> void GcodeSuite : : process_parsed_command ( const bool no_ok / * = false * / ) { <nl> case 120 : M120 ( ) ; break ; / / M120 : Enable endstops <nl> case 121 : M121 ( ) ; break ; / / M121 : Disable endstops <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> case 145 : M145 ( ) ; break ; / / M145 : Set material heatup parameters <nl> # endif <nl> <nl> mmm a / Marlin / src / gcode / gcode . h <nl> ppp b / Marlin / src / gcode / gcode . h <nl> class GcodeSuite { <nl> static void M191 ( ) ; <nl> # endif <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> static void M145 ( ) ; <nl> # endif <nl> <nl> mmm a / Marlin / src / gcode / lcd / M145 . cpp <nl> ppp b / Marlin / src / gcode / lcd / M145 . cpp <nl> <nl> <nl> # include " . . / . . / inc / MarlinConfig . h " <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> <nl> # include " . . / gcode . h " <nl> # include " . . / . . / lcd / ultralcd . h " <nl> mmm a / Marlin / src / inc / Conditionals_post . h <nl> ppp b / Marlin / src / inc / Conditionals_post . h <nl> <nl> # define HAS_TEMP_ADC_CHAMBER 1 <nl> # endif <nl> <nl> - # if HOTENDS & & EITHER ( HAS_TEMP_ADC_0 , HEATER_0_USES_MAX6675 ) <nl> + # if HAS_HOTEND & & EITHER ( HAS_TEMP_ADC_0 , HEATER_0_USES_MAX6675 ) <nl> # define HAS_TEMP_HOTEND 1 <nl> # endif <nl> # define HAS_TEMP_BED HAS_TEMP_ADC_BED <nl> mmm a / Marlin / src / lcd / dogm / dogm_Statusscreen . h <nl> ppp b / Marlin / src / lcd / dogm / dogm_Statusscreen . h <nl> <nl> # if HAS_FAN0 & & STATUS_FAN_WIDTH & & HOTENDS < = 4 & & defined ( STATUS_FAN_FRAMES ) <nl> # define DO_DRAW_FAN 1 <nl> # endif <nl> - # if HOTENDS & & ENABLED ( STATUS_HOTEND_ANIM ) <nl> + # if BOTH ( HAS_HOTEND , STATUS_HOTEND_ANIM ) <nl> # define ANIM_HOTEND 1 <nl> # endif <nl> # if BOTH ( DO_DRAW_BED , STATUS_BED_ANIM ) <nl> mmm a / Marlin / src / lcd / extui / ui_api . cpp <nl> ppp b / Marlin / src / lcd / extui / ui_api . cpp <nl> namespace ExtUI { <nl> } <nl> <nl> void enableHeater ( const extruder_t extruder ) { <nl> - # if HOTENDS & & HEATER_IDLE_HANDLER <nl> + # if HAS_HOTEND & & HEATER_IDLE_HANDLER <nl> thermalManager . reset_hotend_idle_timer ( extruder - E0 ) ; <nl> # else <nl> UNUSED ( extruder ) ; <nl> namespace ExtUI { <nl> <nl> bool isHeaterIdle ( const extruder_t extruder ) { <nl> return false <nl> - # if HOTENDS & & HEATER_IDLE_HANDLER <nl> + # if HAS_HOTEND & & HEATER_IDLE_HANDLER <nl> | | thermalManager . hotend_idle [ extruder - E0 ] . timed_out <nl> # else <nl> ; UNUSED ( extruder ) <nl> namespace ExtUI { <nl> # endif <nl> <nl> float getZOffset_mm ( ) { <nl> - # if HAS_BED_PROBE <nl> - return probe . offset . z ; <nl> - # elif ENABLED ( BABYSTEP_DISPLAY_TOTAL ) <nl> - return ( planner . steps_to_mm [ Z_AXIS ] * babystep . axis_total [ BS_AXIS_IND ( Z_AXIS ) ] ) ; <nl> - # else <nl> - return 0 . 0 ; <nl> - # endif <nl> + return ( 0 . 0f <nl> + # if HAS_BED_PROBE <nl> + + probe . offset . z <nl> + # elif ENABLED ( BABYSTEP_DISPLAY_TOTAL ) <nl> + + planner . steps_to_mm [ Z_AXIS ] * babystep . axis_total [ BS_AXIS_IND ( Z_AXIS ) ] <nl> + # endif <nl> + ) ; <nl> } <nl> <nl> void setZOffset_mm ( const float value ) { <nl> namespace ExtUI { <nl> float getFeedrate_percent ( ) { return feedrate_percentage ; } <nl> <nl> # if ENABLED ( PIDTEMP ) <nl> - float getPIDValues_Kp ( const extruder_t tool ) { <nl> - return PID_PARAM ( Kp , tool ) ; <nl> - } <nl> - <nl> - float getPIDValues_Ki ( const extruder_t tool ) { <nl> - return unscalePID_i ( PID_PARAM ( Ki , tool ) ) ; <nl> - } <nl> - <nl> - float getPIDValues_Kd ( const extruder_t tool ) { <nl> - return unscalePID_d ( PID_PARAM ( Kd , tool ) ) ; <nl> - } <nl> + float getPIDValues_Kp ( const extruder_t tool ) { return PID_PARAM ( Kp , tool ) ; } <nl> + float getPIDValues_Ki ( const extruder_t tool ) { return unscalePID_i ( PID_PARAM ( Ki , tool ) ) ; } <nl> + float getPIDValues_Kd ( const extruder_t tool ) { return unscalePID_d ( PID_PARAM ( Kd , tool ) ) ; } <nl> <nl> void setPIDValues ( const float p , const float i , const float d , extruder_t tool ) { <nl> thermalManager . temp_hotend [ tool ] . pid . Kp = p ; <nl> namespace ExtUI { <nl> thermalManager . updatePID ( ) ; <nl> } <nl> <nl> - void startPIDTune ( const float temp , extruder_t tool ) { <nl> + void startPIDTune ( const float temp , extruder_t tool ) { <nl> thermalManager . PID_autotune ( temp , ( heater_ind_t ) tool , 8 , true ) ; <nl> } <nl> # endif <nl> <nl> # if ENABLED ( PIDTEMPBED ) <nl> - float getBedPIDValues_Kp ( ) { <nl> - return thermalManager . temp_bed . pid . Kp ; <nl> - } <nl> - <nl> - float getBedPIDValues_Ki ( ) { <nl> - return unscalePID_i ( thermalManager . temp_bed . pid . Ki ) ; <nl> - } <nl> - <nl> - float getBedPIDValues_Kd ( ) { <nl> - return unscalePID_d ( thermalManager . temp_bed . pid . Kd ) ; <nl> - } <nl> + float getBedPIDValues_Kp ( ) { return thermalManager . temp_bed . pid . Kp ; } <nl> + float getBedPIDValues_Ki ( ) { return unscalePID_i ( thermalManager . temp_bed . pid . Ki ) ; } <nl> + float getBedPIDValues_Kd ( ) { return unscalePID_d ( thermalManager . temp_bed . pid . Kd ) ; } <nl> <nl> void setBedPIDValues ( const float p , const float i , const float d ) { <nl> thermalManager . temp_bed . pid . Kp = p ; <nl> namespace ExtUI { <nl> } <nl> # endif <nl> <nl> - void injectCommands_P ( PGM_P const gcode ) { <nl> - queue . inject_P ( gcode ) ; <nl> - } <nl> + void injectCommands_P ( PGM_P const gcode ) { queue . inject_P ( gcode ) ; } <nl> <nl> bool commandsInQueue ( ) { return ( planner . movesplanned ( ) | | queue . has_commands_queued ( ) ) ; } <nl> <nl> - bool isAxisPositionKnown ( const axis_t axis ) { <nl> - return TEST ( axis_known_position , axis ) ; <nl> - } <nl> - <nl> - bool isAxisPositionKnown ( const extruder_t ) { <nl> - return TEST ( axis_known_position , E_AXIS ) ; <nl> - } <nl> - <nl> + bool isAxisPositionKnown ( const axis_t axis ) { return TEST ( axis_known_position , axis ) ; } <nl> + bool isAxisPositionKnown ( const extruder_t ) { return TEST ( axis_known_position , E_AXIS ) ; } <nl> bool isPositionKnown ( ) { return all_axes_known ( ) ; } <nl> bool isMachineHomed ( ) { return all_axes_homed ( ) ; } <nl> <nl> namespace ExtUI { <nl> return IFSD ( IS_SD_INSERTED ( ) & & card . isMounted ( ) , false ) ; <nl> } <nl> <nl> - void pausePrint ( ) { <nl> - ui . pause_print ( ) ; <nl> - } <nl> - <nl> - void resumePrint ( ) { <nl> - ui . resume_print ( ) ; <nl> - } <nl> - <nl> - void stopPrint ( ) { <nl> - ui . abort_print ( ) ; <nl> - } <nl> + void pausePrint ( ) { ui . pause_print ( ) ; } <nl> + void resumePrint ( ) { ui . resume_print ( ) ; } <nl> + void stopPrint ( ) { ui . abort_print ( ) ; } <nl> <nl> void onUserConfirmRequired_P ( PGM_P const pstr ) { <nl> char msg [ strlen_P ( pstr ) + 1 ] ; <nl> mmm a / Marlin / src / module / configuration_store . cpp <nl> ppp b / Marlin / src / module / configuration_store . cpp <nl> void MarlinSettings : : postprocess ( ) { <nl> { <nl> _FIELD_TEST ( ui_preheat_hotend_temp ) ; <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> const int16_t ( & ui_preheat_hotend_temp ) [ 2 ] = ui . preheat_hotend_temp , <nl> ( & ui_preheat_bed_temp ) [ 2 ] = ui . preheat_bed_temp ; <nl> const uint8_t ( & ui_preheat_fan_speed ) [ 2 ] = ui . preheat_fan_speed ; <nl> void MarlinSettings : : postprocess ( ) { <nl> { <nl> _FIELD_TEST ( ui_preheat_hotend_temp ) ; <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> int16_t ( & ui_preheat_hotend_temp ) [ 2 ] = ui . preheat_hotend_temp , <nl> ( & ui_preheat_bed_temp ) [ 2 ] = ui . preheat_bed_temp ; <nl> uint8_t ( & ui_preheat_fan_speed ) [ 2 ] = ui . preheat_fan_speed ; <nl> void MarlinSettings : : reset ( ) { <nl> / / Preheat parameters <nl> / / <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> ui . preheat_hotend_temp [ 0 ] = PREHEAT_1_TEMP_HOTEND ; <nl> ui . preheat_hotend_temp [ 1 ] = PREHEAT_2_TEMP_HOTEND ; <nl> ui . preheat_bed_temp [ 0 ] = PREHEAT_1_TEMP_BED ; <nl> void MarlinSettings : : reset ( ) { <nl> <nl> # endif / / [ XYZ ] _DUAL_ENDSTOPS <nl> <nl> - # if HOTENDS & & HAS_LCD_MENU <nl> + # if HAS_HOTEND & & HAS_LCD_MENU <nl> <nl> CONFIG_ECHO_HEADING ( " Material heatup parameters : " ) ; <nl> LOOP_L_N ( i , COUNT ( ui . preheat_hotend_temp ) ) { <nl> mmm a / Marlin / src / module / temperature . cpp <nl> ppp b / Marlin / src / module / temperature . cpp <nl> void Temperature : : tick ( ) { <nl> <nl> # if DISABLED ( SLOW_PWM_HEATERS ) <nl> <nl> - # if HOTENDS | | HAS_HEATED_BED | | HAS_HEATED_CHAMBER <nl> + # if HAS_HOTEND | | HAS_HEATED_BED | | HAS_HEATED_CHAMBER <nl> constexpr uint8_t pwm_mask = <nl> # if ENABLED ( SOFT_PWM_DITHER ) <nl> _BV ( SOFT_PWM_SCALE ) - 1 <nl> void Temperature : : tick ( ) { <nl> <nl> # endif / / AUTO_REPORT_TEMPERATURES <nl> <nl> - # if HOTENDS & & HAS_DISPLAY <nl> + # if HAS_HOTEND & & HAS_DISPLAY <nl> void Temperature : : set_heating_message ( const uint8_t e ) { <nl> const bool heating = isHeatingHotend ( e ) ; <nl> ui . status_printf_P ( 0 , <nl>
|
Apply more HAS_HOTEND
|
MarlinFirmware/Marlin
|
01c646a892c9cd36baf577ca9be344e3490a7727
|
2020-04-28T03:39:31Z
|
mmm a / tensorflow / contrib / makefile / tf_op_files . txt <nl> ppp b / tensorflow / contrib / makefile / tf_op_files . txt <nl> tensorflow / core / kernels / strided_slice_op_inst_5 . cc <nl> tensorflow / core / kernels / strided_slice_op_inst_6 . cc <nl> tensorflow / core / kernels / strided_slice_op_inst_7 . cc <nl> tensorflow / core / kernels / string_join_op . cc <nl> + tensorflow / core / kernels / string_util . cc <nl> tensorflow / core / kernels / tensor_array . cc <nl> tensorflow / core / kernels / tensor_array_ops . cc <nl> tensorflow / core / kernels / tile_functor_cpu . cc <nl> mmm a / tensorflow / core / api_def / base_api / api_def_StringLength . pbtxt <nl> ppp b / tensorflow / core / api_def / base_api / api_def_StringLength . pbtxt <nl> <nl> op { <nl> graph_op_name : " StringLength " <nl> + attr { <nl> + name : " unit " <nl> + description : < < END <nl> + The unit that is counted to compute string length . One of : ` " BYTE " ` ( for <nl> + the number of bytes in each string ) or ` " UTF8_CHAR " ` ( for the number of UTF - 8 <nl> + encoded Unicode code points in each string ) . Results are undefined <nl> + if ` unit = UTF8_CHAR ` and the ` input ` strings do not contain structurally <nl> + valid UTF - 8 . <nl> + END <nl> + } <nl> in_arg { <nl> name : " input " <nl> description : < < END <nl> mmm a / tensorflow / core / api_def / python_api / api_def_StringLength . pbtxt <nl> ppp b / tensorflow / core / api_def / python_api / api_def_StringLength . pbtxt <nl> <nl> op { <nl> graph_op_name : " StringLength " <nl> - endpoint { <nl> - name : " strings . length " <nl> - } <nl> + visibility : HIDDEN <nl> } <nl> mmm a / tensorflow / core / kernels / BUILD <nl> ppp b / tensorflow / core / kernels / BUILD <nl> cc_library ( <nl> ] , <nl> ) <nl> <nl> + cc_library ( <nl> + name = " string_util " , <nl> + srcs = [ " string_util . cc " ] , <nl> + hdrs = [ " string_util . h " ] , <nl> + deps = [ " / / tensorflow / core : lib " ] , <nl> + ) <nl> + <nl> STRING_DEPS = [ <nl> " : bounds_check " , <nl> + " : string_util " , <nl> " / / third_party / eigen3 " , <nl> " / / tensorflow / core : framework " , <nl> " / / tensorflow / core : lib " , <nl> filegroup ( <nl> " spacetobatch_functor . h " , <nl> " spacetodepth_op . h " , <nl> " spectrogram . h " , <nl> + " string_util . h " , <nl> " tensor_array . h " , <nl> " tile_functor . h " , <nl> " tile_ops_cpu_impl . h " , <nl> filegroup ( <nl> " spectrogram_op . cc " , <nl> " stack_ops . cc " , <nl> " string_join_op . cc " , <nl> + " string_util . cc " , <nl> " summary_op . cc " , <nl> " tensor_array . cc " , <nl> " tensor_array_ops . cc " , <nl> mmm a / tensorflow / core / kernels / string_length_op . cc <nl> ppp b / tensorflow / core / kernels / string_length_op . cc <nl> limitations under the License . <nl> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> # include " tensorflow / core / framework / op_kernel . h " <nl> # include " tensorflow / core / framework / types . h " <nl> + # include " tensorflow / core / kernels / string_util . h " <nl> <nl> namespace tensorflow { <nl> namespace { <nl> <nl> class StringLengthOp : public OpKernel { <nl> public : <nl> - using OpKernel : : OpKernel ; <nl> + explicit StringLengthOp ( OpKernelConstruction * ctx ) : OpKernel ( ctx ) { <nl> + string unit ; <nl> + OP_REQUIRES_OK ( ctx , ctx - > GetAttr ( " unit " , & unit ) ) ; <nl> + OP_REQUIRES_OK ( ctx , ParseCharUnit ( unit , & unit_ ) ) ; <nl> + } <nl> <nl> void Compute ( OpKernelContext * context ) override { <nl> const Tensor & input = context - > input ( 0 ) ; <nl> class StringLengthOp : public OpKernel { <nl> auto src = input . flat < string > ( ) ; <nl> auto dst = output - > flat < int32 > ( ) ; <nl> <nl> - for ( int n = 0 ; n < src . size ( ) ; + + n ) { <nl> - dst ( n ) = src ( n ) . size ( ) ; <nl> + switch ( unit_ ) { <nl> + case CharUnit : : BYTE : <nl> + for ( int n = 0 ; n < src . size ( ) ; + + n ) { <nl> + dst ( n ) = src ( n ) . size ( ) ; <nl> + } <nl> + break ; <nl> + case CharUnit : : UTF8_CHAR : <nl> + for ( int n = 0 ; n < src . size ( ) ; + + n ) { <nl> + dst ( n ) = UTF8StrLen ( src ( n ) ) ; <nl> + } <nl> + break ; <nl> } <nl> } <nl> + <nl> + private : <nl> + CharUnit unit_ = CharUnit : : BYTE ; <nl> } ; <nl> <nl> REGISTER_KERNEL_BUILDER ( Name ( " StringLength " ) . Device ( DEVICE_CPU ) , <nl> new file mode 100644 <nl> index 0000000000000 . . 3a9803a052f22 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / kernels / string_util . cc <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + # include " tensorflow / core / kernels / string_util . h " <nl> + <nl> + # include " tensorflow / core / lib / core / errors . h " <nl> + <nl> + namespace { <nl> + inline bool IsTrailByte ( char x ) { return static_cast < signed char > ( x ) < - 0x40 ; } <nl> + } / / namespace <nl> + <nl> + namespace tensorflow { <nl> + <nl> + / / Sets unit value based on str . <nl> + Status ParseUnicodeEncoding ( const string & str , UnicodeEncoding * encoding ) { <nl> + if ( str = = " UTF8 " ) { <nl> + * encoding = UnicodeEncoding : : UTF8 ; <nl> + } else { <nl> + return errors : : InvalidArgument ( strings : : StrCat ( <nl> + " Invalid encoding \ " " , str , " \ " : Should be one of : BYTE " ) ) ; <nl> + } <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + / / Sets unit value based on str . <nl> + Status ParseCharUnit ( const string & str , CharUnit * unit ) { <nl> + if ( str = = " BYTE " ) { <nl> + * unit = CharUnit : : BYTE ; <nl> + } else if ( str = = " UTF8_CHAR " ) { <nl> + * unit = CharUnit : : UTF8_CHAR ; <nl> + } else { <nl> + return errors : : InvalidArgument ( strings : : StrCat ( <nl> + " Invalid unit \ " " , str , " \ " : Should be one of : BYTE , UTF8_CHAR " ) ) ; <nl> + } <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + / / Return the number of Unicode characters in a UTF - 8 string . <nl> + / / Result may be incorrect if the input string is not valid UTF - 8 . <nl> + int32 UTF8StrLen ( const string & string ) { <nl> + const int32 byte_size = string . size ( ) ; <nl> + const char * const end = string . data ( ) + byte_size ; <nl> + const char * ptr = string . data ( ) ; <nl> + int32 skipped_count = 0 ; <nl> + while ( ptr < end ) { <nl> + skipped_count + = IsTrailByte ( * ptr + + ) ? 1 : 0 ; <nl> + } <nl> + const int32 result = byte_size - skipped_count ; <nl> + return result ; <nl> + } <nl> + <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . 390cf57702710 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / kernels / string_util . h <nl> <nl> + / * Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + # ifndef TENSORFLOW_CORE_KERNELS_STRING_UTIL_H_ <nl> + # define TENSORFLOW_CORE_KERNELS_STRING_UTIL_H_ <nl> + <nl> + # include " tensorflow / core / lib / core / status . h " <nl> + <nl> + namespace tensorflow { <nl> + <nl> + / / Enumeration for unicode encodings . Used by ops such as <nl> + / / tf . strings . unicode_encode and tf . strings . unicode_decode . <nl> + / / TODO ( edloper ) : Add support for : <nl> + / / UTF16 , UTF32 , UTF16BE , UTF32BE , UTF16LE , UTF32LE <nl> + enum class UnicodeEncoding { UTF8 } ; <nl> + <nl> + / / Enumeration for character units . Used by string such as <nl> + / / tf . strings . length and tf . substr . <nl> + / / TODO ( edloper ) : Add support for : UTF32_CHAR , etc . <nl> + enum class CharUnit { BYTE , UTF8_CHAR } ; <nl> + <nl> + / / Sets ` encoding ` based on ` str ` . <nl> + Status ParseUnicodeEncoding ( const string & str , UnicodeEncoding * encoding ) ; <nl> + <nl> + / / Sets ` unit ` value based on ` str ` . <nl> + Status ParseCharUnit ( const string & str , CharUnit * unit ) ; <nl> + <nl> + / / Returns the number of Unicode characters in a UTF - 8 string . <nl> + / / Result may be incorrect if the input string is not valid UTF - 8 . <nl> + int32 UTF8StrLen ( const string & string ) ; <nl> + <nl> + } / / namespace tensorflow <nl> + <nl> + # endif / / TENSORFLOW_CORE_KERNELS_STRING_UTIL_H_ <nl> mmm a / tensorflow / core / ops / string_ops . cc <nl> ppp b / tensorflow / core / ops / string_ops . cc <nl> REGISTER_OP ( " StringStrip " ) <nl> REGISTER_OP ( " StringLength " ) <nl> . Input ( " input : string " ) <nl> . Output ( " output : int32 " ) <nl> + . Attr ( " unit : { ' BYTE ' , ' UTF8_CHAR ' } = ' BYTE ' " ) <nl> . SetShapeFn ( shape_inference : : UnchangedShape ) ; <nl> <nl> REGISTER_OP ( " EncodeBase64 " ) <nl> mmm a / tensorflow / python / kernel_tests / string_length_op_test . py <nl> ppp b / tensorflow / python / kernel_tests / string_length_op_test . py <nl> def testStringLength ( self ) : <nl> values = sess . run ( lengths ) <nl> self . assertAllEqual ( values , [ [ [ 1 , 2 ] , [ 3 , 4 ] , [ 5 , 6 ] ] ] ) <nl> <nl> + def testUnit ( self ) : <nl> + unicode_strings = [ u " H \ xc3llo " , u " \ U0001f604 " ] <nl> + utf8_strings = [ s . encode ( " utf - 8 " ) for s in unicode_strings ] <nl> + expected_utf8_byte_lengths = [ 6 , 4 ] <nl> + expected_utf8_char_lengths = [ 5 , 1 ] <nl> + <nl> + with self . test_session ( ) as sess : <nl> + utf8_byte_lengths = string_ops . string_length ( utf8_strings , unit = " BYTE " ) <nl> + utf8_char_lengths = string_ops . string_length ( <nl> + utf8_strings , unit = " UTF8_CHAR " ) <nl> + self . assertAllEqual ( <nl> + sess . run ( utf8_byte_lengths ) , expected_utf8_byte_lengths ) <nl> + self . assertAllEqual ( <nl> + sess . run ( utf8_char_lengths ) , expected_utf8_char_lengths ) <nl> + with self . assertRaisesRegexp ( <nl> + ValueError , " Attr ' unit ' of ' StringLength ' Op passed string ' XYZ ' " <nl> + ' not in : " BYTE " , " UTF8_CHAR " ' ) : <nl> + string_ops . string_length ( utf8_strings , unit = " XYZ " ) <nl> + <nl> + def testLegacyPositionalName ( self ) : <nl> + # Code that predates the ' unit ' parameter may have used a positional <nl> + # argument for the ' name ' parameter . Check that we don ' t break such code . <nl> + strings = [ [ [ " 1 " , " 12 " ] , [ " 123 " , " 1234 " ] , [ " 12345 " , " 123456 " ] ] ] <nl> + lengths = string_ops . string_length ( strings , " some_name " ) <nl> + with self . test_session ( ) : <nl> + self . assertAllEqual ( lengths . eval ( ) , [ [ [ 1 , 2 ] , [ 3 , 4 ] , [ 5 , 6 ] ] ] ) <nl> + <nl> <nl> if __name__ = = " __main__ " : <nl> test . main ( ) <nl> mmm a / tensorflow / python / ops / string_ops . py <nl> ppp b / tensorflow / python / ops / string_ops . py <nl> <nl> <nl> # go / tf - wildcard - import <nl> # pylint : disable = wildcard - import <nl> + # pylint : disable = g - bad - import - order <nl> from tensorflow . python . ops . gen_string_ops import * <nl> from tensorflow . python . util import compat as util_compat <nl> from tensorflow . python . util import deprecation <nl> from tensorflow . python . util . tf_export import tf_export <nl> + # pylint : enable = g - bad - import - order <nl> # pylint : enable = wildcard - import <nl> <nl> <nl> def reduce_join ( inputs , axis = None , <nl> reduce_join . __doc__ = deprecation . rewrite_argument_docstring ( <nl> gen_string_ops . reduce_join . __doc__ , " reduction_indices " , " axis " ) <nl> <nl> + <nl> + # This wrapper provides backwards compatibility for code that predates the <nl> + # unit argument and that passed ' name ' as a positional argument . <nl> + @ tf_export ( " strings . length " ) <nl> + def string_length ( input , name = None , unit = " BYTE " ) : <nl> + return gen_string_ops . string_length ( input , unit = unit , name = name ) <nl> + <nl> + <nl> + string_length . __doc__ = gen_string_ops . string_length . __doc__ <nl> + <nl> + <nl> ops . NotDifferentiable ( " RegexReplace " ) <nl> ops . NotDifferentiable ( " StringToHashBucket " ) <nl> ops . NotDifferentiable ( " StringToHashBucketFast " ) <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . strings . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . strings . pbtxt <nl> tf_module { <nl> } <nl> member_method { <nl> name : " length " <nl> - argspec : " args = [ \ ' input \ ' , \ ' name \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' input \ ' , \ ' name \ ' , \ ' unit \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' BYTE \ ' ] , " <nl> } <nl> member_method { <nl> name : " regex_full_match " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . strings . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . strings . pbtxt <nl> tf_module { <nl> } <nl> member_method { <nl> name : " length " <nl> - argspec : " args = [ \ ' input \ ' , \ ' name \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' input \ ' , \ ' name \ ' , \ ' unit \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' , \ ' BYTE \ ' ] , " <nl> } <nl> member_method { <nl> name : " regex_full_match " <nl>
|
Add " encoding " attribute to string length op , which controls how " string length " is defined :
|
tensorflow/tensorflow
|
d5c5df164cedcd8ae43fff41256592818bc6c2de
|
2018-09-25T19:07:36Z
|
mmm a / jstests / libs / ssl_test . js <nl> ppp b / jstests / libs / ssl_test . js <nl> SSLTest . prototype . noSSLClientOptions = { <nl> * was successfully established . <nl> * / <nl> SSLTest . prototype . connectWorked = function ( ) { <nl> - var connectTimeoutMillis = 600000 ; <nl> + var connectTimeoutMillis = 3 * 60 * 1000 ; <nl> <nl> var serverArgv = MongoRunner . arrOptions ( " mongod " , this . serverOpts ) ; <nl> var clientArgv = MongoRunner . arrOptions ( " mongo " , this . clientOpts ) ; <nl> mmm a / jstests / ssl / mixed_mode_repl . js <nl> ppp b / jstests / ssl / mixed_mode_repl . js <nl> <nl> <nl> load ( " jstests / ssl / libs / ssl_helpers . js " ) ; <nl> <nl> + / / Limit the amount of time we ' ll wait on a failure . <nl> + / / Apply equally to success tests as well so that <nl> + / / a failure to complete replication is more likely to <nl> + / / give us a false negative , than a false positive . <nl> + ReplSetTest . kDefaultTimeoutMS = 3 * 60 * 1000 ; <nl> + <nl> / / Verify that requireSSL allows ssl connections <nl> print ( " = = = Testing requireSSL / requireSSL cluster = = = " ) ; <nl> replShouldSucceed ( " require - require " , requireSSL , requireSSL ) ; <nl> mmm a / jstests / sslSpecial / mixed_mode_repl_nossl . js <nl> ppp b / jstests / sslSpecial / mixed_mode_repl_nossl . js <nl> <nl> <nl> load ( " jstests / ssl / libs / ssl_helpers . js " ) ; <nl> <nl> + / / Limit the amount of time we ' ll wait on a failure . <nl> + / / Apply equally to success tests as well so that <nl> + / / a failure to complete replication is more likely to <nl> + / / give us a false negative , than a false positive . <nl> + ReplSetTest . kDefaultTimeoutMS = 3 * 60 * 1000 ; <nl> + <nl> / / Verify that disabled allows non - ssl connections <nl> print ( " = = = Testing disabled cluster = = = " ) ; <nl> replShouldSucceed ( " disabled - disabled " , disabled , disabled ) ; <nl>
|
SERVER - 40598 Set timeout on SSL mixed_mode_repl test
|
mongodb/mongo
|
3ccf6f6e9ed261a390574fa8a3d590951e1f04ac
|
2019-04-22T15:39:29Z
|
mmm a / XBMC . xcodeproj / project . pbxproj <nl> ppp b / XBMC . xcodeproj / project . pbxproj <nl> <nl> 810C9FA90D67D1FB0095F5DD / * MythDirectory . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 810C9FA50D67D1FB0095F5DD / * MythDirectory . cpp * / ; } ; <nl> 810C9FAA0D67D1FB0095F5DD / * MythFile . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 810C9FA70D67D1FB0095F5DD / * MythFile . cpp * / ; } ; <nl> 815EE6350E17F1DC009FBE3C / * DVDInputStreamRTMP . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 815EE6330E17F1DC009FBE3C / * DVDInputStreamRTMP . cpp * / ; } ; <nl> + 832F2C46120D8B5E00026B38 / * PVRManager . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C44120D8B5E00026B38 / * PVRManager . cpp * / ; } ; <nl> + 832F2C4F120D8B7F00026B38 / * PVRChannels . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C47120D8B7F00026B38 / * PVRChannels . cpp * / ; } ; <nl> + 832F2C50120D8B7F00026B38 / * PVREpg . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C49120D8B7F00026B38 / * PVREpg . cpp * / ; } ; <nl> + 832F2C51120D8B7F00026B38 / * PVRRecordings . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C4B120D8B7F00026B38 / * PVRRecordings . cpp * / ; } ; <nl> + 832F2C52120D8B7F00026B38 / * PVRTimers . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C4D120D8B7F00026B38 / * PVRTimers . cpp * / ; } ; <nl> + 832F2C69120D8BA900026B38 / * GUIDialogPVRChannelManager . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C53120D8BA800026B38 / * GUIDialogPVRChannelManager . cpp * / ; } ; <nl> + 832F2C6A120D8BA900026B38 / * GUIDialogPVRChannelsOSD . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C55120D8BA800026B38 / * GUIDialogPVRChannelsOSD . cpp * / ; } ; <nl> + 832F2C6B120D8BA900026B38 / * GUIDialogPVRCutterOSD . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C57120D8BA800026B38 / * GUIDialogPVRCutterOSD . cpp * / ; } ; <nl> + 832F2C6C120D8BA900026B38 / * GUIDialogPVRDirectorOSD . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C59120D8BA800026B38 / * GUIDialogPVRDirectorOSD . cpp * / ; } ; <nl> + 832F2C6D120D8BA900026B38 / * GUIDialogPVRGroupManager . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C5B120D8BA800026B38 / * GUIDialogPVRGroupManager . cpp * / ; } ; <nl> + 832F2C6E120D8BA900026B38 / * GUIDialogPVRGuideInfo . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C5D120D8BA900026B38 / * GUIDialogPVRGuideInfo . cpp * / ; } ; <nl> + 832F2C6F120D8BA900026B38 / * GUIDialogPVRGuideOSD . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C5F120D8BA900026B38 / * GUIDialogPVRGuideOSD . cpp * / ; } ; <nl> + 832F2C70120D8BA900026B38 / * GUIDialogPVRGuideSearch . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C61120D8BA900026B38 / * GUIDialogPVRGuideSearch . cpp * / ; } ; <nl> + 832F2C71120D8BA900026B38 / * GUIDialogPVRRecordingInfo . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C63120D8BA900026B38 / * GUIDialogPVRRecordingInfo . cpp * / ; } ; <nl> + 832F2C72120D8BA900026B38 / * GUIDialogPVRTimerSettings . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C65120D8BA900026B38 / * GUIDialogPVRTimerSettings . cpp * / ; } ; <nl> + 832F2C73120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C67120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . cpp * / ; } ; <nl> + 832F2C7E120D8C0300026B38 / * AddonHelpers_Addon . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C76120D8C0300026B38 / * AddonHelpers_Addon . cpp * / ; } ; <nl> + 832F2C7F120D8C0300026B38 / * AddonHelpers_GUI . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C78120D8C0300026B38 / * AddonHelpers_GUI . cpp * / ; } ; <nl> + 832F2C80120D8C0300026B38 / * AddonHelpers_local . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C7A120D8C0300026B38 / * AddonHelpers_local . cpp * / ; } ; <nl> + 832F2C81120D8C0300026B38 / * AddonHelpers_PVR . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C7C120D8C0300026B38 / * AddonHelpers_PVR . cpp * / ; } ; <nl> + 832F2C84120D8C1000026B38 / * PVRClient . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C82120D8C0F00026B38 / * PVRClient . cpp * / ; } ; <nl> + 832F2C87120D8C5300026B38 / * TVDatabase . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C85120D8C5300026B38 / * TVDatabase . cpp * / ; } ; <nl> + 832F2C8A120D8C9300026B38 / * GUIEPGGridContainer . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C88120D8C9300026B38 / * GUIEPGGridContainer . cpp * / ; } ; <nl> + 832F2C8F120D8CB500026B38 / * PVRDirectory . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C8B120D8CB400026B38 / * PVRDirectory . cpp * / ; } ; <nl> + 832F2C90120D8CB500026B38 / * PVRFile . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C8D120D8CB500026B38 / * PVRFile . cpp * / ; } ; <nl> + 832F2C95120D8CF600026B38 / * TextSearch . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C93120D8CF600026B38 / * TextSearch . cpp * / ; } ; <nl> + 832F2C98120D8D0B00026B38 / * DVDDemuxPVRClient . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C96120D8D0B00026B38 / * DVDDemuxPVRClient . cpp * / ; } ; <nl> + 832F2C9B120D8D3000026B38 / * GUIWindowTV . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C99120D8D3000026B38 / * GUIWindowTV . cpp * / ; } ; <nl> + 832F2CA0120D8D5C00026B38 / * DVDInputStreamPVRManager . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2C9E120D8D5C00026B38 / * DVDInputStreamPVRManager . cpp * / ; } ; <nl> + 832F2CA3120D8D7600026B38 / * GUIViewStateTV . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 832F2CA1120D8D7600026B38 / * GUIViewStateTV . cpp * / ; } ; <nl> 83A72B910FBC8DB000171871 / * CoreAudioRenderer . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 83A72B8E0FBC8DB000171871 / * CoreAudioRenderer . cpp * / ; } ; <nl> 83A72B940FBC8DFF00171871 / * CoreAudio . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 83A72B920FBC8DFF00171871 / * CoreAudio . cpp * / ; } ; <nl> 83A72B970FBC8E3B00171871 / * LockFree . cpp in Sources * / = { isa = PBXBuildFile ; fileRef = 83A72B950FBC8E3B00171871 / * LockFree . cpp * / ; settings = { COMPILER_FLAGS = " - O0 " ; } ; } ; <nl> <nl> 184C472D1296BC6E0006DB3E / * Service . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = Service . cpp ; path = addons / Service . cpp ; sourceTree = " < group > " ; } ; <nl> 184C472E1296BC6E0006DB3E / * Service . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = Service . h ; path = addons / Service . h ; sourceTree = " < group > " ; } ; <nl> 18B49FF11152BFA5001AF8A6 / * Addon . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = Addon . cpp ; path = addons / Addon . cpp ; sourceTree = " < group > " ; } ; <nl> - 18B49FF21152BFA5001AF8A6 / * Addon . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = Addon . h ; path = addons / Addon . h ; sourceTree = " < group > " ; } ; <nl> - 18B49FF31152BFA5001AF8A6 / * AddonDll . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonDll . h ; path = addons / AddonDll . h ; sourceTree = " < group > " ; } ; <nl> 18B49FF41152BFA5001AF8A6 / * AddonManager . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = AddonManager . cpp ; path = addons / AddonManager . cpp ; sourceTree = " < group > " ; } ; <nl> 18B49FF51152BFA5001AF8A6 / * AddonManager . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonManager . h ; path = addons / AddonManager . h ; sourceTree = " < group > " ; } ; <nl> - 18B49FF61152BFA5001AF8A6 / * DllAddon . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = DllAddon . h ; path = addons / DllAddon . h ; sourceTree = " < group > " ; } ; <nl> 18B49FF71152BFA5001AF8A6 / * DllScreenSaver . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = DllScreenSaver . h ; path = addons / DllScreenSaver . h ; sourceTree = " < group > " ; } ; <nl> 18B49FF81152BFA5001AF8A6 / * DllVisualisation . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = DllVisualisation . h ; path = addons / DllVisualisation . h ; sourceTree = " < group > " ; } ; <nl> 18B49FF91152BFA5001AF8A6 / * fft . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = fft . cpp ; path = addons / fft . cpp ; sourceTree = " < group > " ; } ; <nl> <nl> 810CA0080D683DEF0095F5DD / * libSDL_mixer - x86 - osx . a * / = { isa = PBXFileReference ; lastKnownFileType = archive . ar ; name = " libSDL_mixer - x86 - osx . a " ; path = " lib / libSDL - OSX / libSDL_mixer - x86 - osx . a " ; sourceTree = " < group > " ; } ; <nl> 815EE6330E17F1DC009FBE3C / * DVDInputStreamRTMP . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = DVDInputStreamRTMP . cpp ; sourceTree = " < group > " ; } ; <nl> 815EE6340E17F1DC009FBE3C / * DVDInputStreamRTMP . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = DVDInputStreamRTMP . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C44120D8B5E00026B38 / * PVRManager . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRManager . cpp ; path = xbmc / PVRManager . cpp ; sourceTree = SOURCE_ROOT ; } ; <nl> + 832F2C45120D8B5E00026B38 / * PVRManager . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRManager . h ; path = xbmc / PVRManager . h ; sourceTree = SOURCE_ROOT ; } ; <nl> + 832F2C47120D8B7F00026B38 / * PVRChannels . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRChannels . cpp ; path = xbmc / utils / PVRChannels . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C48120D8B7F00026B38 / * PVRChannels . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRChannels . h ; path = xbmc / utils / PVRChannels . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C49120D8B7F00026B38 / * PVREpg . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVREpg . cpp ; path = xbmc / utils / PVREpg . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C4A120D8B7F00026B38 / * PVREpg . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVREpg . h ; path = xbmc / utils / PVREpg . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C4B120D8B7F00026B38 / * PVRRecordings . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRRecordings . cpp ; path = xbmc / utils / PVRRecordings . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C4C120D8B7F00026B38 / * PVRRecordings . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRRecordings . h ; path = xbmc / utils / PVRRecordings . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C4D120D8B7F00026B38 / * PVRTimers . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRTimers . cpp ; path = xbmc / utils / PVRTimers . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C4E120D8B7F00026B38 / * PVRTimers . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRTimers . h ; path = xbmc / utils / PVRTimers . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C53120D8BA800026B38 / * GUIDialogPVRChannelManager . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRChannelManager . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C54120D8BA800026B38 / * GUIDialogPVRChannelManager . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRChannelManager . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C55120D8BA800026B38 / * GUIDialogPVRChannelsOSD . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRChannelsOSD . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C56120D8BA800026B38 / * GUIDialogPVRChannelsOSD . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRChannelsOSD . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C57120D8BA800026B38 / * GUIDialogPVRCutterOSD . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRCutterOSD . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C58120D8BA800026B38 / * GUIDialogPVRCutterOSD . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRCutterOSD . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C59120D8BA800026B38 / * GUIDialogPVRDirectorOSD . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRDirectorOSD . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C5A120D8BA800026B38 / * GUIDialogPVRDirectorOSD . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRDirectorOSD . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C5B120D8BA800026B38 / * GUIDialogPVRGroupManager . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRGroupManager . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C5C120D8BA900026B38 / * GUIDialogPVRGroupManager . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRGroupManager . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C5D120D8BA900026B38 / * GUIDialogPVRGuideInfo . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRGuideInfo . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C5E120D8BA900026B38 / * GUIDialogPVRGuideInfo . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRGuideInfo . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C5F120D8BA900026B38 / * GUIDialogPVRGuideOSD . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRGuideOSD . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C60120D8BA900026B38 / * GUIDialogPVRGuideOSD . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRGuideOSD . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C61120D8BA900026B38 / * GUIDialogPVRGuideSearch . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRGuideSearch . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C62120D8BA900026B38 / * GUIDialogPVRGuideSearch . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRGuideSearch . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C63120D8BA900026B38 / * GUIDialogPVRRecordingInfo . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRRecordingInfo . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C64120D8BA900026B38 / * GUIDialogPVRRecordingInfo . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRRecordingInfo . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C65120D8BA900026B38 / * GUIDialogPVRTimerSettings . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRTimerSettings . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C66120D8BA900026B38 / * GUIDialogPVRTimerSettings . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRTimerSettings . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C67120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIDialogPVRUpdateProgressBar . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C68120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIDialogPVRUpdateProgressBar . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C76120D8C0300026B38 / * AddonHelpers_Addon . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = AddonHelpers_Addon . cpp ; path = addons / AddonHelpers_Addon . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C77120D8C0300026B38 / * AddonHelpers_Addon . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonHelpers_Addon . h ; path = addons / AddonHelpers_Addon . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C78120D8C0300026B38 / * AddonHelpers_GUI . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = AddonHelpers_GUI . cpp ; path = addons / AddonHelpers_GUI . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C79120D8C0300026B38 / * AddonHelpers_GUI . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonHelpers_GUI . h ; path = addons / AddonHelpers_GUI . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C7A120D8C0300026B38 / * AddonHelpers_local . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = AddonHelpers_local . cpp ; path = addons / AddonHelpers_local . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C7B120D8C0300026B38 / * AddonHelpers_local . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonHelpers_local . h ; path = addons / AddonHelpers_local . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C7C120D8C0300026B38 / * AddonHelpers_PVR . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = AddonHelpers_PVR . cpp ; path = addons / AddonHelpers_PVR . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C7D120D8C0300026B38 / * AddonHelpers_PVR . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonHelpers_PVR . h ; path = addons / AddonHelpers_PVR . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C82120D8C0F00026B38 / * PVRClient . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRClient . cpp ; path = addons / PVRClient . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C83120D8C1000026B38 / * PVRClient . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRClient . h ; path = addons / PVRClient . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C85120D8C5300026B38 / * TVDatabase . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = TVDatabase . cpp ; path = xbmc / TVDatabase . cpp ; sourceTree = SOURCE_ROOT ; } ; <nl> + 832F2C86120D8C5300026B38 / * TVDatabase . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = TVDatabase . h ; path = xbmc / TVDatabase . h ; sourceTree = SOURCE_ROOT ; } ; <nl> + 832F2C88120D8C9300026B38 / * GUIEPGGridContainer . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIEPGGridContainer . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C89120D8C9300026B38 / * GUIEPGGridContainer . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIEPGGridContainer . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C8B120D8CB400026B38 / * PVRDirectory . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRDirectory . cpp ; path = xbmc / FileSystem / PVRDirectory . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C8C120D8CB500026B38 / * PVRDirectory . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRDirectory . h ; path = xbmc / FileSystem / PVRDirectory . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C8D120D8CB500026B38 / * PVRFile . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = PVRFile . cpp ; path = xbmc / FileSystem / PVRFile . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C8E120D8CB500026B38 / * PVRFile . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = PVRFile . h ; path = xbmc / FileSystem / PVRFile . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C93120D8CF600026B38 / * TextSearch . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = TextSearch . cpp ; path = xbmc / utils / TextSearch . cpp ; sourceTree = SOURCE_ROOT ; } ; <nl> + 832F2C94120D8CF600026B38 / * TextSearch . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = TextSearch . h ; path = xbmc / utils / TextSearch . h ; sourceTree = SOURCE_ROOT ; } ; <nl> + 832F2C96120D8D0B00026B38 / * DVDDemuxPVRClient . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = DVDDemuxPVRClient . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C97120D8D0B00026B38 / * DVDDemuxPVRClient . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = DVDDemuxPVRClient . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C99120D8D3000026B38 / * GUIWindowTV . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIWindowTV . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C9A120D8D3000026B38 / * GUIWindowTV . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIWindowTV . h ; sourceTree = " < group > " ; } ; <nl> + 832F2C9E120D8D5C00026B38 / * DVDInputStreamPVRManager . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = DVDInputStreamPVRManager . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2C9F120D8D5C00026B38 / * DVDInputStreamPVRManager . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = DVDInputStreamPVRManager . h ; sourceTree = " < group > " ; } ; <nl> + 832F2CA1120D8D7600026B38 / * GUIViewStateTV . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; path = GUIViewStateTV . cpp ; sourceTree = " < group > " ; } ; <nl> + 832F2CA2120D8D7600026B38 / * GUIViewStateTV . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = GUIViewStateTV . h ; sourceTree = " < group > " ; } ; <nl> + 83840880116E243C009B5115 / * Addon . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = Addon . h ; path = xbmc / addons / Addon . h ; sourceTree = SOURCE_ROOT ; } ; <nl> + 83840881116E243C009B5115 / * AddonDll . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AddonDll . h ; path = xbmc / addons / AddonDll . h ; sourceTree = SOURCE_ROOT ; } ; <nl> + 8398EE72116F1297001227BB / * DllAddon . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = DllAddon . h ; path = xbmc / addons / DllAddon . h ; sourceTree = SOURCE_ROOT ; } ; <nl> + 8398EE73116F1297001227BB / * DllPVRClient . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = DllPVRClient . h ; path = xbmc / addons / DllPVRClient . h ; sourceTree = SOURCE_ROOT ; } ; <nl> 83A72B8E0FBC8DB000171871 / * CoreAudioRenderer . cpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . cpp ; name = CoreAudioRenderer . cpp ; path = AudioRenderers / CoreAudioRenderer . cpp ; sourceTree = " < group > " ; } ; <nl> 83A72B8F0FBC8DB000171871 / * CoreAudioRenderer . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = CoreAudioRenderer . h ; path = AudioRenderers / CoreAudioRenderer . h ; sourceTree = " < group > " ; } ; <nl> 83A72B900FBC8DB000171871 / * IAudioRenderer . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = IAudioRenderer . h ; path = AudioRenderers / IAudioRenderer . h ; sourceTree = " < group > " ; } ; <nl> <nl> E38E238E0D2626E600618676 / * CoreAudio . framework * / , <nl> E38E238F0D2626E600618676 / * CoreServices . framework * / , <nl> F59879070FBAA0C3008EF4FB / * QuartzCore . framework * / , <nl> + 832F2C47120D8B7F00026B38 / * PVRChannels . cpp * / , <nl> + 832F2C48120D8B7F00026B38 / * PVRChannels . h * / , <nl> + 832F2C8B120D8CB400026B38 / * PVRDirectory . cpp * / , <nl> + 832F2C8C120D8CB500026B38 / * PVRDirectory . h * / , <nl> + 832F2C8D120D8CB500026B38 / * PVRFile . cpp * / , <nl> + 832F2C8E120D8CB500026B38 / * PVRFile . h * / , <nl> + 832F2C49120D8B7F00026B38 / * PVREpg . cpp * / , <nl> + 832F2C4A120D8B7F00026B38 / * PVREpg . h * / , <nl> + 832F2C4B120D8B7F00026B38 / * PVRRecordings . cpp * / , <nl> + 832F2C4C120D8B7F00026B38 / * PVRRecordings . h * / , <nl> + 832F2C4D120D8B7F00026B38 / * PVRTimers . cpp * / , <nl> + 832F2C4E120D8B7F00026B38 / * PVRTimers . h * / , <nl> E38E23900D2626E600618676 / * Foundation . framework * / , <nl> E38E23910D2626E600618676 / * OpenGL . framework * / , <nl> 09AB6884FE841BABC02AAC07 / * CoreFoundation . framework * / , <nl> <nl> 183FDF8811AF0B0500B81E9C / * PluginSource . cpp * / , <nl> 183FDF8911AF0B0500B81E9C / * PluginSource . h * / , <nl> 18B49FF11152BFA5001AF8A6 / * Addon . cpp * / , <nl> - 18B49FF21152BFA5001AF8A6 / * Addon . h * / , <nl> - 18B49FF31152BFA5001AF8A6 / * AddonDll . h * / , <nl> 18B49FF41152BFA5001AF8A6 / * AddonManager . cpp * / , <nl> 18B49FF51152BFA5001AF8A6 / * AddonManager . h * / , <nl> + 832F2C76120D8C0300026B38 / * AddonHelpers_Addon . cpp * / , <nl> + 832F2C77120D8C0300026B38 / * AddonHelpers_Addon . h * / , <nl> + 832F2C78120D8C0300026B38 / * AddonHelpers_GUI . cpp * / , <nl> + 832F2C82120D8C0F00026B38 / * PVRClient . cpp * / , <nl> + 832F2C83120D8C1000026B38 / * PVRClient . h * / , <nl> + 832F2C79120D8C0300026B38 / * AddonHelpers_GUI . h * / , <nl> + 832F2C7A120D8C0300026B38 / * AddonHelpers_local . cpp * / , <nl> + 832F2C7B120D8C0300026B38 / * AddonHelpers_local . h * / , <nl> + 832F2C7C120D8C0300026B38 / * AddonHelpers_PVR . cpp * / , <nl> + 832F2C7D120D8C0300026B38 / * AddonHelpers_PVR . h * / , <nl> F52BFFDA115D5574004B1D66 / * AddonStatusHandler . cpp * / , <nl> F52BFFD9115D5574004B1D66 / * AddonStatusHandler . h * / , <nl> - 18B49FF61152BFA5001AF8A6 / * DllAddon . h * / , <nl> 18B49FF71152BFA5001AF8A6 / * DllScreenSaver . h * / , <nl> 18B49FF81152BFA5001AF8A6 / * DllVisualisation . h * / , <nl> 18B49FF91152BFA5001AF8A6 / * fft . cpp * / , <nl> <nl> 7CD9742711BC6EAA00649E31 / * GUITextureGLES . cpp * / , <nl> 7CD9742811BC6EAA00649E31 / * GUITextureGLES . h * / , <nl> 7C779DA0104A4B2E00F444C4 / * Texture . cpp * / , <nl> + 832F2C93120D8CF600026B38 / * TextSearch . cpp * / , <nl> + 832F2C94120D8CF600026B38 / * TextSearch . h * / , <nl> 7C779DA1104A4B2E00F444C4 / * Texture . h * / , <nl> 7C779DA2104A4B2E00F444C4 / * TextureDX . cpp * / , <nl> 7C779DA3104A4B2E00F444C4 / * TextureDX . h * / , <nl> <nl> E38E13E10D25F9F900618676 / * GUIEditControl . h * / , <nl> E38E13E20D25F9F900618676 / * GUIFadeLabelControl . cpp * / , <nl> E38E13E30D25F9F900618676 / * GUIFadeLabelControl . h * / , <nl> + 832F2C88120D8C9300026B38 / * GUIEPGGridContainer . cpp * / , <nl> + 832F2C89120D8C9300026B38 / * GUIEPGGridContainer . h * / , <nl> 7C779D9B104A4B2E00F444C4 / * GUIImage . cpp * / , <nl> 7C779D9C104A4B2E00F444C4 / * GUIImage . h * / , <nl> E38E13F20D25F9F900618676 / * GUILabelControl . cpp * / , <nl> <nl> F5E55B65107412DE006E788A / * GUIDialogTeletext . cpp * / , <nl> F5E55B64107412DE006E788A / * GUIDialogTeletext . h * / , <nl> E38E17E00D25F9FA00618676 / * GUIDialogVideoBookmarks . cpp * / , <nl> + 832F2C53120D8BA800026B38 / * GUIDialogPVRChannelManager . cpp * / , <nl> + 832F2C54120D8BA800026B38 / * GUIDialogPVRChannelManager . h * / , <nl> + 832F2C55120D8BA800026B38 / * GUIDialogPVRChannelsOSD . cpp * / , <nl> + 832F2C56120D8BA800026B38 / * GUIDialogPVRChannelsOSD . h * / , <nl> + 832F2C57120D8BA800026B38 / * GUIDialogPVRCutterOSD . cpp * / , <nl> + 832F2C58120D8BA800026B38 / * GUIDialogPVRCutterOSD . h * / , <nl> + 832F2C59120D8BA800026B38 / * GUIDialogPVRDirectorOSD . cpp * / , <nl> + 832F2C5A120D8BA800026B38 / * GUIDialogPVRDirectorOSD . h * / , <nl> + 832F2C5B120D8BA800026B38 / * GUIDialogPVRGroupManager . cpp * / , <nl> + 832F2C5C120D8BA900026B38 / * GUIDialogPVRGroupManager . h * / , <nl> + 832F2C5D120D8BA900026B38 / * GUIDialogPVRGuideInfo . cpp * / , <nl> + 832F2C5E120D8BA900026B38 / * GUIDialogPVRGuideInfo . h * / , <nl> + 832F2C5F120D8BA900026B38 / * GUIDialogPVRGuideOSD . cpp * / , <nl> + 832F2C60120D8BA900026B38 / * GUIDialogPVRGuideOSD . h * / , <nl> + 832F2C61120D8BA900026B38 / * GUIDialogPVRGuideSearch . cpp * / , <nl> + 832F2C62120D8BA900026B38 / * GUIDialogPVRGuideSearch . h * / , <nl> + 832F2C63120D8BA900026B38 / * GUIDialogPVRRecordingInfo . cpp * / , <nl> + 832F2C64120D8BA900026B38 / * GUIDialogPVRRecordingInfo . h * / , <nl> + 832F2C65120D8BA900026B38 / * GUIDialogPVRTimerSettings . cpp * / , <nl> + 832F2C66120D8BA900026B38 / * GUIDialogPVRTimerSettings . h * / , <nl> + 832F2C67120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . cpp * / , <nl> + 832F2C68120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . h * / , <nl> E38E17E10D25F9FA00618676 / * GUIDialogVideoBookmarks . h * / , <nl> E38E17E20D25F9FA00618676 / * GUIDialogVideoScan . cpp * / , <nl> E38E17E30D25F9FA00618676 / * GUIDialogVideoScan . h * / , <nl> <nl> E38E17FB0D25F9FA00618676 / * GUIViewStateMusic . cpp * / , <nl> E38E17FC0D25F9FA00618676 / * GUIViewStateMusic . h * / , <nl> E38E17FF0D25F9FA00618676 / * GUIViewStateVideo . cpp * / , <nl> + 832F2CA1120D8D7600026B38 / * GUIViewStateTV . cpp * / , <nl> + 832F2CA2120D8D7600026B38 / * GUIViewStateTV . h * / , <nl> E38E18000D25F9FA00618676 / * GUIViewStateVideo . h * / , <nl> F5A7B433113CBC6A0059D6AA / * GUIWindowAddonBrowser . cpp * / , <nl> F5A7B432113CBC6A0059D6AA / * GUIWindowAddonBrowser . h * / , <nl> <nl> E38E183A0D25F9FA00618676 / * GUIWindowSystemInfo . h * / , <nl> F5F95D9F0E4E203700C3FA5C / * GUIWindowTestPattern . cpp * / , <nl> F5F95D9E0E4E203700C3FA5C / * GUIWindowTestPattern . h * / , <nl> + 832F2C99120D8D3000026B38 / * GUIWindowTV . cpp * / , <nl> + 832F2C9A120D8D3000026B38 / * GUIWindowTV . h * / , <nl> 7C779E50104A58F900F444C4 / * GUIWindowTestPatternGL . cpp * / , <nl> 7C779E51104A58F900F444C4 / * GUIWindowTestPatternGL . h * / , <nl> F50FDC59119B4B2C00C8B8CD / * GUIDialogTextViewer . cpp * / , <nl> <nl> E38E15490D25F9F900618676 / * DVDDemux . cpp * / , <nl> E38E154A0D25F9F900618676 / * DVDDemux . h * / , <nl> E38E154D0D25F9F900618676 / * DVDDemuxShoutcast . cpp * / , <nl> + 832F2C96120D8D0B00026B38 / * DVDDemuxPVRClient . cpp * / , <nl> + 832F2C97120D8D0B00026B38 / * DVDDemuxPVRClient . h * / , <nl> E38E154E0D25F9F900618676 / * DVDDemuxShoutcast . h * / , <nl> E38E154F0D25F9F900618676 / * DVDDemuxUtils . cpp * / , <nl> E38E15500D25F9F900618676 / * DVDDemuxUtils . h * / , <nl> <nl> 815EE6330E17F1DC009FBE3C / * DVDInputStreamRTMP . cpp * / , <nl> 815EE6340E17F1DC009FBE3C / * DVDInputStreamRTMP . h * / , <nl> E33979940D62FD47004ECDDA / * DVDInputStreamTV . cpp * / , <nl> + 832F2C9E120D8D5C00026B38 / * DVDInputStreamPVRManager . cpp * / , <nl> + 832F2C9F120D8D5C00026B38 / * DVDInputStreamPVRManager . h * / , <nl> E33979950D62FD47004ECDDA / * DVDInputStreamTV . h * / , <nl> E38E15580D25F9FA00618676 / * DllDvdNav . h * / , <nl> E38E15590D25F9FA00618676 / * DVDFactoryInputStream . cpp * / , <nl> <nl> E38E15E90D25F9FA00618676 / * CodecFactory . h * / , <nl> E38E15EE0D25F9FA00618676 / * DllAc3codec . h * / , <nl> E38E15EF0D25F9FA00618676 / * DllAdpcm . h * / , <nl> + 8398EE72116F1297001227BB / * DllAddon . h * / , <nl> + 8398EE73116F1297001227BB / * DllPVRClient . h * / , <nl> E38E15F20D25F9FA00618676 / * DllDCACodec . h * / , <nl> E38E15F50D25F9FA00618676 / * DllLibFlac . h * / , <nl> E38E15FA0D25F9FA00618676 / * DllNosefart . h * / , <nl> <nl> 889B4D8D0E0EF86C00FAD25E / * RSSDirectory . h * / , <nl> F5A7B42A113CBB950059D6AA / * AddonsDirectory . h * / , <nl> F5A7B42B113CBB950059D6AA / * AddonsDirectory . cpp * / , <nl> + 83840880116E243C009B5115 / * Addon . h * / , <nl> + 83840881116E243C009B5115 / * AddonDll . h * / , <nl> 88ACB0190DCF40800083CFDF / * ASAPFileDirectory . cpp * / , <nl> 88ACB01A0DCF40800083CFDF / * ASAPFileDirectory . h * / , <nl> 880DBE530DC224A100E26B71 / * MusicFileDirectory . cpp * / , <nl> <nl> E38E17840D25F9FA00618676 / * DirectoryNodeYear . cpp * / , <nl> E38E17850D25F9FA00618676 / * DirectoryNodeYear . h * / , <nl> E38E17880D25F9FA00618676 / * QueryParams . cpp * / , <nl> + 832F2C44120D8B5E00026B38 / * PVRManager . cpp * / , <nl> + 832F2C45120D8B5E00026B38 / * PVRManager . h * / , <nl> E38E17890D25F9FA00618676 / * QueryParams . h * / , <nl> ) ; <nl> path = VideoDatabaseDirectory ; <nl> <nl> 7CCF7FC8106A0DF500992676 / * TimeUtils . h * / , <nl> E38E1E890D25F9FD00618676 / * TuxBoxUtil . cpp * / , <nl> E38E1E8A0D25F9FD00618676 / * TuxBoxUtil . h * / , <nl> + 832F2C85120D8C5300026B38 / * TVDatabase . cpp * / , <nl> + 832F2C86120D8C5300026B38 / * TVDatabase . h * / , <nl> E38E1E8B0D25F9FD00618676 / * UdpClient . cpp * / , <nl> E38E1E8C0D25F9FD00618676 / * UdpClient . h * / , <nl> 7CF1FB09123B1AF000B2CBCB / * Variant . cpp * / , <nl> <nl> F5BDB80C120202F400F0B710 / * DVDSubtitleTagSami . cpp in Sources * / , <nl> F5BDB81A1202032400F0B710 / * DVDSubtitleTagMicroDVD . cpp in Sources * / , <nl> F5BDB820120203C200F0B710 / * AutoPtrHandle . cpp in Sources * / , <nl> + 832F2C46120D8B5E00026B38 / * PVRManager . cpp in Sources * / , <nl> + 832F2C4F120D8B7F00026B38 / * PVRChannels . cpp in Sources * / , <nl> + 832F2C50120D8B7F00026B38 / * PVREpg . cpp in Sources * / , <nl> + 832F2C51120D8B7F00026B38 / * PVRRecordings . cpp in Sources * / , <nl> + 832F2C52120D8B7F00026B38 / * PVRTimers . cpp in Sources * / , <nl> + 832F2C69120D8BA900026B38 / * GUIDialogPVRChannelManager . cpp in Sources * / , <nl> + 832F2C6A120D8BA900026B38 / * GUIDialogPVRChannelsOSD . cpp in Sources * / , <nl> + 832F2C6B120D8BA900026B38 / * GUIDialogPVRCutterOSD . cpp in Sources * / , <nl> + 832F2C6C120D8BA900026B38 / * GUIDialogPVRDirectorOSD . cpp in Sources * / , <nl> + 832F2C6D120D8BA900026B38 / * GUIDialogPVRGroupManager . cpp in Sources * / , <nl> + 832F2C6E120D8BA900026B38 / * GUIDialogPVRGuideInfo . cpp in Sources * / , <nl> + 832F2C6F120D8BA900026B38 / * GUIDialogPVRGuideOSD . cpp in Sources * / , <nl> + 832F2C70120D8BA900026B38 / * GUIDialogPVRGuideSearch . cpp in Sources * / , <nl> + 832F2C71120D8BA900026B38 / * GUIDialogPVRRecordingInfo . cpp in Sources * / , <nl> + 832F2C72120D8BA900026B38 / * GUIDialogPVRTimerSettings . cpp in Sources * / , <nl> + 832F2C73120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . cpp in Sources * / , <nl> + 832F2C7E120D8C0300026B38 / * AddonHelpers_Addon . cpp in Sources * / , <nl> + 832F2C7F120D8C0300026B38 / * AddonHelpers_GUI . cpp in Sources * / , <nl> + 832F2C80120D8C0300026B38 / * AddonHelpers_local . cpp in Sources * / , <nl> + 832F2C81120D8C0300026B38 / * AddonHelpers_PVR . cpp in Sources * / , <nl> + 832F2C84120D8C1000026B38 / * PVRClient . cpp in Sources * / , <nl> + 832F2C87120D8C5300026B38 / * TVDatabase . cpp in Sources * / , <nl> + 832F2C8A120D8C9300026B38 / * GUIEPGGridContainer . cpp in Sources * / , <nl> + 832F2C8F120D8CB500026B38 / * PVRDirectory . cpp in Sources * / , <nl> + 832F2C90120D8CB500026B38 / * PVRFile . cpp in Sources * / , <nl> + 832F2C95120D8CF600026B38 / * TextSearch . cpp in Sources * / , <nl> + 832F2C98120D8D0B00026B38 / * DVDDemuxPVRClient . cpp in Sources * / , <nl> + 832F2C9B120D8D3000026B38 / * GUIWindowTV . cpp in Sources * / , <nl> + 832F2CA0120D8D5C00026B38 / * DVDInputStreamPVRManager . cpp in Sources * / , <nl> + 832F2CA3120D8D7600026B38 / * GUIViewStateTV . cpp in Sources * / , <nl> F5E728A51227112500B152C1 / * URIUtils . cpp in Sources * / , <nl> 7CF1FB0C123B1AF000B2CBCB / * Variant . cpp in Sources * / , <nl> C8D0B2AF1265A9A800F0C0AC / * SystemGlobals . cpp in Sources * / , <nl> + 832F2C46120D8B5E00026B38 / * PVRManager . cpp in Sources * / , <nl> + 832F2C4F120D8B7F00026B38 / * PVRChannels . cpp in Sources * / , <nl> + 832F2C50120D8B7F00026B38 / * PVREpg . cpp in Sources * / , <nl> + 832F2C51120D8B7F00026B38 / * PVRRecordings . cpp in Sources * / , <nl> + 832F2C52120D8B7F00026B38 / * PVRTimers . cpp in Sources * / , <nl> + 832F2C69120D8BA900026B38 / * GUIDialogPVRChannelManager . cpp in Sources * / , <nl> + 832F2C6A120D8BA900026B38 / * GUIDialogPVRChannelsOSD . cpp in Sources * / , <nl> + 832F2C6B120D8BA900026B38 / * GUIDialogPVRCutterOSD . cpp in Sources * / , <nl> + 832F2C6C120D8BA900026B38 / * GUIDialogPVRDirectorOSD . cpp in Sources * / , <nl> + 832F2C6D120D8BA900026B38 / * GUIDialogPVRGroupManager . cpp in Sources * / , <nl> + 832F2C6E120D8BA900026B38 / * GUIDialogPVRGuideInfo . cpp in Sources * / , <nl> + 832F2C6F120D8BA900026B38 / * GUIDialogPVRGuideOSD . cpp in Sources * / , <nl> + 832F2C70120D8BA900026B38 / * GUIDialogPVRGuideSearch . cpp in Sources * / , <nl> + 832F2C71120D8BA900026B38 / * GUIDialogPVRRecordingInfo . cpp in Sources * / , <nl> + 832F2C72120D8BA900026B38 / * GUIDialogPVRTimerSettings . cpp in Sources * / , <nl> + 832F2C73120D8BA900026B38 / * GUIDialogPVRUpdateProgressBar . cpp in Sources * / , <nl> + 832F2C7E120D8C0300026B38 / * AddonHelpers_Addon . cpp in Sources * / , <nl> + 832F2C7F120D8C0300026B38 / * AddonHelpers_GUI . cpp in Sources * / , <nl> + 832F2C80120D8C0300026B38 / * AddonHelpers_local . cpp in Sources * / , <nl> + 832F2C81120D8C0300026B38 / * AddonHelpers_PVR . cpp in Sources * / , <nl> + 832F2C84120D8C1000026B38 / * PVRClient . cpp in Sources * / , <nl> + 832F2C87120D8C5300026B38 / * TVDatabase . cpp in Sources * / , <nl> + 832F2C8A120D8C9300026B38 / * GUIEPGGridContainer . cpp in Sources * / , <nl> + 832F2C8F120D8CB500026B38 / * PVRDirectory . cpp in Sources * / , <nl> + 832F2C90120D8CB500026B38 / * PVRFile . cpp in Sources * / , <nl> + 832F2C95120D8CF600026B38 / * TextSearch . cpp in Sources * / , <nl> + 832F2C98120D8D0B00026B38 / * DVDDemuxPVRClient . cpp in Sources * / , <nl> + 832F2C9B120D8D3000026B38 / * GUIWindowTV . cpp in Sources * / , <nl> + 832F2CA0120D8D5C00026B38 / * DVDInputStreamPVRManager . cpp in Sources * / , <nl> + 832F2CA3120D8D7600026B38 / * GUIViewStateTV . cpp in Sources * / , <nl> 7CBEBB8412912BA400431822 / * fstrcmp . c in Sources * / , <nl> 184C472F1296BC6E0006DB3E / * Service . cpp in Sources * / , <nl> ) ; <nl> <nl> 1DEB924808733DCA0010E9CD / * Debug * / = { <nl> isa = XCBuildConfiguration ; <nl> buildSettings = { <nl> - COPY_PHASE_STRIP = NO ; <nl> + COPY_PHASE_STRIP = YES ; <nl> DEAD_CODE_STRIPPING = NO ; <nl> FRAMEWORK_SEARCH_PATHS = " $ ( inherited ) " ; <nl> GCC_AUTO_VECTORIZATION = YES ; <nl> <nl> 1DEB924908733DCA0010E9CD / * Release * / = { <nl> isa = XCBuildConfiguration ; <nl> buildSettings = { <nl> - COPY_PHASE_STRIP = NO ; <nl> + COPY_PHASE_STRIP = YES ; <nl> DEAD_CODE_STRIPPING = NO ; <nl> DEBUG_INFORMATION_FORMAT = " dwarf - with - dsym " ; <nl> FRAMEWORK_SEARCH_PATHS = " $ ( inherited ) " ; <nl>
|
sync xcode project after merge
|
xbmc/xbmc
|
f8e4da90ee5b1dca3ef46071bbb0aae73d1d94ea
|
2011-01-04T11:37:38Z
|
mmm a / modules / stitching / include / opencv2 / stitching / detail / matchers . hpp <nl> ppp b / modules / stitching / include / opencv2 / stitching / detail / matchers . hpp <nl> class CV_EXPORTS FeaturesMatcher <nl> <nl> void operator ( ) ( const ImageFeatures & features1 , const ImageFeatures & features2 , <nl> MatchesInfo & matches_info ) { match ( features1 , features2 , matches_info ) ; } <nl> - void operator ( ) ( const std : : vector < ImageFeatures > & features , std : : vector < MatchesInfo > & pairwise_matches ) ; <nl> + <nl> + void operator ( ) ( const std : : vector < ImageFeatures > & features , std : : vector < MatchesInfo > & pairwise_matches , <nl> + const cv : : Mat & mask = cv : : Mat ( ) ) ; <nl> <nl> bool isThreadSafe ( ) const { return is_thread_safe_ ; } <nl> <nl> mmm a / modules / stitching / include / opencv2 / stitching / stitcher . hpp <nl> ppp b / modules / stitching / include / opencv2 / stitching / stitcher . hpp <nl> class CV_EXPORTS Stitcher <nl> void setFeaturesMatcher ( Ptr < detail : : FeaturesMatcher > features_matcher ) <nl> { features_matcher_ = features_matcher ; } <nl> <nl> + const cv : : Mat & matchingMask ( ) const { return matching_mask_ ; } <nl> + void setMatchingMask ( const cv : : Mat & mask ) <nl> + { <nl> + CV_Assert ( mask . type ( ) = = CV_8U & & mask . cols = = mask . rows ) ; <nl> + matching_mask_ = mask . clone ( ) ; <nl> + } <nl> + <nl> Ptr < detail : : BundleAdjusterBase > bundleAdjuster ( ) { return bundle_adjuster_ ; } <nl> const Ptr < detail : : BundleAdjusterBase > bundleAdjuster ( ) const { return bundle_adjuster_ ; } <nl> void setBundleAdjuster ( Ptr < detail : : BundleAdjusterBase > bundle_adjuster ) <nl> class CV_EXPORTS Stitcher <nl> double conf_thresh_ ; <nl> Ptr < detail : : FeaturesFinder > features_finder_ ; <nl> Ptr < detail : : FeaturesMatcher > features_matcher_ ; <nl> + cv : : Mat matching_mask_ ; <nl> Ptr < detail : : BundleAdjusterBase > bundle_adjuster_ ; <nl> bool do_wave_correct_ ; <nl> detail : : WaveCorrectKind wave_correct_kind_ ; <nl> mmm a / modules / stitching / src / matchers . cpp <nl> ppp b / modules / stitching / src / matchers . cpp <nl> <nl> using namespace std ; <nl> using namespace cv ; <nl> using namespace cv : : detail ; <nl> + <nl> # ifndef ANDROID <nl> using namespace cv : : gpu ; <nl> # endif <nl> const MatchesInfo & MatchesInfo : : operator = ( const MatchesInfo & other ) <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - void FeaturesMatcher : : operator ( ) ( const vector < ImageFeatures > & features , vector < MatchesInfo > & pairwise_matches ) <nl> + void FeaturesMatcher : : operator ( ) ( const vector < ImageFeatures > & features , vector < MatchesInfo > & pairwise_matches , <nl> + const Mat & mask ) <nl> { <nl> const int num_images = static_cast < int > ( features . size ( ) ) ; <nl> <nl> + CV_Assert ( mask . empty ( ) | | ( mask . type ( ) = = CV_8U & & mask . cols = = num_images & & mask . rows ) ) ; <nl> + Mat_ < uchar > mask_ ( mask ) ; <nl> + if ( mask_ . empty ( ) ) <nl> + mask_ = Mat : : ones ( num_images , num_images , CV_8U ) ; <nl> + <nl> vector < pair < int , int > > near_pairs ; <nl> for ( int i = 0 ; i < num_images - 1 ; + + i ) <nl> for ( int j = i + 1 ; j < num_images ; + + j ) <nl> - if ( features [ i ] . keypoints . size ( ) > 0 & & features [ j ] . keypoints . size ( ) > 0 ) <nl> + if ( features [ i ] . keypoints . size ( ) > 0 & & features [ j ] . keypoints . size ( ) > 0 & & mask_ ( i , j ) ) <nl> near_pairs . push_back ( make_pair ( i , j ) ) ; <nl> <nl> pairwise_matches . resize ( num_images * num_images ) ; <nl> mmm a / modules / stitching / src / stitcher . cpp <nl> ppp b / modules / stitching / src / stitcher . cpp <nl> Stitcher : : Status Stitcher : : matchImages ( ) <nl> <nl> LOG ( " Pairwise matching " ) ; <nl> t = getTickCount ( ) ; <nl> - ( * features_matcher_ ) ( features_ , pairwise_matches_ ) ; <nl> + ( * features_matcher_ ) ( features_ , pairwise_matches_ , matching_mask_ ) ; <nl> features_matcher_ - > collectGarbage ( ) ; <nl> LOGLN ( " Pairwise matching , time : " < < ( ( getTickCount ( ) - t ) / getTickFrequency ( ) ) < < " sec " ) ; <nl> <nl>
|
Added matching mask into pairwise matcher from stitching module
|
opencv/opencv
|
b053a3b48679b8ff9362bedc1e6a3b576055cb68
|
2011-09-26T09:24:45Z
|
mmm a / dbms / cmake / version . cmake <nl> ppp b / dbms / cmake / version . cmake <nl> <nl> # This strings autochanged from release_lib . sh : <nl> - set ( VERSION_DESCRIBE v1 . 1 . 54269 - testing ) <nl> - set ( VERSION_REVISION 54269 ) <nl> + set ( VERSION_DESCRIBE v1 . 1 . 54270 - testing ) <nl> + set ( VERSION_REVISION 54270 ) <nl> # end of autochange <nl> <nl> set ( VERSION_MAJOR 1 ) <nl>
|
Auto version update to [ 54270 ]
|
ClickHouse/ClickHouse
|
11adefa2c0aa9c71ab8e8dcb10ab8417165722ac
|
2017-08-14T01:04:51Z
|
mmm a / include / v8 - internal . h <nl> ppp b / include / v8 - internal . h <nl> class Internals { <nl> <nl> static const int kFirstNonstringType = 0x40 ; <nl> static const int kOddballType = 0x43 ; <nl> - static const int kForeignType = 0x47 ; <nl> + static const int kForeignType = 0x46 ; <nl> static const int kJSSpecialApiObjectType = 0x410 ; <nl> static const int kJSApiObjectType = 0x420 ; <nl> static const int kJSObjectType = 0x421 ; <nl> mmm a / src / builtins / builtins - constructor - gen . cc <nl> ppp b / src / builtins / builtins - constructor - gen . cc <nl> Node * ConstructorBuiltinsAssembler : : EmitCreateShallowObjectLiteral ( <nl> / / Copy over in - object properties . <nl> Label continue_with_write_barrier ( this ) , done_init ( this ) ; <nl> TVARIABLE ( IntPtrT , offset , IntPtrConstant ( JSObject : : kHeaderSize ) ) ; <nl> - / / Mutable heap numbers only occur on 32 - bit platforms . <nl> + / / Heap numbers are only mutable on 32 - bit platforms . <nl> bool may_use_mutable_heap_numbers = ! FLAG_unbox_double_fields ; <nl> { <nl> Comment ( " Copy in - object properties fast " ) ; <nl> Node * ConstructorBuiltinsAssembler : : EmitCreateShallowObjectLiteral ( <nl> TNode < Object > field = LoadObjectField ( boilerplate , offset . value ( ) ) ; <nl> Label store_field ( this ) ; <nl> GotoIf ( TaggedIsSmi ( field ) , & store_field ) ; <nl> - GotoIf ( IsMutableHeapNumber ( CAST ( field ) ) , & continue_with_write_barrier ) ; <nl> + / / TODO ( leszeks ) : Read the field descriptor to decide if this heap <nl> + / / number is mutable or not . <nl> + GotoIf ( IsHeapNumber ( CAST ( field ) ) , & continue_with_write_barrier ) ; <nl> Goto ( & store_field ) ; <nl> BIND ( & store_field ) ; <nl> StoreObjectFieldNoWriteBarrier ( copy , offset . value ( ) , field ) ; <nl> Node * ConstructorBuiltinsAssembler : : EmitCreateShallowObjectLiteral ( <nl> offset . value ( ) , instance_size , <nl> [ = ] ( Node * offset ) { <nl> Node * field = LoadObjectField ( copy , offset ) ; <nl> - Label copy_mutable_heap_number ( this , Label : : kDeferred ) , <nl> - continue_loop ( this ) ; <nl> + Label copy_heap_number ( this , Label : : kDeferred ) , continue_loop ( this ) ; <nl> / / We only have to clone complex field values . <nl> GotoIf ( TaggedIsSmi ( field ) , & continue_loop ) ; <nl> - Branch ( IsMutableHeapNumber ( field ) , & copy_mutable_heap_number , <nl> - & continue_loop ) ; <nl> - BIND ( & copy_mutable_heap_number ) ; <nl> + / / TODO ( leszeks ) : Read the field descriptor to decide if this heap <nl> + / / number is mutable or not . <nl> + Branch ( IsHeapNumber ( field ) , & copy_heap_number , & continue_loop ) ; <nl> + BIND ( & copy_heap_number ) ; <nl> { <nl> Node * double_value = LoadHeapNumberValue ( field ) ; <nl> - Node * mutable_heap_number = <nl> - AllocateMutableHeapNumberWithValue ( double_value ) ; <nl> - StoreObjectField ( copy , offset , mutable_heap_number ) ; <nl> + Node * heap_number = AllocateHeapNumberWithValue ( double_value ) ; <nl> + StoreObjectField ( copy , offset , heap_number ) ; <nl> Goto ( & continue_loop ) ; <nl> } <nl> BIND ( & continue_loop ) ; <nl> mmm a / src / codegen / code - stub - assembler . cc <nl> ppp b / src / codegen / code - stub - assembler . cc <nl> void CodeStubAssembler : : StoreHeapNumberValue ( SloppyTNode < HeapNumber > object , <nl> MachineRepresentation : : kFloat64 ) ; <nl> } <nl> <nl> - void CodeStubAssembler : : StoreMutableHeapNumberValue ( <nl> - SloppyTNode < MutableHeapNumber > object , SloppyTNode < Float64T > value ) { <nl> - StoreObjectFieldNoWriteBarrier ( object , MutableHeapNumber : : kValueOffset , value , <nl> - MachineRepresentation : : kFloat64 ) ; <nl> - } <nl> - <nl> void CodeStubAssembler : : StoreObjectField ( Node * object , int offset , <nl> Node * value ) { <nl> DCHECK_NE ( HeapObject : : kMapOffset , offset ) ; / / Use StoreMap instead . <nl> TNode < HeapNumber > CodeStubAssembler : : AllocateHeapNumberWithValue ( <nl> return result ; <nl> } <nl> <nl> - TNode < MutableHeapNumber > CodeStubAssembler : : AllocateMutableHeapNumber ( ) { <nl> - Node * result = Allocate ( MutableHeapNumber : : kSize , kNone ) ; <nl> - RootIndex heap_map_index = RootIndex : : kMutableHeapNumberMap ; <nl> - StoreMapNoWriteBarrier ( result , heap_map_index ) ; <nl> - return UncheckedCast < MutableHeapNumber > ( result ) ; <nl> - } <nl> - <nl> TNode < Object > CodeStubAssembler : : CloneIfMutablePrimitive ( TNode < Object > object ) { <nl> TVARIABLE ( Object , result , object ) ; <nl> Label done ( this ) ; <nl> <nl> GotoIf ( TaggedIsSmi ( object ) , & done ) ; <nl> - GotoIfNot ( IsMutableHeapNumber ( UncheckedCast < HeapObject > ( object ) ) , & done ) ; <nl> + / / TODO ( leszeks ) : Read the field descriptor to decide if this heap number is <nl> + / / mutable or not . <nl> + GotoIfNot ( IsHeapNumber ( UncheckedCast < HeapObject > ( object ) ) , & done ) ; <nl> { <nl> / / Mutable heap number found mmm allocate a clone . <nl> TNode < Float64T > value = <nl> LoadHeapNumberValue ( UncheckedCast < HeapNumber > ( object ) ) ; <nl> - result = AllocateMutableHeapNumberWithValue ( value ) ; <nl> + result = AllocateHeapNumberWithValue ( value ) ; <nl> Goto ( & done ) ; <nl> } <nl> <nl> TNode < Object > CodeStubAssembler : : CloneIfMutablePrimitive ( TNode < Object > object ) { <nl> return result . value ( ) ; <nl> } <nl> <nl> - TNode < MutableHeapNumber > CodeStubAssembler : : AllocateMutableHeapNumberWithValue ( <nl> - SloppyTNode < Float64T > value ) { <nl> - TNode < MutableHeapNumber > result = AllocateMutableHeapNumber ( ) ; <nl> - StoreMutableHeapNumberValue ( result , value ) ; <nl> - return result ; <nl> - } <nl> - <nl> TNode < BigInt > CodeStubAssembler : : AllocateBigInt ( TNode < IntPtrT > length ) { <nl> TNode < BigInt > result = AllocateRawBigInt ( length ) ; <nl> StoreBigIntBitfield ( result , <nl> void CodeStubAssembler : : CopyPropertyArrayValues ( Node * from_array , <nl> bool needs_write_barrier = barrier_mode = = UPDATE_WRITE_BARRIER ; <nl> <nl> if ( destroy_source = = DestroySource : : kNo ) { <nl> - / / PropertyArray may contain MutableHeapNumbers , which will be cloned on the <nl> - / / heap , requiring a write barrier . <nl> + / / PropertyArray may contain mutable HeapNumbers , which will be cloned on <nl> + / / the heap , requiring a write barrier . <nl> needs_write_barrier = true ; <nl> } <nl> <nl> TNode < BoolT > CodeStubAssembler : : IsAllocationSite ( <nl> return IsAllocationSiteInstanceType ( LoadInstanceType ( object ) ) ; <nl> } <nl> <nl> - TNode < BoolT > CodeStubAssembler : : IsAnyHeapNumber ( <nl> - SloppyTNode < HeapObject > object ) { <nl> - return UncheckedCast < BoolT > ( <nl> - Word32Or ( IsMutableHeapNumber ( object ) , IsHeapNumber ( object ) ) ) ; <nl> - } <nl> - <nl> TNode < BoolT > CodeStubAssembler : : IsHeapNumber ( SloppyTNode < HeapObject > object ) { <nl> return IsHeapNumberMap ( LoadMap ( object ) ) ; <nl> } <nl> TNode < BoolT > CodeStubAssembler : : IsOddballInstanceType ( <nl> return InstanceTypeEqual ( instance_type , ODDBALL_TYPE ) ; <nl> } <nl> <nl> - TNode < BoolT > CodeStubAssembler : : IsMutableHeapNumber ( <nl> - SloppyTNode < HeapObject > object ) { <nl> - return IsMutableHeapNumberMap ( LoadMap ( object ) ) ; <nl> - } <nl> - <nl> TNode < BoolT > CodeStubAssembler : : IsFeedbackCell ( SloppyTNode < HeapObject > object ) { <nl> return HasInstanceType ( object , FEEDBACK_CELL_TYPE ) ; <nl> } <nl> void CodeStubAssembler : : LoadPropertyFromFastObject ( <nl> var_double_value . Bind ( <nl> LoadObjectField ( object , field_offset , MachineType : : Float64 ( ) ) ) ; <nl> } else { <nl> - Node * mutable_heap_number = LoadObjectField ( object , field_offset ) ; <nl> - var_double_value . Bind ( LoadHeapNumberValue ( mutable_heap_number ) ) ; <nl> + Node * heap_number = LoadObjectField ( object , field_offset ) ; <nl> + var_double_value . Bind ( LoadHeapNumberValue ( heap_number ) ) ; <nl> } <nl> Goto ( & rebox_double ) ; <nl> } <nl> mmm a / src / codegen / code - stub - assembler . h <nl> ppp b / src / codegen / code - stub - assembler . h <nl> enum class PrimitiveType { kBoolean , kNumber , kString , kSymbol } ; <nl> V ( ManyClosuresCellMap , many_closures_cell_map , ManyClosuresCellMap ) \ <nl> V ( MetaMap , meta_map , MetaMap ) \ <nl> V ( MinusZeroValue , minus_zero_value , MinusZero ) \ <nl> - V ( MutableHeapNumberMap , mutable_heap_number_map , MutableHeapNumberMap ) \ <nl> V ( NanValue , nan_value , Nan ) \ <nl> V ( NoClosuresCellMap , no_closures_cell_map , NoClosuresCellMap ) \ <nl> V ( NullValue , null_value , Null ) \ <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> / / Store the floating point value of a HeapNumber . <nl> void StoreHeapNumberValue ( SloppyTNode < HeapNumber > object , <nl> SloppyTNode < Float64T > value ) ; <nl> - void StoreMutableHeapNumberValue ( SloppyTNode < MutableHeapNumber > object , <nl> - SloppyTNode < Float64T > value ) ; <nl> / / Store a field to an object on the heap . <nl> void StoreObjectField ( Node * object , int offset , Node * value ) ; <nl> void StoreObjectField ( Node * object , Node * offset , Node * value ) ; <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> return AllocateHeapNumberWithValue ( Float64Constant ( value ) ) ; <nl> } <nl> <nl> - / / Allocate a MutableHeapNumber with a specific value . <nl> - TNode < MutableHeapNumber > AllocateMutableHeapNumberWithValue ( <nl> - SloppyTNode < Float64T > value ) ; <nl> - <nl> / / Allocate a BigInt with { length } digits . Sets the sign bit to { false } . <nl> / / Does not initialize the digits . <nl> TNode < BigInt > AllocateBigInt ( TNode < IntPtrT > length ) ; <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> / / array word by word . The source may be destroyed at the end of this macro . <nl> / / <nl> / / Otherwise , specify DestroySource : : kNo for operations where an Object is <nl> - / / being cloned , to ensure that MutableHeapNumbers are unique between the <nl> + / / being cloned , to ensure that mutable HeapNumbers are unique between the <nl> / / source and cloned object . <nl> void CopyPropertyArrayValues ( Node * from_array , Node * to_array , Node * length , <nl> WriteBarrierMode barrier_mode , <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> TNode < BoolT > IsAccessorInfo ( SloppyTNode < HeapObject > object ) ; <nl> TNode < BoolT > IsAccessorPair ( SloppyTNode < HeapObject > object ) ; <nl> TNode < BoolT > IsAllocationSite ( SloppyTNode < HeapObject > object ) ; <nl> - TNode < BoolT > IsAnyHeapNumber ( SloppyTNode < HeapObject > object ) ; <nl> TNode < BoolT > IsNoElementsProtectorCellInvalid ( ) ; <nl> TNode < BoolT > IsArrayIteratorProtectorCellInvalid ( ) ; <nl> TNode < BoolT > IsBigIntInstanceType ( SloppyTNode < Int32T > instance_type ) ; <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> TNode < BoolT > IsJSPrimitiveWrapperMap ( SloppyTNode < Map > map ) ; <nl> TNode < BoolT > IsJSPrimitiveWrapper ( SloppyTNode < HeapObject > object ) ; <nl> TNode < BoolT > IsMap ( SloppyTNode < HeapObject > object ) ; <nl> - TNode < BoolT > IsMutableHeapNumber ( SloppyTNode < HeapObject > object ) ; <nl> TNode < BoolT > IsName ( SloppyTNode < HeapObject > object ) ; <nl> TNode < BoolT > IsNameInstanceType ( SloppyTNode < Int32T > instance_type ) ; <nl> TNode < BoolT > IsNativeContext ( SloppyTNode < HeapObject > object ) ; <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> <nl> TNode < JSArray > ArrayCreate ( TNode < Context > context , TNode < Number > length ) ; <nl> <nl> - / / Allocate a clone of a mutable primitive , if { object } is a <nl> - / / MutableHeapNumber . <nl> + / / Allocate a clone of a mutable primitive , if { object } is a mutable <nl> + / / HeapNumber . <nl> TNode < Object > CloneIfMutablePrimitive ( TNode < Object > object ) ; <nl> <nl> private : <nl> class V8_EXPORT_PRIVATE CodeStubAssembler <nl> TNode < Uint32T > length , <nl> TNode < String > parent , TNode < Smi > offset ) ; <nl> <nl> - / / Allocate a MutableHeapNumber without initializing its value . <nl> - TNode < MutableHeapNumber > AllocateMutableHeapNumber ( ) ; <nl> - <nl> Node * SelectImpl ( TNode < BoolT > condition , const NodeGenerator & true_body , <nl> const NodeGenerator & false_body , MachineRepresentation rep ) ; <nl> <nl> mmm a / src / compiler / code - assembler . h <nl> ppp b / src / compiler / code - assembler . h <nl> class CompilationCacheTable ; <nl> class Constructor ; <nl> class Filler ; <nl> class FunctionTemplateRareData ; <nl> + class HeapNumber ; <nl> class InternalizedString ; <nl> class JSArgumentsObject ; <nl> class JSArrayBufferView ; <nl> class JSContextExtensionObject ; <nl> class JSError ; <nl> class JSSloppyArgumentsObject ; <nl> class MapCache ; <nl> - class MutableHeapNumber ; <nl> class NativeContext ; <nl> class NumberWrapper ; <nl> class ScriptWrapper ; <nl> mmm a / src / compiler / effect - control - linearizer . cc <nl> ppp b / src / compiler / effect - control - linearizer . cc <nl> Node * EffectControlLinearizer : : LowerLoadFieldByIndex ( Node * node ) { <nl> } <nl> <nl> / / The field is a Double field , either unboxed in the object on 64 - bit <nl> - / / architectures , or as MutableHeapNumber . <nl> + / / architectures , or a mutable HeapNumber . <nl> __ Bind ( & if_double ) ; <nl> { <nl> auto done_double = __ MakeLabel ( MachineRepresentation : : kFloat64 ) ; <nl> mmm a / src / compiler / heap - refs . h <nl> ppp b / src / compiler / heap - refs . h <nl> enum class OddballType : uint8_t { <nl> V ( HeapNumber ) \ <nl> V ( JSReceiver ) \ <nl> V ( Map ) \ <nl> - V ( MutableHeapNumber ) \ <nl> V ( Name ) \ <nl> V ( ObjectBoilerplateDescription ) \ <nl> V ( PropertyCell ) \ <nl> class HeapNumberRef : public HeapObjectRef { <nl> double value ( ) const ; <nl> } ; <nl> <nl> - class MutableHeapNumberRef : public HeapObjectRef { <nl> - public : <nl> - DEFINE_REF_CONSTRUCTOR ( MutableHeapNumber , HeapObjectRef ) <nl> - <nl> - Handle < MutableHeapNumber > object ( ) const ; <nl> - <nl> - double value ( ) const ; <nl> - } ; <nl> - <nl> class ContextRef : public HeapObjectRef { <nl> public : <nl> DEFINE_REF_CONSTRUCTOR ( Context , HeapObjectRef ) <nl> mmm a / src / compiler / js - create - lowering . cc <nl> ppp b / src / compiler / js - create - lowering . cc <nl> Node * JSCreateLowering : : AllocateFastLiteral ( Node * effect , Node * control , <nl> value = effect = AllocateFastLiteral ( effect , control , <nl> boilerplate_object , allocation ) ; <nl> } else if ( property_details . representation ( ) . IsDouble ( ) ) { <nl> - double number = boilerplate_value . AsMutableHeapNumber ( ) . value ( ) ; <nl> + double number = boilerplate_value . AsHeapNumber ( ) . value ( ) ; <nl> / / Allocate a mutable HeapNumber box and store the value into it . <nl> AllocationBuilder builder ( jsgraph ( ) , effect , control ) ; <nl> builder . Allocate ( HeapNumber : : kSize , allocation ) ; <nl> - builder . Store ( AccessBuilder : : ForMap ( ) , <nl> - factory ( ) - > mutable_heap_number_map ( ) ) ; <nl> + builder . Store ( AccessBuilder : : ForMap ( ) , factory ( ) - > heap_number_map ( ) ) ; <nl> builder . Store ( AccessBuilder : : ForHeapNumberValue ( ) , <nl> jsgraph ( ) - > Constant ( number ) ) ; <nl> value = effect = builder . Finish ( ) ; <nl> mmm a / src / compiler / js - heap - broker . cc <nl> ppp b / src / compiler / js - heap - broker . cc <nl> class HeapNumberData : public HeapObjectData { <nl> double const value_ ; <nl> } ; <nl> <nl> - class MutableHeapNumberData : public HeapObjectData { <nl> - public : <nl> - MutableHeapNumberData ( JSHeapBroker * broker , ObjectData * * storage , <nl> - Handle < MutableHeapNumber > object ) <nl> - : HeapObjectData ( broker , storage , object ) , value_ ( object - > value ( ) ) { } <nl> - <nl> - double value ( ) const { return value_ ; } <nl> - <nl> - private : <nl> - double const value_ ; <nl> - } ; <nl> - <nl> class ContextData : public HeapObjectData { <nl> public : <nl> ContextData ( JSHeapBroker * broker , ObjectData * * storage , <nl> void JSObjectData : : SerializeRecursiveAsBoilerplate ( JSHeapBroker * broker , <nl> } else { <nl> Handle < Object > value ( boilerplate - > RawFastPropertyAt ( field_index ) , <nl> isolate ) ; <nl> - / / In case of unboxed double fields we use a sentinel NaN value to mark <nl> + / / In case of double fields we use a sentinel NaN value to mark <nl> / / uninitialized fields . A boilerplate value with such a field may migrate <nl> - / / from its unboxed double to a tagged representation . In the process the <nl> - / / raw double is converted to a heap number . The sentinel value carries no <nl> - / / special meaning when it occurs in a heap number , so we would like to <nl> - / / recover the uninitialized value . <nl> - / / We check for the sentinel here , specifically , since migrations might <nl> - / / have been triggered as part of boilerplate serialization . <nl> - if ( value - > IsHeapNumber ( ) & & <nl> + / / from its double to a tagged representation . If the double is unboxed , <nl> + / / the raw double is converted to a heap number , otherwise the ( boxed ) <nl> + / / double ceases to be mutable , and becomes a normal heap number . The <nl> + / / sentinel value carries no special meaning when it occurs in a heap <nl> + / / number , so we would like to recover the uninitialized value . We check <nl> + / / for the sentinel here , specifically , since migrations might have been <nl> + / / triggered as part of boilerplate serialization . <nl> + if ( ! details . representation ( ) . IsDouble ( ) & & value - > IsHeapNumber ( ) & & <nl> HeapNumber : : cast ( * value ) . value_as_bits ( ) = = kHoleNanInt64 ) { <nl> value = isolate - > factory ( ) - > uninitialized_value ( ) ; <nl> } <nl> void JSHeapBroker : : SerializeStandardObjects ( ) { <nl> GetOrCreateData ( f - > length_string ( ) ) ; <nl> GetOrCreateData ( f - > many_closures_cell_map ( ) ) ; <nl> GetOrCreateData ( f - > minus_zero_value ( ) ) ; <nl> - GetOrCreateData ( f - > mutable_heap_number_map ( ) ) ; <nl> GetOrCreateData ( f - > name_dictionary_map ( ) ) ; <nl> GetOrCreateData ( f - > NaN_string ( ) ) ; <nl> GetOrCreateData ( f - > null_map ( ) ) ; <nl> double HeapNumberRef : : value ( ) const { <nl> return data ( ) - > AsHeapNumber ( ) - > value ( ) ; <nl> } <nl> <nl> - double MutableHeapNumberRef : : value ( ) const { <nl> - IF_BROKER_DISABLED_ACCESS_HANDLE_C ( MutableHeapNumber , value ) ; <nl> - return data ( ) - > AsMutableHeapNumber ( ) - > value ( ) ; <nl> - } <nl> - <nl> uint64_t BigIntRef : : AsUint64 ( ) const { <nl> IF_BROKER_DISABLED_ACCESS_HANDLE_C ( BigInt , AsUint64 ) ; <nl> return data ( ) - > AsBigInt ( ) - > AsUint64 ( ) ; <nl> mmm a / src / compiler / js - native - context - specialization . cc <nl> ppp b / src / compiler / js - native - context - specialization . cc <nl> JSNativeContextSpecialization : : BuildPropertyStore ( <nl> effect , control ) ; <nl> if ( ! field_index . is_inobject ( ) | | ! FLAG_unbox_double_fields ) { <nl> if ( access_info . HasTransitionMap ( ) ) { <nl> - / / Allocate a MutableHeapNumber for the new property . <nl> + / / Allocate a HeapNumber for the new property . <nl> AllocationBuilder a ( jsgraph ( ) , effect , control ) ; <nl> a . Allocate ( HeapNumber : : kSize , AllocationType : : kYoung , <nl> Type : : OtherInternal ( ) ) ; <nl> - a . Store ( AccessBuilder : : ForMap ( ) , <nl> - factory ( ) - > mutable_heap_number_map ( ) ) ; <nl> + a . Store ( AccessBuilder : : ForMap ( ) , factory ( ) - > heap_number_map ( ) ) ; <nl> FieldAccess value_field_access = <nl> AccessBuilder : : ForHeapNumberValue ( ) ; <nl> value_field_access . const_field_info = field_access . const_field_info ; <nl> JSNativeContextSpecialization : : BuildPropertyStore ( <nl> MachineType : : TypeCompressedTaggedPointer ( ) ; <nl> field_access . write_barrier_kind = kPointerWriteBarrier ; <nl> } else { <nl> - / / We just store directly to the MutableHeapNumber . <nl> + / / We just store directly to the HeapNumber . <nl> FieldAccess const storage_access = { <nl> kTaggedBase , <nl> field_index . offset ( ) , <nl> mmm a / src / compiler / types . cc <nl> ppp b / src / compiler / types . cc <nl> Type : : bitset BitsetType : : Lub ( const MapRefLike & map ) { <nl> <nl> / / Remaining instance types are unsupported for now . If any of them do <nl> / / require bit set types , they should get kOtherInternal . <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> case FREE_SPACE_TYPE : <nl> case FILLER_TYPE : <nl> case ACCESS_CHECK_INFO_TYPE : <nl> mmm a / src / deoptimizer / deoptimizer . cc <nl> ppp b / src / deoptimizer / deoptimizer . cc <nl> void TranslatedState : : InitializeCapturedObjectAt ( <nl> <nl> / / Handle the special cases . <nl> switch ( map - > instance_type ( ) ) { <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> + case HEAP_NUMBER_TYPE : <nl> case FIXED_DOUBLE_ARRAY_TYPE : <nl> return ; <nl> <nl> void TranslatedState : : MaterializeFixedDoubleArray ( TranslatedFrame * frame , <nl> slot - > set_storage ( array ) ; <nl> } <nl> <nl> - void TranslatedState : : MaterializeMutableHeapNumber ( TranslatedFrame * frame , <nl> - int * value_index , <nl> - TranslatedValue * slot ) { <nl> + void TranslatedState : : MaterializeHeapNumber ( TranslatedFrame * frame , <nl> + int * value_index , <nl> + TranslatedValue * slot ) { <nl> CHECK_NE ( TranslatedValue : : kCapturedObject , <nl> frame - > values_ [ * value_index ] . kind ( ) ) ; <nl> Handle < Object > value = frame - > values_ [ * value_index ] . GetValue ( ) ; <nl> CHECK ( value - > IsNumber ( ) ) ; <nl> - Handle < MutableHeapNumber > box = <nl> - isolate ( ) - > factory ( ) - > NewMutableHeapNumber ( value - > Number ( ) ) ; <nl> + Handle < HeapNumber > box = isolate ( ) - > factory ( ) - > NewHeapNumber ( value - > Number ( ) ) ; <nl> ( * value_index ) + + ; <nl> slot - > set_storage ( box ) ; <nl> } <nl> void TranslatedState : : EnsureCapturedObjectAllocatedAt ( <nl> / / there is no need to process the children . <nl> return MaterializeFixedDoubleArray ( frame , & value_index , slot , map ) ; <nl> <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> + case HEAP_NUMBER_TYPE : <nl> / / Materialize ( i . e . allocate & initialize ) the heap number and return . <nl> / / There is no need to process the children . <nl> - return MaterializeMutableHeapNumber ( frame , & value_index , slot ) ; <nl> + return MaterializeHeapNumber ( frame , & value_index , slot ) ; <nl> <nl> case FIXED_ARRAY_TYPE : <nl> case SCRIPT_CONTEXT_TABLE_TYPE : <nl> void TranslatedState : : InitializeJSObjectAt ( <nl> } <nl> object_storage - > WriteField < double > ( offset , double_field_value ) ; <nl> } else if ( marker = = kStoreMutableHeapNumber ) { <nl> - CHECK ( field_value - > IsMutableHeapNumber ( ) ) ; <nl> + CHECK ( field_value - > IsHeapNumber ( ) ) ; <nl> WRITE_FIELD ( * object_storage , offset , * field_value ) ; <nl> WRITE_BARRIER ( * object_storage , offset , * field_value ) ; <nl> } else { <nl> void TranslatedState : : InitializeObjectWithTaggedFieldsAt ( <nl> int offset = i * kTaggedSize ; <nl> uint8_t marker = object_storage - > ReadField < uint8_t > ( offset ) ; <nl> if ( i > 1 & & marker = = kStoreMutableHeapNumber ) { <nl> - CHECK ( field_value - > IsMutableHeapNumber ( ) ) ; <nl> + CHECK ( field_value - > IsHeapNumber ( ) ) ; <nl> } else { <nl> CHECK ( marker = = kStoreTagged | | i = = 1 ) ; <nl> - CHECK ( ! field_value - > IsMutableHeapNumber ( ) ) ; <nl> } <nl> <nl> WRITE_FIELD ( * object_storage , offset , * field_value ) ; <nl> mmm a / src / deoptimizer / deoptimizer . h <nl> ppp b / src / deoptimizer / deoptimizer . h <nl> class TranslatedState { <nl> void UpdateFromPreviouslyMaterializedObjects ( ) ; <nl> void MaterializeFixedDoubleArray ( TranslatedFrame * frame , int * value_index , <nl> TranslatedValue * slot , Handle < Map > map ) ; <nl> - void MaterializeMutableHeapNumber ( TranslatedFrame * frame , int * value_index , <nl> - TranslatedValue * slot ) ; <nl> + void MaterializeHeapNumber ( TranslatedFrame * frame , int * value_index , <nl> + TranslatedValue * slot ) ; <nl> <nl> void EnsureObjectAllocatedAt ( TranslatedValue * slot ) ; <nl> <nl> mmm a / src / diagnostics / objects - debug . cc <nl> ppp b / src / diagnostics / objects - debug . cc <nl> void HeapObject : : HeapObjectVerify ( Isolate * isolate ) { <nl> case HEAP_NUMBER_TYPE : <nl> CHECK ( IsHeapNumber ( ) ) ; <nl> break ; <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> - CHECK ( IsMutableHeapNumber ( ) ) ; <nl> - break ; <nl> case BIGINT_TYPE : <nl> BigInt : : cast ( * this ) . BigIntVerify ( isolate ) ; <nl> break ; <nl> void JSObject : : JSObjectVerify ( Isolate * isolate ) { <nl> / / There are two reasons why this can happen : <nl> / / - in the middle of StoreTransitionStub when the new extended backing <nl> / / store is already set into the object and the allocation of the <nl> - / / MutableHeapNumber triggers GC while the map isn ' t updated yet . <nl> + / / HeapNumber triggers GC while the map isn ' t updated yet . <nl> / / - deletion of the last property can leave additional backing store <nl> / / capacity behind . <nl> CHECK_GT ( actual_unused_property_fields , map ( ) . UnusedPropertyFields ( ) ) ; <nl> void JSObject : : JSObjectVerify ( Isolate * isolate ) { <nl> VerifyObjectField ( isolate , index . offset ( ) ) ; <nl> } <nl> Object value = RawFastPropertyAt ( index ) ; <nl> - if ( r . IsDouble ( ) ) DCHECK ( value . IsMutableHeapNumber ( ) ) ; <nl> + if ( r . IsDouble ( ) ) DCHECK ( value . IsHeapNumber ( ) ) ; <nl> if ( value . IsUninitialized ( isolate ) ) continue ; <nl> if ( r . IsSmi ( ) ) DCHECK ( value . IsSmi ( ) ) ; <nl> if ( r . IsHeapObject ( ) ) DCHECK ( value . IsHeapObject ( ) ) ; <nl> mmm a / src / diagnostics / objects - printer . cc <nl> ppp b / src / diagnostics / objects - printer . cc <nl> void HeapObject : : HeapObjectPrint ( std : : ostream & os ) { / / NOLINT <nl> HeapNumber : : cast ( * this ) . HeapNumberPrint ( os ) ; <nl> os < < " \ n " ; <nl> break ; <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> - os < < " < mutable " ; <nl> - MutableHeapNumber : : cast ( * this ) . MutableHeapNumberPrint ( os ) ; <nl> - os < < " > \ n " ; <nl> - break ; <nl> case BIGINT_TYPE : <nl> BigInt : : cast ( * this ) . BigIntPrint ( os ) ; <nl> os < < " \ n " ; <nl> void TaggedImpl < kRefType , StorageType > : : Print ( std : : ostream & os ) { <nl> <nl> void HeapNumber : : HeapNumberPrint ( std : : ostream & os ) { os < < value ( ) ; } <nl> <nl> - void MutableHeapNumber : : MutableHeapNumberPrint ( std : : ostream & os ) { <nl> - os < < value ( ) ; <nl> - } <nl> - <nl> / / TODO ( cbruni ) : remove once the new maptracer is in place . <nl> void Name : : NameShortPrint ( ) { <nl> if ( this - > IsString ( ) ) { <nl> mmm a / src / heap / factory - inl . h <nl> ppp b / src / heap / factory - inl . h <nl> Handle < HeapNumber > Factory : : NewHeapNumber ( double value , <nl> return heap_number ; <nl> } <nl> <nl> - Handle < MutableHeapNumber > Factory : : NewMutableHeapNumber ( <nl> - double value , AllocationType allocation ) { <nl> - Handle < MutableHeapNumber > number = NewMutableHeapNumber ( allocation ) ; <nl> - number - > set_value ( value ) ; <nl> - return number ; <nl> - } <nl> - <nl> Handle < HeapNumber > Factory : : NewHeapNumberFromBits ( uint64_t bits , <nl> AllocationType allocation ) { <nl> Handle < HeapNumber > heap_number = NewHeapNumber ( allocation ) ; <nl> Handle < HeapNumber > Factory : : NewHeapNumberFromBits ( uint64_t bits , <nl> return heap_number ; <nl> } <nl> <nl> - Handle < MutableHeapNumber > Factory : : NewMutableHeapNumberFromBits ( <nl> - uint64_t bits , AllocationType allocation ) { <nl> - Handle < MutableHeapNumber > number = NewMutableHeapNumber ( allocation ) ; <nl> - number - > set_value_as_bits ( bits ) ; <nl> - return number ; <nl> - } <nl> - <nl> - Handle < MutableHeapNumber > Factory : : NewMutableHeapNumberWithHoleNaN ( <nl> + Handle < HeapNumber > Factory : : NewHeapNumberWithHoleNaN ( <nl> AllocationType allocation ) { <nl> - return NewMutableHeapNumberFromBits ( kHoleNanInt64 , allocation ) ; <nl> + return NewHeapNumberFromBits ( kHoleNanInt64 , allocation ) ; <nl> } <nl> <nl> Handle < JSArray > Factory : : NewJSArrayWithElements ( Handle < FixedArrayBase > elements , <nl> mmm a / src / heap / factory . cc <nl> ppp b / src / heap / factory . cc <nl> Handle < HeapNumber > Factory : : NewHeapNumberForCodeAssembler ( double value ) { <nl> : AllocationType : : kOld ) ; <nl> } <nl> <nl> - Handle < MutableHeapNumber > Factory : : NewMutableHeapNumber ( <nl> - AllocationType allocation ) { <nl> - STATIC_ASSERT ( HeapNumber : : kSize < = kMaxRegularHeapObjectSize ) ; <nl> - Map map = * mutable_heap_number_map ( ) ; <nl> - HeapObject result = AllocateRawWithImmortalMap ( <nl> - MutableHeapNumber : : kSize , allocation , map , kDoubleUnaligned ) ; <nl> - return handle ( MutableHeapNumber : : cast ( result ) , isolate ( ) ) ; <nl> - } <nl> - <nl> Handle < FreshlyAllocatedBigInt > Factory : : NewBigInt ( int length , <nl> AllocationType allocation ) { <nl> if ( length < 0 | | length > BigInt : : kMaxLength ) { <nl> mmm a / src / heap / factory . h <nl> ppp b / src / heap / factory . h <nl> class V8_EXPORT_PRIVATE Factory { <nl> / / space . <nl> Handle < HeapNumber > NewHeapNumberForCodeAssembler ( double value ) ; <nl> <nl> - Handle < MutableHeapNumber > NewMutableHeapNumber ( <nl> - AllocationType allocation = AllocationType : : kYoung ) ; <nl> - inline Handle < MutableHeapNumber > NewMutableHeapNumber ( <nl> - double value , AllocationType allocation = AllocationType : : kYoung ) ; <nl> - inline Handle < MutableHeapNumber > NewMutableHeapNumberFromBits ( <nl> - uint64_t bits , AllocationType allocation = AllocationType : : kYoung ) ; <nl> - inline Handle < MutableHeapNumber > NewMutableHeapNumberWithHoleNaN ( <nl> + inline Handle < HeapNumber > NewHeapNumberWithHoleNaN ( <nl> AllocationType allocation = AllocationType : : kYoung ) ; <nl> <nl> / / Allocates a new BigInt with { length } digits . Only to be used by <nl> mmm a / src / heap / object - stats . cc <nl> ppp b / src / heap / object - stats . cc <nl> class FieldStatsCollector : public ObjectVisitor { <nl> raw_fields_count_in_object - = <nl> field_stats . unboxed_double_fields_count_ * kDoubleSize / kTaggedSize ; <nl> * unboxed_double_fields_count_ + = field_stats . unboxed_double_fields_count_ ; <nl> - } else if ( host . IsHeapNumber ( ) | | host . IsMutableHeapNumber ( ) ) { <nl> + } else if ( host . IsHeapNumber ( ) ) { <nl> DCHECK_LE ( kDoubleSize / kTaggedSize , raw_fields_count_in_object ) ; <nl> raw_fields_count_in_object - = kDoubleSize / kTaggedSize ; <nl> * boxed_double_fields_count_ + = 1 ; <nl> mmm a / src / heap / setup - heap - internal . cc <nl> ppp b / src / heap / setup - heap - internal . cc <nl> bool Heap : : CreateInitialMaps ( ) { <nl> ALLOCATE_VARSIZE_MAP ( FEEDBACK_VECTOR_TYPE , feedback_vector ) <nl> ALLOCATE_PRIMITIVE_MAP ( HEAP_NUMBER_TYPE , HeapNumber : : kSize , heap_number , <nl> Context : : NUMBER_FUNCTION_INDEX ) <nl> - ALLOCATE_MAP ( MUTABLE_HEAP_NUMBER_TYPE , MutableHeapNumber : : kSize , <nl> - mutable_heap_number ) <nl> ALLOCATE_PRIMITIVE_MAP ( SYMBOL_TYPE , Symbol : : kSize , symbol , <nl> Context : : SYMBOL_FUNCTION_INDEX ) <nl> ALLOCATE_MAP ( FOREIGN_TYPE , Foreign : : kSize , foreign ) <nl> mmm a / src / ic / accessor - assembler . cc <nl> ppp b / src / ic / accessor - assembler . cc <nl> void AccessorAssembler : : HandleLoadField ( Node * holder , Node * handler_word , <nl> var_double_value - > Bind ( <nl> LoadObjectField ( holder , offset , MachineType : : Float64 ( ) ) ) ; <nl> } else { <nl> - Node * mutable_heap_number = LoadObjectField ( holder , offset ) ; <nl> - var_double_value - > Bind ( LoadHeapNumberValue ( mutable_heap_number ) ) ; <nl> + Node * heap_number = LoadObjectField ( holder , offset ) ; <nl> + var_double_value - > Bind ( LoadHeapNumberValue ( heap_number ) ) ; <nl> } <nl> Goto ( rebox_double ) ; <nl> } <nl> void AccessorAssembler : : CheckFieldType ( TNode < DescriptorArray > descriptors , <nl> BIND ( & r_double ) ; <nl> { <nl> GotoIf ( TaggedIsSmi ( value ) , & all_fine ) ; <nl> - Node * value_map = LoadMap ( value ) ; <nl> - / / While supporting mutable HeapNumbers would be straightforward , such <nl> - / / objects should not end up here anyway . <nl> - CSA_ASSERT ( this , WordNotEqual ( value_map , <nl> - LoadRoot ( RootIndex : : kMutableHeapNumberMap ) ) ) ; <nl> - Branch ( IsHeapNumberMap ( value_map ) , & all_fine , bailout ) ; <nl> + Branch ( IsHeapNumber ( value ) , & all_fine , bailout ) ; <nl> } <nl> <nl> BIND ( & r_heapobject ) ; <nl> void AccessorAssembler : : OverwriteExistingFastDataProperty ( <nl> MachineRepresentation : : kFloat64 ) ; <nl> } else { <nl> if ( do_transitioning_store ) { <nl> - Node * mutable_heap_number = <nl> - AllocateMutableHeapNumberWithValue ( double_value ) ; <nl> + Node * heap_number = AllocateHeapNumberWithValue ( double_value ) ; <nl> StoreMap ( object , object_map ) ; <nl> - StoreObjectField ( object , field_offset , mutable_heap_number ) ; <nl> + StoreObjectField ( object , field_offset , heap_number ) ; <nl> } else { <nl> - Node * mutable_heap_number = LoadObjectField ( object , field_offset ) ; <nl> + Node * heap_number = LoadObjectField ( object , field_offset ) ; <nl> Label if_mutable ( this ) ; <nl> GotoIfNot ( IsPropertyDetailsConst ( details ) , & if_mutable ) ; <nl> - TNode < Float64T > current_value = <nl> - LoadHeapNumberValue ( mutable_heap_number ) ; <nl> + TNode < Float64T > current_value = LoadHeapNumberValue ( heap_number ) ; <nl> BranchIfSameNumberValue ( current_value , double_value , & done , slow ) ; <nl> BIND ( & if_mutable ) ; <nl> - StoreHeapNumberValue ( mutable_heap_number , double_value ) ; <nl> + StoreHeapNumberValue ( heap_number , double_value ) ; <nl> } <nl> } <nl> Goto ( & done ) ; <nl> void AccessorAssembler : : OverwriteExistingFastDataProperty ( <nl> & cont ) ; <nl> { <nl> Node * double_value = ChangeNumberToFloat64 ( CAST ( value ) ) ; <nl> - Node * mutable_heap_number = <nl> - AllocateMutableHeapNumberWithValue ( double_value ) ; <nl> - var_value . Bind ( mutable_heap_number ) ; <nl> + Node * heap_number = AllocateHeapNumberWithValue ( double_value ) ; <nl> + var_value . Bind ( heap_number ) ; <nl> Goto ( & cont ) ; <nl> } <nl> BIND ( & cont ) ; <nl> void AccessorAssembler : : OverwriteExistingFastDataProperty ( <nl> & double_rep , & tagged_rep ) ; <nl> BIND ( & double_rep ) ; <nl> { <nl> - Node * mutable_heap_number = <nl> + Node * heap_number = <nl> LoadPropertyArrayElement ( properties , backing_store_index ) ; <nl> TNode < Float64T > double_value = ChangeNumberToFloat64 ( CAST ( value ) ) ; <nl> <nl> Label if_mutable ( this ) ; <nl> GotoIfNot ( IsPropertyDetailsConst ( details ) , & if_mutable ) ; <nl> - TNode < Float64T > current_value = <nl> - LoadHeapNumberValue ( mutable_heap_number ) ; <nl> + TNode < Float64T > current_value = LoadHeapNumberValue ( heap_number ) ; <nl> BranchIfSameNumberValue ( current_value , double_value , & done , slow ) ; <nl> <nl> BIND ( & if_mutable ) ; <nl> - StoreHeapNumberValue ( mutable_heap_number , double_value ) ; <nl> + StoreHeapNumberValue ( heap_number , double_value ) ; <nl> Goto ( & done ) ; <nl> } <nl> BIND ( & tagged_rep ) ; <nl> void AccessorAssembler : : GenerateCloneObjectIC ( ) { <nl> TNode < IntPtrT > field_offset_difference = <nl> TimesTaggedSize ( IntPtrSub ( result_start , source_start ) ) ; <nl> <nl> - / / Just copy the fields as raw data ( pretending that there are no <nl> - / / MutableHeapNumbers ) . This doesn ' t need write barriers . <nl> + / / Just copy the fields as raw data ( pretending that there are no mutable <nl> + / / HeapNumbers ) . This doesn ' t need write barriers . <nl> BuildFastLoop ( <nl> source_start , source_size , <nl> [ = ] ( Node * field_index ) { <nl> void AccessorAssembler : : GenerateCloneObjectIC ( ) { <nl> } , <nl> 1 , INTPTR_PARAMETERS , IndexAdvanceMode : : kPost ) ; <nl> <nl> - / / If MutableHeapNumbers can occur , we need to go through the { object } <nl> + / / If mutable HeapNumbers can occur , we need to go through the { object } <nl> / / again here and properly clone them . We use a second loop here to <nl> / / ensure that the GC ( and heap verifier ) always sees properly initialized <nl> / / objects , i . e . never hits undefined values in double fields . <nl> void AccessorAssembler : : GenerateCloneObjectIC ( ) { <nl> TNode < Object > field = LoadObjectField ( object , result_offset ) ; <nl> Label if_done ( this ) , if_mutableheapnumber ( this , Label : : kDeferred ) ; <nl> GotoIf ( TaggedIsSmi ( field ) , & if_done ) ; <nl> - Branch ( IsMutableHeapNumber ( CAST ( field ) ) , & if_mutableheapnumber , <nl> - & if_done ) ; <nl> + Branch ( IsHeapNumber ( CAST ( field ) ) , & if_mutableheapnumber , & if_done ) ; <nl> BIND ( & if_mutableheapnumber ) ; <nl> { <nl> - TNode < Object > value = AllocateMutableHeapNumberWithValue ( <nl> + TNode < Object > value = AllocateHeapNumberWithValue ( <nl> LoadHeapNumberValue ( UncheckedCast < HeapNumber > ( field ) ) ) ; <nl> StoreObjectField ( object , result_offset , value ) ; <nl> Goto ( & if_done ) ; <nl> mmm a / src / json / json - parser . cc <nl> ppp b / src / json / json - parser . cc <nl> Handle < Object > JsonParser < Char > : : BuildJsonObject ( <nl> Handle < ByteArray > mutable_double_buffer ; <nl> / / Allocate enough space so we can double - align the payload . <nl> const int kMutableDoubleSize = sizeof ( double ) * 2 ; <nl> - STATIC_ASSERT ( MutableHeapNumber : : kSize < = kMutableDoubleSize ) ; <nl> + STATIC_ASSERT ( HeapNumber : : kSize < = kMutableDoubleSize ) ; <nl> if ( new_mutable_double > 0 ) { <nl> mutable_double_buffer = <nl> factory ( ) - > NewByteArray ( kMutableDoubleSize * new_mutable_double ) ; <nl> Handle < Object > JsonParser < Char > : : BuildJsonObject ( <nl> if ( IsAligned ( mutable_double_address , kDoubleAlignment ) ) { <nl> mutable_double_address + = kTaggedSize ; <nl> } else { <nl> - filler_address + = MutableHeapNumber : : kSize ; <nl> + filler_address + = HeapNumber : : kSize ; <nl> } <nl> for ( int j = 0 ; j < i ; j + + ) { <nl> const JsonProperty & property = property_stack [ start + j ] ; <nl> Handle < Object > JsonParser < Char > : : BuildJsonObject ( <nl> / / payload , so we can skip notifying object layout change . <nl> <nl> HeapObject hn = HeapObject : : FromAddress ( mutable_double_address ) ; <nl> - hn . set_map_after_allocation ( * factory ( ) - > mutable_heap_number_map ( ) ) ; <nl> - MutableHeapNumber : : cast ( hn ) . set_value_as_bits ( bits ) ; <nl> + hn . set_map_after_allocation ( * factory ( ) - > heap_number_map ( ) ) ; <nl> + HeapNumber : : cast ( hn ) . set_value_as_bits ( bits ) ; <nl> value = hn ; <nl> mutable_double_address + = kMutableDoubleSize ; <nl> } else { <nl> DCHECK ( value . IsHeapNumber ( ) ) ; <nl> HeapObject : : cast ( value ) . synchronized_set_map ( <nl> - * factory ( ) - > mutable_heap_number_map ( ) ) ; <nl> + * factory ( ) - > heap_number_map ( ) ) ; <nl> } <nl> } <nl> object - > RawFastInobjectPropertyAtPut ( index , value , mode ) ; <nl> } <nl> - / / Make all MutableHeapNumbers alive . <nl> + / / Make all mutable HeapNumbers alive . <nl> if ( ! mutable_double_buffer . is_null ( ) ) { <nl> # ifdef DEBUG <nl> Address end = <nl> mmm a / src / json / json - stringifier . cc <nl> ppp b / src / json / json - stringifier . cc <nl> JsonStringifier : : Result JsonStringifier : : Serialize_ ( Handle < Object > object , <nl> <nl> switch ( HeapObject : : cast ( * object ) . map ( ) . instance_type ( ) ) { <nl> case HEAP_NUMBER_TYPE : <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> if ( deferred_string_key ) SerializeDeferredKey ( comma , key ) ; <nl> return SerializeHeapNumber ( Handle < HeapNumber > : : cast ( object ) ) ; <nl> case BIGINT_TYPE : <nl> mmm a / src / objects / heap - number - inl . h <nl> ppp b / src / objects / heap - number - inl . h <nl> <nl> namespace v8 { <nl> namespace internal { <nl> <nl> - OBJECT_CONSTRUCTORS_IMPL ( HeapNumberBase , HeapObject ) <nl> - OBJECT_CONSTRUCTORS_IMPL ( HeapNumber , HeapNumberBase ) <nl> - OBJECT_CONSTRUCTORS_IMPL ( MutableHeapNumber , HeapNumberBase ) <nl> + OBJECT_CONSTRUCTORS_IMPL ( HeapNumber , HeapObject ) <nl> <nl> CAST_ACCESSOR ( HeapNumber ) <nl> - CAST_ACCESSOR ( MutableHeapNumber ) <nl> <nl> - double HeapNumberBase : : value ( ) const { return ReadField < double > ( kValueOffset ) ; } <nl> + double HeapNumber : : value ( ) const { return ReadField < double > ( kValueOffset ) ; } <nl> <nl> - void HeapNumberBase : : set_value ( double value ) { <nl> + void HeapNumber : : set_value ( double value ) { <nl> WriteField < double > ( kValueOffset , value ) ; <nl> } <nl> <nl> - uint64_t HeapNumberBase : : value_as_bits ( ) const { <nl> + uint64_t HeapNumber : : value_as_bits ( ) const { <nl> / / Bug ( v8 : 8875 ) : HeapNumber ' s double may be unaligned . <nl> return base : : ReadUnalignedValue < uint64_t > ( field_address ( kValueOffset ) ) ; <nl> } <nl> <nl> - void HeapNumberBase : : set_value_as_bits ( uint64_t bits ) { <nl> + void HeapNumber : : set_value_as_bits ( uint64_t bits ) { <nl> base : : WriteUnalignedValue < uint64_t > ( field_address ( kValueOffset ) , bits ) ; <nl> } <nl> <nl> - int HeapNumberBase : : get_exponent ( ) { <nl> + int HeapNumber : : get_exponent ( ) { <nl> return ( ( ReadField < int > ( kExponentOffset ) & kExponentMask ) > > kExponentShift ) - <nl> kExponentBias ; <nl> } <nl> <nl> - int HeapNumberBase : : get_sign ( ) { <nl> + int HeapNumber : : get_sign ( ) { <nl> return ReadField < int > ( kExponentOffset ) & kSignMask ; <nl> } <nl> <nl> mmm a / src / objects / heap - number . h <nl> ppp b / src / objects / heap - number . h <nl> namespace v8 { <nl> namespace internal { <nl> <nl> / / The HeapNumber class describes heap allocated numbers that cannot be <nl> - / / represented in a Smi ( small integer ) . MutableHeapNumber is the same , but its <nl> - / / number value can change over time ( it is used only as property storage ) . <nl> - / / HeapNumberBase merely exists to avoid code duplication . <nl> - class HeapNumberBase : public HeapObject { <nl> + / / represented in a Smi ( small integer ) . <nl> + class HeapNumber : public HeapObject { <nl> public : <nl> / / [ value ] : number value . <nl> inline double value ( ) const ; <nl> class HeapNumberBase : public HeapObject { <nl> static const int kMantissaBitsInTopWord = 20 ; <nl> static const int kNonMantissaBitsInTopWord = 12 ; <nl> <nl> - / / Just to make the macro - generated constructor happy . Subclasses should <nl> - / / perform their own proper type checking . <nl> - inline bool IsHeapNumberBase ( ) const { return true ; } <nl> - <nl> - OBJECT_CONSTRUCTORS ( HeapNumberBase , HeapObject ) ; <nl> - } ; <nl> - <nl> - class HeapNumber : public HeapNumberBase { <nl> - public : <nl> DECL_CAST ( HeapNumber ) <nl> V8_EXPORT_PRIVATE void HeapNumberPrint ( std : : ostream & os ) ; <nl> <nl> - OBJECT_CONSTRUCTORS ( HeapNumber , HeapNumberBase ) ; <nl> - } ; <nl> - <nl> - class MutableHeapNumber : public HeapNumberBase { <nl> - public : <nl> - DECL_CAST ( MutableHeapNumber ) <nl> - V8_EXPORT_PRIVATE void MutableHeapNumberPrint ( std : : ostream & os ) ; <nl> - <nl> - OBJECT_CONSTRUCTORS ( MutableHeapNumber , HeapNumberBase ) ; <nl> + OBJECT_CONSTRUCTORS ( HeapNumber , HeapObject ) ; <nl> } ; <nl> <nl> } / / namespace internal <nl> mmm a / src / objects / instance - type . h <nl> ppp b / src / objects / instance - type . h <nl> enum InstanceType : uint16_t { <nl> <nl> / / " Data " , objects that cannot contain non - map - word pointers to heap <nl> / / objects . <nl> - MUTABLE_HEAP_NUMBER_TYPE , <nl> FOREIGN_TYPE , <nl> BYTE_ARRAY_TYPE , <nl> BYTECODE_ARRAY_TYPE , <nl> V8_EXPORT_PRIVATE std : : ostream & operator < < ( std : : ostream & os , <nl> V ( JSWeakSet , JS_WEAK_SET_TYPE ) \ <nl> V ( LoadHandler , LOAD_HANDLER_TYPE ) \ <nl> V ( Map , MAP_TYPE ) \ <nl> - V ( MutableHeapNumber , MUTABLE_HEAP_NUMBER_TYPE ) \ <nl> V ( NameDictionary , NAME_DICTIONARY_TYPE ) \ <nl> V ( NativeContext , NATIVE_CONTEXT_TYPE ) \ <nl> V ( NumberDictionary , NUMBER_DICTIONARY_TYPE ) \ <nl> mmm a / src / objects / js - objects - inl . h <nl> ppp b / src / objects / js - objects - inl . h <nl> void JSObject : : RawFastDoublePropertyAsBitsAtPut ( FieldIndex index , <nl> <nl> void JSObject : : FastPropertyAtPut ( FieldIndex index , Object value ) { <nl> if ( IsUnboxedDoubleField ( index ) ) { <nl> - DCHECK ( value . IsMutableHeapNumber ( ) ) ; <nl> + DCHECK ( value . IsHeapNumber ( ) ) ; <nl> / / Ensure that all bits of the double value are preserved . <nl> - RawFastDoublePropertyAsBitsAtPut ( <nl> - index , MutableHeapNumber : : cast ( value ) . value_as_bits ( ) ) ; <nl> + RawFastDoublePropertyAsBitsAtPut ( index , <nl> + HeapNumber : : cast ( value ) . value_as_bits ( ) ) ; <nl> } else { <nl> RawFastPropertyAtPut ( index , value ) ; <nl> } <nl> void JSObject : : WriteToField ( int descriptor , PropertyDetails details , <nl> if ( IsUnboxedDoubleField ( index ) ) { <nl> RawFastDoublePropertyAsBitsAtPut ( index , bits ) ; <nl> } else { <nl> - auto box = MutableHeapNumber : : cast ( RawFastPropertyAt ( index ) ) ; <nl> + auto box = HeapNumber : : cast ( RawFastPropertyAt ( index ) ) ; <nl> box . set_value_as_bits ( bits ) ; <nl> } <nl> } else { <nl> mmm a / src / objects / js - objects . cc <nl> ppp b / src / objects / js - objects . cc <nl> void MigrateFastToFast ( Isolate * isolate , Handle < JSObject > object , <nl> FieldIndex : : ForDescriptor ( isolate , * new_map , new_map - > LastAdded ( ) ) ; <nl> if ( index . is_inobject ( ) | | index . outobject_array_index ( ) < <nl> object - > property_array ( isolate ) . length ( ) ) { <nl> - / / We still need to allocate MutableHeapNumbers for double fields <nl> + / / We still need to allocate HeapNumbers for double fields <nl> / / if either double field unboxing is disabled or the double field <nl> / / is in the PropertyArray backing store ( where we don ' t support <nl> / / double field unboxing ) . <nl> if ( index . is_double ( ) & & ! new_map - > IsUnboxedDoubleField ( isolate , index ) ) { <nl> - auto value = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + auto value = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> object - > RawFastPropertyAtPut ( index , * value ) ; <nl> } <nl> object - > synchronized_set_map ( * new_map ) ; <nl> void MigrateFastToFast ( Isolate * isolate , Handle < JSObject > object , <nl> / / Properly initialize newly added property . <nl> Handle < Object > value ; <nl> if ( details . representation ( ) . IsDouble ( ) ) { <nl> - value = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + value = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> } else { <nl> value = isolate - > factory ( ) - > uninitialized_value ( ) ; <nl> } <nl> void MigrateFastToFast ( Isolate * isolate , Handle < JSObject > object , <nl> / / must already be prepared for data of certain type . <nl> DCHECK ( ! details . representation ( ) . IsNone ( ) ) ; <nl> if ( details . representation ( ) . IsDouble ( ) ) { <nl> - value = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + value = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> } else { <nl> value = isolate - > factory ( ) - > uninitialized_value ( ) ; <nl> } <nl> void MigrateFastToFast ( Isolate * isolate , Handle < JSObject > object , <nl> FieldIndex index = FieldIndex : : ForDescriptor ( isolate , * old_map , i ) ; <nl> if ( object - > IsUnboxedDoubleField ( isolate , index ) ) { <nl> uint64_t old_bits = object - > RawFastDoublePropertyAsBitsAt ( index ) ; <nl> - if ( representation . IsDouble ( ) ) { <nl> - value = isolate - > factory ( ) - > NewMutableHeapNumberFromBits ( old_bits ) ; <nl> - } else { <nl> - value = isolate - > factory ( ) - > NewHeapNumberFromBits ( old_bits ) ; <nl> - } <nl> + value = isolate - > factory ( ) - > NewHeapNumberFromBits ( old_bits ) ; <nl> } else { <nl> value = handle ( object - > RawFastPropertyAt ( isolate , index ) , isolate ) ; <nl> if ( ! old_representation . IsDouble ( ) & & representation . IsDouble ( ) ) { <nl> void MigrateFastToFast ( Isolate * isolate , Handle < JSObject > object , <nl> DCHECK_EQ ( kData , details . kind ( ) ) ; <nl> Handle < Object > value ; <nl> if ( details . representation ( ) . IsDouble ( ) ) { <nl> - value = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + value = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> } else { <nl> value = isolate - > factory ( ) - > uninitialized_value ( ) ; <nl> } <nl> void MigrateFastToFast ( Isolate * isolate , Handle < JSObject > object , <nl> / / Can ' t use JSObject : : FastPropertyAtPut ( ) because proper map was not set <nl> / / yet . <nl> if ( new_map - > IsUnboxedDoubleField ( isolate , index ) ) { <nl> - DCHECK ( value . IsMutableHeapNumber ( isolate ) ) ; <nl> + DCHECK ( value . IsHeapNumber ( isolate ) ) ; <nl> / / Ensure that all bits of the double value are preserved . <nl> object - > RawFastDoublePropertyAsBitsAtPut ( <nl> - index , MutableHeapNumber : : cast ( value ) . value_as_bits ( ) ) ; <nl> + index , HeapNumber : : cast ( value ) . value_as_bits ( ) ) ; <nl> if ( i < old_number_of_fields & & ! old_map - > IsUnboxedDoubleField ( index ) ) { <nl> / / Transition from tagged to untagged slot . <nl> heap - > ClearRecordedSlot ( * object , object - > RawField ( index . offset ( ) ) ) ; <nl> void MigrateFastToSlow ( Isolate * isolate , Handle < JSObject > object , <nl> } else { <nl> value = handle ( object - > RawFastPropertyAt ( isolate , index ) , isolate ) ; <nl> if ( details . representation ( ) . IsDouble ( ) ) { <nl> - DCHECK ( value - > IsMutableHeapNumber ( isolate ) ) ; <nl> - double old_value = Handle < MutableHeapNumber > : : cast ( value ) - > value ( ) ; <nl> + DCHECK ( value - > IsHeapNumber ( isolate ) ) ; <nl> + double old_value = Handle < HeapNumber > : : cast ( value ) - > value ( ) ; <nl> value = isolate - > factory ( ) - > NewHeapNumber ( old_value ) ; <nl> } <nl> } <nl> void JSObject : : AllocateStorageForMap ( Handle < JSObject > object , Handle < Map > map ) { <nl> if ( ! representation . IsDouble ( ) ) continue ; <nl> FieldIndex index = FieldIndex : : ForDescriptor ( * map , i ) ; <nl> if ( map - > IsUnboxedDoubleField ( index ) ) continue ; <nl> - auto box = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + auto box = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> if ( index . is_inobject ( ) ) { <nl> storage - > set ( index . property_index ( ) , * box ) ; <nl> } else { <nl> Object JSObject : : SlowReverseLookup ( Object value ) { <nl> } else { <nl> Object property = RawFastPropertyAt ( field_index ) ; <nl> if ( field_index . is_double ( ) ) { <nl> - DCHECK ( property . IsMutableHeapNumber ( ) ) ; <nl> + DCHECK ( property . IsHeapNumber ( ) ) ; <nl> if ( value_is_number & & property . Number ( ) = = value . Number ( ) ) { <nl> return descs . GetKey ( i ) ; <nl> } <nl> bool CanSubclassHaveInobjectProperties ( InstanceType instance_type ) { <nl> case JS_GLOBAL_PROXY_TYPE : <nl> case JS_PROXY_TYPE : <nl> case MAP_TYPE : <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> case ODDBALL_TYPE : <nl> case PROPERTY_CELL_TYPE : <nl> case SHARED_FUNCTION_INFO_TYPE : <nl> mmm a / src / objects / lookup . cc <nl> ppp b / src / objects / lookup . cc <nl> bool LookupIterator : : IsConstFieldValueEqualTo ( Object value ) const { <nl> bits = holder - > RawFastDoublePropertyAsBitsAt ( field_index ) ; <nl> } else { <nl> Object current_value = holder - > RawFastPropertyAt ( isolate_ , field_index ) ; <nl> - DCHECK ( current_value . IsMutableHeapNumber ( isolate_ ) ) ; <nl> - bits = MutableHeapNumber : : cast ( current_value ) . value_as_bits ( ) ; <nl> + DCHECK ( current_value . IsHeapNumber ( isolate_ ) ) ; <nl> + bits = HeapNumber : : cast ( current_value ) . value_as_bits ( ) ; <nl> } <nl> / / Use bit representation of double to to check for hole double , since <nl> / / manipulating the signaling NaN used for the hole in C + + , e . g . with <nl> mmm a / src / objects / map . cc <nl> ppp b / src / objects / map . cc <nl> VisitorId Map : : GetVisitorId ( Map map ) { <nl> case FILLER_TYPE : <nl> case FOREIGN_TYPE : <nl> case HEAP_NUMBER_TYPE : <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> case FEEDBACK_METADATA_TYPE : <nl> return kVisitDataObject ; <nl> <nl> mmm a / src / objects / object - list - macros . h <nl> ppp b / src / objects / object - list - macros . h <nl> class LookupIterator ; <nl> class FieldType ; <nl> class Module ; <nl> class SourceTextModuleInfoEntry ; <nl> - class MutableHeapNumber ; <nl> + class HeapNumber ; <nl> class ObjectHashTable ; <nl> class ObjectTemplateInfo ; <nl> class ObjectVisitor ; <nl> class ZoneForwardList ; <nl> V ( MapCache ) \ <nl> V ( Module ) \ <nl> V ( Microtask ) \ <nl> - V ( MutableHeapNumber ) \ <nl> V ( Name ) \ <nl> V ( NameDictionary ) \ <nl> V ( NativeContext ) \ <nl> mmm a / src / objects / objects - body - descriptors - inl . h <nl> ppp b / src / objects / objects - body - descriptors - inl . h <nl> ReturnType BodyDescriptorApply ( InstanceType type , T1 p1 , T2 p2 , T3 p3 , T4 p4 ) { <nl> return Op : : template apply < UncompiledDataWithPreparseData : : BodyDescriptor > ( <nl> p1 , p2 , p3 , p4 ) ; <nl> case HEAP_NUMBER_TYPE : <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> case FILLER_TYPE : <nl> case BYTE_ARRAY_TYPE : <nl> case FREE_SPACE_TYPE : <nl> mmm a / src / objects / objects - definitions . h <nl> ppp b / src / objects / objects - definitions . h <nl> namespace internal { <nl> \ <nl> V ( MAP_TYPE ) \ <nl> V ( CODE_TYPE ) \ <nl> - V ( MUTABLE_HEAP_NUMBER_TYPE ) \ <nl> V ( FOREIGN_TYPE ) \ <nl> V ( BYTE_ARRAY_TYPE ) \ <nl> V ( BYTECODE_ARRAY_TYPE ) \ <nl> mmm a / src / objects / objects - inl . h <nl> ppp b / src / objects / objects - inl . h <nl> bool Object : : FitsRepresentation ( Representation representation ) { <nl> if ( FLAG_track_fields & & representation . IsSmi ( ) ) { <nl> return IsSmi ( ) ; <nl> } else if ( FLAG_track_double_fields & & representation . IsDouble ( ) ) { <nl> - return IsMutableHeapNumber ( ) | | IsNumber ( ) ; <nl> + return IsNumber ( ) ; <nl> } else if ( FLAG_track_heap_object_fields & & representation . IsHeapObject ( ) ) { <nl> return IsHeapObject ( ) ; <nl> } else if ( FLAG_track_fields & & representation . IsNone ( ) ) { <nl> mmm a / src / objects / objects . cc <nl> ppp b / src / objects / objects . cc <nl> Handle < FieldType > Object : : OptimalType ( Isolate * isolate , <nl> Handle < Object > Object : : NewStorageFor ( Isolate * isolate , Handle < Object > object , <nl> Representation representation ) { <nl> if ( ! representation . IsDouble ( ) ) return object ; <nl> - auto result = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + auto result = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> if ( object - > IsUninitialized ( isolate ) ) { <nl> result - > set_value_as_bits ( kHoleNanInt64 ) ; <nl> - } else if ( object - > IsMutableHeapNumber ( ) ) { <nl> + } else if ( object - > IsHeapNumber ( ) ) { <nl> / / Ensure that all bits of the double value are preserved . <nl> - result - > set_value_as_bits ( MutableHeapNumber : : cast ( * object ) . value_as_bits ( ) ) ; <nl> + result - > set_value_as_bits ( HeapNumber : : cast ( * object ) . value_as_bits ( ) ) ; <nl> } else { <nl> result - > set_value ( object - > Number ( ) ) ; <nl> } <nl> Handle < Object > Object : : WrapForRead ( Isolate * isolate , Handle < Object > object , <nl> return object ; <nl> } <nl> return isolate - > factory ( ) - > NewHeapNumberFromBits ( <nl> - MutableHeapNumber : : cast ( * object ) . value_as_bits ( ) ) ; <nl> + HeapNumber : : cast ( * object ) . value_as_bits ( ) ) ; <nl> } <nl> <nl> MaybeHandle < JSReceiver > Object : : ToObjectImpl ( Isolate * isolate , <nl> void HeapObject : : HeapObjectShortPrint ( std : : ostream & os ) { / / NOLINT <nl> os < < " > " ; <nl> break ; <nl> } <nl> - case MUTABLE_HEAP_NUMBER_TYPE : { <nl> - os < < " < MutableHeapNumber " ; <nl> - MutableHeapNumber : : cast ( * this ) . MutableHeapNumberPrint ( os ) ; <nl> - os < < ' > ' ; <nl> - break ; <nl> - } <nl> case BIGINT_TYPE : { <nl> os < < " < BigInt " ; <nl> BigInt : : cast ( * this ) . BigIntShortPrint ( os ) ; <nl> mmm a / src / objects / value - serializer . cc <nl> ppp b / src / objects / value - serializer . cc <nl> Maybe < bool > ValueSerializer : : WriteObject ( Handle < Object > object ) { <nl> case HEAP_NUMBER_TYPE : <nl> WriteHeapNumber ( HeapNumber : : cast ( * object ) ) ; <nl> return ThrowIfOutOfMemory ( ) ; <nl> - case MUTABLE_HEAP_NUMBER_TYPE : <nl> - WriteMutableHeapNumber ( MutableHeapNumber : : cast ( * object ) ) ; <nl> - return ThrowIfOutOfMemory ( ) ; <nl> case BIGINT_TYPE : <nl> WriteBigInt ( BigInt : : cast ( * object ) ) ; <nl> return ThrowIfOutOfMemory ( ) ; <nl> void ValueSerializer : : WriteHeapNumber ( HeapNumber number ) { <nl> WriteDouble ( number . value ( ) ) ; <nl> } <nl> <nl> - void ValueSerializer : : WriteMutableHeapNumber ( MutableHeapNumber number ) { <nl> - WriteTag ( SerializationTag : : kDouble ) ; <nl> - WriteDouble ( number . value ( ) ) ; <nl> - } <nl> - <nl> void ValueSerializer : : WriteBigInt ( BigInt bigint ) { <nl> WriteTag ( SerializationTag : : kBigInt ) ; <nl> WriteBigIntContents ( bigint ) ; <nl> mmm a / src / objects / value - serializer . h <nl> ppp b / src / objects / value - serializer . h <nl> class JSMap ; <nl> class JSPrimitiveWrapper ; <nl> class JSRegExp ; <nl> class JSSet ; <nl> - class MutableHeapNumber ; <nl> class Object ; <nl> class Oddball ; <nl> class Smi ; <nl> class ValueSerializer { <nl> void WriteOddball ( Oddball oddball ) ; <nl> void WriteSmi ( Smi smi ) ; <nl> void WriteHeapNumber ( HeapNumber number ) ; <nl> - void WriteMutableHeapNumber ( MutableHeapNumber number ) ; <nl> void WriteBigInt ( BigInt bigint ) ; <nl> void WriteString ( Handle < String > string ) ; <nl> Maybe < bool > WriteJSReceiver ( Handle < JSReceiver > receiver ) <nl> mmm a / src / roots / roots . h <nl> ppp b / src / roots / roots . h <nl> class Symbol ; <nl> V ( Map , global_dictionary_map , GlobalDictionaryMap ) \ <nl> V ( Map , many_closures_cell_map , ManyClosuresCellMap ) \ <nl> V ( Map , module_info_map , ModuleInfoMap ) \ <nl> - V ( Map , mutable_heap_number_map , MutableHeapNumberMap ) \ <nl> V ( Map , name_dictionary_map , NameDictionaryMap ) \ <nl> V ( Map , no_closures_cell_map , NoClosuresCellMap ) \ <nl> V ( Map , number_dictionary_map , NumberDictionaryMap ) \ <nl> mmm a / src / runtime / runtime - literals . cc <nl> ppp b / src / runtime / runtime - literals . cc <nl> MaybeHandle < JSObject > JSObjectWalkVisitor < ContextObject > : : StructureWalk ( <nl> copy - > map ( isolate ) . instance_descriptors ( isolate ) , isolate ) ; <nl> int limit = copy - > map ( isolate ) . NumberOfOwnDescriptors ( ) ; <nl> for ( int i = 0 ; i < limit ; i + + ) { <nl> - DCHECK_EQ ( kField , descriptors - > GetDetails ( i ) . location ( ) ) ; <nl> - DCHECK_EQ ( kData , descriptors - > GetDetails ( i ) . kind ( ) ) ; <nl> - FieldIndex index = FieldIndex : : ForDescriptor ( copy - > map ( isolate ) , i ) ; <nl> + PropertyDetails details = descriptors - > GetDetails ( i ) ; <nl> + DCHECK_EQ ( kField , details . location ( ) ) ; <nl> + DCHECK_EQ ( kData , details . kind ( ) ) ; <nl> + FieldIndex index = FieldIndex : : ForPropertyIndex ( <nl> + copy - > map ( isolate ) , details . field_index ( ) , <nl> + details . representation ( ) ) ; <nl> if ( copy - > IsUnboxedDoubleField ( isolate , index ) ) continue ; <nl> Object raw = copy - > RawFastPropertyAt ( isolate , index ) ; <nl> if ( raw . IsJSObject ( isolate ) ) { <nl> MaybeHandle < JSObject > JSObjectWalkVisitor < ContextObject > : : StructureWalk ( <nl> ASSIGN_RETURN_ON_EXCEPTION ( <nl> isolate , value , VisitElementOrProperty ( copy , value ) , JSObject ) ; <nl> if ( copying ) copy - > FastPropertyAtPut ( index , * value ) ; <nl> - } else if ( copying & & raw . IsMutableHeapNumber ( isolate ) ) { <nl> - DCHECK ( descriptors - > GetDetails ( i ) . representation ( ) . IsDouble ( ) ) ; <nl> - uint64_t double_value = MutableHeapNumber : : cast ( raw ) . value_as_bits ( ) ; <nl> - auto value = <nl> - isolate - > factory ( ) - > NewMutableHeapNumberFromBits ( double_value ) ; <nl> + } else if ( copying & & details . representation ( ) . IsDouble ( ) ) { <nl> + uint64_t double_value = HeapNumber : : cast ( raw ) . value_as_bits ( ) ; <nl> + auto value = isolate - > factory ( ) - > NewHeapNumberFromBits ( double_value ) ; <nl> copy - > FastPropertyAtPut ( index , * value ) ; <nl> } <nl> } <nl> mmm a / test / cctest / heap / test - heap . cc <nl> ppp b / test / cctest / heap / test - heap . cc <nl> TEST ( HeapNumberAlignment ) { <nl> } <nl> } <nl> <nl> - TEST ( MutableHeapNumberAlignment ) { <nl> - CcTest : : InitializeVM ( ) ; <nl> - Isolate * isolate = CcTest : : i_isolate ( ) ; <nl> - Factory * factory = isolate - > factory ( ) ; <nl> - Heap * heap = isolate - > heap ( ) ; <nl> - HandleScope sc ( isolate ) ; <nl> - <nl> - const auto required_alignment = <nl> - HeapObject : : RequiredAlignment ( * factory - > mutable_heap_number_map ( ) ) ; <nl> - const int maximum_misalignment = <nl> - Heap : : GetMaximumFillToAlign ( required_alignment ) ; <nl> - <nl> - for ( int offset = 0 ; offset < = maximum_misalignment ; offset + = kTaggedSize ) { <nl> - AlignNewSpace ( required_alignment , offset ) ; <nl> - Handle < Object > number_new = factory - > NewMutableHeapNumber ( 1 . 000123 ) ; <nl> - CHECK ( number_new - > IsMutableHeapNumber ( ) ) ; <nl> - CHECK ( Heap : : InYoungGeneration ( * number_new ) ) ; <nl> - CHECK_EQ ( 0 , Heap : : GetFillToAlign ( HeapObject : : cast ( * number_new ) . address ( ) , <nl> - required_alignment ) ) ; <nl> - <nl> - AlignOldSpace ( required_alignment , offset ) ; <nl> - Handle < Object > number_old = <nl> - factory - > NewMutableHeapNumber ( 1 . 000321 , AllocationType : : kOld ) ; <nl> - CHECK ( number_old - > IsMutableHeapNumber ( ) ) ; <nl> - CHECK ( heap - > InOldSpace ( * number_old ) ) ; <nl> - CHECK_EQ ( 0 , Heap : : GetFillToAlign ( HeapObject : : cast ( * number_old ) . address ( ) , <nl> - required_alignment ) ) ; <nl> - } <nl> - } <nl> - <nl> TEST ( TestSizeOfObjectsVsHeapObjectIteratorPrecision ) { <nl> CcTest : : InitializeVM ( ) ; <nl> HeapObjectIterator iterator ( CcTest : : heap ( ) ) ; <nl> mmm a / test / cctest / test - field - type - tracking . cc <nl> ppp b / test / cctest / test - field - type - tracking . cc <nl> TEST ( TransitionAccessorConstantToSameAccessorConstant ) { <nl> / / TODO ( ishell ) : add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported . <nl> / / TEST ( TransitionAccessorConstantToAnotherAccessorConstant ) <nl> <nl> - TEST ( HoleyMutableHeapNumber ) { <nl> + TEST ( HoleyHeapNumber ) { <nl> CcTest : : InitializeVM ( ) ; <nl> v8 : : HandleScope scope ( CcTest : : isolate ( ) ) ; <nl> Isolate * isolate = CcTest : : i_isolate ( ) ; <nl> <nl> - auto mhn = isolate - > factory ( ) - > NewMutableHeapNumberWithHoleNaN ( ) ; <nl> + auto mhn = isolate - > factory ( ) - > NewHeapNumberWithHoleNaN ( ) ; <nl> CHECK_EQ ( kHoleNanInt64 , mhn - > value_as_bits ( ) ) ; <nl> <nl> - mhn = isolate - > factory ( ) - > NewMutableHeapNumber ( 0 . 0 ) ; <nl> + mhn = isolate - > factory ( ) - > NewHeapNumber ( 0 . 0 ) ; <nl> CHECK_EQ ( uint64_t { 0 } , mhn - > value_as_bits ( ) ) ; <nl> <nl> mhn - > set_value_as_bits ( kHoleNanInt64 ) ; <nl> TEST ( HoleyMutableHeapNumber ) { <nl> Handle < Object > obj = <nl> Object : : NewStorageFor ( isolate , isolate - > factory ( ) - > uninitialized_value ( ) , <nl> Representation : : Double ( ) ) ; <nl> - CHECK ( obj - > IsMutableHeapNumber ( ) ) ; <nl> - CHECK_EQ ( kHoleNanInt64 , MutableHeapNumber : : cast ( * obj ) . value_as_bits ( ) ) ; <nl> + CHECK ( obj - > IsHeapNumber ( ) ) ; <nl> + CHECK_EQ ( kHoleNanInt64 , HeapNumber : : cast ( * obj ) . value_as_bits ( ) ) ; <nl> <nl> obj = Object : : NewStorageFor ( isolate , mhn , Representation : : Double ( ) ) ; <nl> - CHECK ( obj - > IsMutableHeapNumber ( ) ) ; <nl> - CHECK_EQ ( kHoleNanInt64 , MutableHeapNumber : : cast ( * obj ) . value_as_bits ( ) ) ; <nl> + CHECK ( obj - > IsHeapNumber ( ) ) ; <nl> + CHECK_EQ ( kHoleNanInt64 , HeapNumber : : cast ( * obj ) . value_as_bits ( ) ) ; <nl> } <nl> <nl> namespace { <nl> mmm a / test / cctest / test - inobject - slack - tracking . cc <nl> ppp b / test / cctest / test - inobject - slack - tracking . cc <nl> static double GetDoubleFieldValue ( JSObject obj , FieldIndex field_index ) { <nl> return obj . RawFastDoublePropertyAt ( field_index ) ; <nl> } else { <nl> Object value = obj . RawFastPropertyAt ( field_index ) ; <nl> - if ( value . IsMutableHeapNumber ( ) ) { <nl> - return MutableHeapNumber : : cast ( value ) . value ( ) ; <nl> + if ( value . IsHeapNumber ( ) ) { <nl> + return HeapNumber : : cast ( value ) . value ( ) ; <nl> } else { <nl> return value . Number ( ) ; <nl> } <nl> mmm a / test / cctest / test - unboxed - doubles . cc <nl> ppp b / test / cctest / test - unboxed - doubles . cc <nl> static double GetDoubleFieldValue ( JSObject obj , FieldIndex field_index ) { <nl> return obj . RawFastDoublePropertyAt ( field_index ) ; <nl> } else { <nl> Object value = obj . RawFastPropertyAt ( field_index ) ; <nl> - CHECK ( value . IsMutableHeapNumber ( ) ) ; <nl> - return MutableHeapNumber : : cast ( value ) . value ( ) ; <nl> + CHECK ( value . IsHeapNumber ( ) ) ; <nl> + return HeapNumber : : cast ( value ) . value ( ) ; <nl> } <nl> } <nl> <nl> TEST ( DoScavenge ) { <nl> double boom_value = bit_cast < double > ( fake_object ) ; <nl> <nl> FieldIndex field_index = FieldIndex : : ForDescriptor ( obj - > map ( ) , 0 ) ; <nl> - auto boom_number = factory - > NewMutableHeapNumber ( boom_value ) ; <nl> + auto boom_number = factory - > NewHeapNumber ( boom_value ) ; <nl> obj - > FastPropertyAtPut ( field_index , * boom_number ) ; <nl> <nl> / / Now | obj | moves to old gen and it has a double field that looks like <nl> mmm a / test / mjsunit / es9 / regress / regress - 904167 . js <nl> ppp b / test / mjsunit / es9 / regress / regress - 904167 . js <nl> <nl> / / as tagged , potentially dereferencing a Float64 . <nl> <nl> / / Ensure that we don ' t fail an assert from - - verify - heap when cloning a <nl> - / / MutableHeapNumber in the CloneObjectIC handler case . <nl> + / / HeapNumber in the CloneObjectIC handler case . <nl> var src , clone ; <nl> for ( var i = 0 ; i < 40000 ; i + + ) { <nl> src = { . . . i , x : - 9007199254740991 } ; <nl> mmm a / test / mjsunit / regress / regress - crbug - 734051 . js <nl> ppp b / test / mjsunit / regress / regress - crbug - 734051 . js <nl> <nl> / / Use of this source code is governed by a BSD - style license that can be <nl> / / found in the LICENSE file . <nl> <nl> - function TestMutableHeapNumberLiteral ( ) { <nl> + function TestHeapNumberLiteral ( ) { <nl> var data = { a : 0 , b : 0 } ; <nl> data . a + = 0 . 1 ; <nl> assertEquals ( 0 . 1 , data . a ) ; <nl> assertEquals ( 0 , data . b ) ; <nl> } ; <nl> - TestMutableHeapNumberLiteral ( ) ; <nl> - TestMutableHeapNumberLiteral ( ) ; <nl> - TestMutableHeapNumberLiteral ( ) ; <nl> - TestMutableHeapNumberLiteral ( ) ; <nl> - TestMutableHeapNumberLiteral ( ) ; <nl> + TestHeapNumberLiteral ( ) ; <nl> + TestHeapNumberLiteral ( ) ; <nl> + TestHeapNumberLiteral ( ) ; <nl> + TestHeapNumberLiteral ( ) ; <nl> + TestHeapNumberLiteral ( ) ; <nl> mmm a / tools / heap - stats / categories . js <nl> ppp b / tools / heap - stats / categories . js <nl> const CATEGORIES = new Map ( [ <nl> ' JS_TO_WASM_FUNCTION ' , <nl> ' JS_TYPED_ARRAY_TYPE ' , <nl> ' JS_WEAK_MAP_TYPE ' , <nl> - ' MUTABLE_HEAP_NUMBER_TYPE ' , <nl> + ' HEAP_NUMBER_TYPE ' , <nl> ' NATIVE_CONTEXT_TYPE ' , <nl> ' OBJECT_PROPERTY_DICTIONARY_TYPE ' , <nl> ' ONE_BYTE_INTERNALIZED_STRING_TYPE ' , <nl> mmm a / tools / v8heapconst . py <nl> ppp b / tools / v8heapconst . py <nl> <nl> 67 : " ODDBALL_TYPE " , <nl> 68 : " MAP_TYPE " , <nl> 69 : " CODE_TYPE " , <nl> - 70 : " MUTABLE_HEAP_NUMBER_TYPE " , <nl> - 71 : " FOREIGN_TYPE " , <nl> - 72 : " BYTE_ARRAY_TYPE " , <nl> - 73 : " BYTECODE_ARRAY_TYPE " , <nl> - 74 : " FREE_SPACE_TYPE " , <nl> - 75 : " FIXED_DOUBLE_ARRAY_TYPE " , <nl> - 76 : " FEEDBACK_METADATA_TYPE " , <nl> - 77 : " FILLER_TYPE " , <nl> - 78 : " ACCESS_CHECK_INFO_TYPE " , <nl> - 79 : " ACCESSOR_INFO_TYPE " , <nl> - 80 : " ACCESSOR_PAIR_TYPE " , <nl> - 81 : " ALIASED_ARGUMENTS_ENTRY_TYPE " , <nl> - 82 : " ALLOCATION_MEMENTO_TYPE " , <nl> - 83 : " ARRAY_BOILERPLATE_DESCRIPTION_TYPE " , <nl> - 84 : " ASM_WASM_DATA_TYPE " , <nl> - 85 : " ASYNC_GENERATOR_REQUEST_TYPE " , <nl> - 86 : " CLASS_POSITIONS_TYPE " , <nl> - 87 : " DEBUG_INFO_TYPE " , <nl> - 88 : " ENUM_CACHE_TYPE " , <nl> - 89 : " FUNCTION_TEMPLATE_INFO_TYPE " , <nl> - 90 : " FUNCTION_TEMPLATE_RARE_DATA_TYPE " , <nl> - 91 : " INTERCEPTOR_INFO_TYPE " , <nl> - 92 : " INTERPRETER_DATA_TYPE " , <nl> - 93 : " OBJECT_TEMPLATE_INFO_TYPE " , <nl> - 94 : " PROMISE_CAPABILITY_TYPE " , <nl> - 95 : " PROMISE_REACTION_TYPE " , <nl> - 96 : " PROTOTYPE_INFO_TYPE " , <nl> - 97 : " SCRIPT_TYPE " , <nl> - 98 : " SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE " , <nl> - 99 : " SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE " , <nl> - 100 : " STACK_FRAME_INFO_TYPE " , <nl> - 101 : " STACK_TRACE_FRAME_TYPE " , <nl> - 102 : " TEMPLATE_OBJECT_DESCRIPTION_TYPE " , <nl> - 103 : " TUPLE2_TYPE " , <nl> - 104 : " TUPLE3_TYPE " , <nl> - 105 : " WASM_CAPI_FUNCTION_DATA_TYPE " , <nl> - 106 : " WASM_DEBUG_INFO_TYPE " , <nl> - 107 : " WASM_EXCEPTION_TAG_TYPE " , <nl> - 108 : " WASM_EXPORTED_FUNCTION_DATA_TYPE " , <nl> - 109 : " WASM_INDIRECT_FUNCTION_TABLE_TYPE " , <nl> - 110 : " WASM_JS_FUNCTION_DATA_TYPE " , <nl> - 111 : " CALLABLE_TASK_TYPE " , <nl> - 112 : " CALLBACK_TASK_TYPE " , <nl> - 113 : " PROMISE_FULFILL_REACTION_JOB_TASK_TYPE " , <nl> - 114 : " PROMISE_REJECT_REACTION_JOB_TASK_TYPE " , <nl> - 115 : " PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE " , <nl> - 116 : " INTERNAL_CLASS_TYPE " , <nl> - 117 : " SMI_PAIR_TYPE " , <nl> - 118 : " SMI_BOX_TYPE " , <nl> - 119 : " SORT_STATE_TYPE " , <nl> - 120 : " SOURCE_TEXT_MODULE_TYPE " , <nl> - 121 : " SYNTHETIC_MODULE_TYPE " , <nl> - 122 : " ALLOCATION_SITE_TYPE " , <nl> - 123 : " EMBEDDER_DATA_ARRAY_TYPE " , <nl> - 124 : " FIXED_ARRAY_TYPE " , <nl> - 125 : " OBJECT_BOILERPLATE_DESCRIPTION_TYPE " , <nl> - 126 : " CLOSURE_FEEDBACK_CELL_ARRAY_TYPE " , <nl> - 127 : " HASH_TABLE_TYPE " , <nl> - 128 : " ORDERED_HASH_MAP_TYPE " , <nl> - 129 : " ORDERED_HASH_SET_TYPE " , <nl> - 130 : " ORDERED_NAME_DICTIONARY_TYPE " , <nl> - 131 : " NAME_DICTIONARY_TYPE " , <nl> - 132 : " GLOBAL_DICTIONARY_TYPE " , <nl> - 133 : " NUMBER_DICTIONARY_TYPE " , <nl> - 134 : " SIMPLE_NUMBER_DICTIONARY_TYPE " , <nl> - 135 : " STRING_TABLE_TYPE " , <nl> - 136 : " EPHEMERON_HASH_TABLE_TYPE " , <nl> - 137 : " SCOPE_INFO_TYPE " , <nl> - 138 : " SCRIPT_CONTEXT_TABLE_TYPE " , <nl> - 139 : " AWAIT_CONTEXT_TYPE " , <nl> - 140 : " BLOCK_CONTEXT_TYPE " , <nl> - 141 : " CATCH_CONTEXT_TYPE " , <nl> - 142 : " DEBUG_EVALUATE_CONTEXT_TYPE " , <nl> - 143 : " EVAL_CONTEXT_TYPE " , <nl> - 144 : " FUNCTION_CONTEXT_TYPE " , <nl> - 145 : " MODULE_CONTEXT_TYPE " , <nl> - 146 : " NATIVE_CONTEXT_TYPE " , <nl> - 147 : " SCRIPT_CONTEXT_TYPE " , <nl> - 148 : " WITH_CONTEXT_TYPE " , <nl> - 149 : " WEAK_FIXED_ARRAY_TYPE " , <nl> - 150 : " TRANSITION_ARRAY_TYPE " , <nl> - 151 : " CALL_HANDLER_INFO_TYPE " , <nl> - 152 : " CELL_TYPE " , <nl> - 153 : " CODE_DATA_CONTAINER_TYPE " , <nl> - 154 : " DESCRIPTOR_ARRAY_TYPE " , <nl> - 155 : " FEEDBACK_CELL_TYPE " , <nl> - 156 : " FEEDBACK_VECTOR_TYPE " , <nl> - 157 : " LOAD_HANDLER_TYPE " , <nl> - 158 : " PREPARSE_DATA_TYPE " , <nl> - 159 : " PROPERTY_ARRAY_TYPE " , <nl> - 160 : " PROPERTY_CELL_TYPE " , <nl> - 161 : " SHARED_FUNCTION_INFO_TYPE " , <nl> - 162 : " SMALL_ORDERED_HASH_MAP_TYPE " , <nl> - 163 : " SMALL_ORDERED_HASH_SET_TYPE " , <nl> - 164 : " SMALL_ORDERED_NAME_DICTIONARY_TYPE " , <nl> - 165 : " STORE_HANDLER_TYPE " , <nl> - 166 : " UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE " , <nl> - 167 : " UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE " , <nl> - 168 : " WEAK_ARRAY_LIST_TYPE " , <nl> - 169 : " WEAK_CELL_TYPE " , <nl> + 70 : " FOREIGN_TYPE " , <nl> + 71 : " BYTE_ARRAY_TYPE " , <nl> + 72 : " BYTECODE_ARRAY_TYPE " , <nl> + 73 : " FREE_SPACE_TYPE " , <nl> + 74 : " FIXED_DOUBLE_ARRAY_TYPE " , <nl> + 75 : " FEEDBACK_METADATA_TYPE " , <nl> + 76 : " FILLER_TYPE " , <nl> + 77 : " ACCESS_CHECK_INFO_TYPE " , <nl> + 78 : " ACCESSOR_INFO_TYPE " , <nl> + 79 : " ACCESSOR_PAIR_TYPE " , <nl> + 80 : " ALIASED_ARGUMENTS_ENTRY_TYPE " , <nl> + 81 : " ALLOCATION_MEMENTO_TYPE " , <nl> + 82 : " ARRAY_BOILERPLATE_DESCRIPTION_TYPE " , <nl> + 83 : " ASM_WASM_DATA_TYPE " , <nl> + 84 : " ASYNC_GENERATOR_REQUEST_TYPE " , <nl> + 85 : " CLASS_POSITIONS_TYPE " , <nl> + 86 : " DEBUG_INFO_TYPE " , <nl> + 87 : " ENUM_CACHE_TYPE " , <nl> + 88 : " FUNCTION_TEMPLATE_INFO_TYPE " , <nl> + 89 : " FUNCTION_TEMPLATE_RARE_DATA_TYPE " , <nl> + 90 : " INTERCEPTOR_INFO_TYPE " , <nl> + 91 : " INTERPRETER_DATA_TYPE " , <nl> + 92 : " OBJECT_TEMPLATE_INFO_TYPE " , <nl> + 93 : " PROMISE_CAPABILITY_TYPE " , <nl> + 94 : " PROMISE_REACTION_TYPE " , <nl> + 95 : " PROTOTYPE_INFO_TYPE " , <nl> + 96 : " SCRIPT_TYPE " , <nl> + 97 : " SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE " , <nl> + 98 : " SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE " , <nl> + 99 : " STACK_FRAME_INFO_TYPE " , <nl> + 100 : " STACK_TRACE_FRAME_TYPE " , <nl> + 101 : " TEMPLATE_OBJECT_DESCRIPTION_TYPE " , <nl> + 102 : " TUPLE2_TYPE " , <nl> + 103 : " TUPLE3_TYPE " , <nl> + 104 : " WASM_CAPI_FUNCTION_DATA_TYPE " , <nl> + 105 : " WASM_DEBUG_INFO_TYPE " , <nl> + 106 : " WASM_EXCEPTION_TAG_TYPE " , <nl> + 107 : " WASM_EXPORTED_FUNCTION_DATA_TYPE " , <nl> + 108 : " WASM_INDIRECT_FUNCTION_TABLE_TYPE " , <nl> + 109 : " WASM_JS_FUNCTION_DATA_TYPE " , <nl> + 110 : " CALLABLE_TASK_TYPE " , <nl> + 111 : " CALLBACK_TASK_TYPE " , <nl> + 112 : " PROMISE_FULFILL_REACTION_JOB_TASK_TYPE " , <nl> + 113 : " PROMISE_REJECT_REACTION_JOB_TASK_TYPE " , <nl> + 114 : " PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE " , <nl> + 115 : " INTERNAL_CLASS_TYPE " , <nl> + 116 : " SMI_PAIR_TYPE " , <nl> + 117 : " SMI_BOX_TYPE " , <nl> + 118 : " SORT_STATE_TYPE " , <nl> + 119 : " SOURCE_TEXT_MODULE_TYPE " , <nl> + 120 : " SYNTHETIC_MODULE_TYPE " , <nl> + 121 : " ALLOCATION_SITE_TYPE " , <nl> + 122 : " EMBEDDER_DATA_ARRAY_TYPE " , <nl> + 123 : " FIXED_ARRAY_TYPE " , <nl> + 124 : " OBJECT_BOILERPLATE_DESCRIPTION_TYPE " , <nl> + 125 : " CLOSURE_FEEDBACK_CELL_ARRAY_TYPE " , <nl> + 126 : " HASH_TABLE_TYPE " , <nl> + 127 : " ORDERED_HASH_MAP_TYPE " , <nl> + 128 : " ORDERED_HASH_SET_TYPE " , <nl> + 129 : " ORDERED_NAME_DICTIONARY_TYPE " , <nl> + 130 : " NAME_DICTIONARY_TYPE " , <nl> + 131 : " GLOBAL_DICTIONARY_TYPE " , <nl> + 132 : " NUMBER_DICTIONARY_TYPE " , <nl> + 133 : " SIMPLE_NUMBER_DICTIONARY_TYPE " , <nl> + 134 : " STRING_TABLE_TYPE " , <nl> + 135 : " EPHEMERON_HASH_TABLE_TYPE " , <nl> + 136 : " SCOPE_INFO_TYPE " , <nl> + 137 : " SCRIPT_CONTEXT_TABLE_TYPE " , <nl> + 138 : " AWAIT_CONTEXT_TYPE " , <nl> + 139 : " BLOCK_CONTEXT_TYPE " , <nl> + 140 : " CATCH_CONTEXT_TYPE " , <nl> + 141 : " DEBUG_EVALUATE_CONTEXT_TYPE " , <nl> + 142 : " EVAL_CONTEXT_TYPE " , <nl> + 143 : " FUNCTION_CONTEXT_TYPE " , <nl> + 144 : " MODULE_CONTEXT_TYPE " , <nl> + 145 : " NATIVE_CONTEXT_TYPE " , <nl> + 146 : " SCRIPT_CONTEXT_TYPE " , <nl> + 147 : " WITH_CONTEXT_TYPE " , <nl> + 148 : " WEAK_FIXED_ARRAY_TYPE " , <nl> + 149 : " TRANSITION_ARRAY_TYPE " , <nl> + 150 : " CALL_HANDLER_INFO_TYPE " , <nl> + 151 : " CELL_TYPE " , <nl> + 152 : " CODE_DATA_CONTAINER_TYPE " , <nl> + 153 : " DESCRIPTOR_ARRAY_TYPE " , <nl> + 154 : " FEEDBACK_CELL_TYPE " , <nl> + 155 : " FEEDBACK_VECTOR_TYPE " , <nl> + 156 : " LOAD_HANDLER_TYPE " , <nl> + 157 : " PREPARSE_DATA_TYPE " , <nl> + 158 : " PROPERTY_ARRAY_TYPE " , <nl> + 159 : " PROPERTY_CELL_TYPE " , <nl> + 160 : " SHARED_FUNCTION_INFO_TYPE " , <nl> + 161 : " SMALL_ORDERED_HASH_MAP_TYPE " , <nl> + 162 : " SMALL_ORDERED_HASH_SET_TYPE " , <nl> + 163 : " SMALL_ORDERED_NAME_DICTIONARY_TYPE " , <nl> + 164 : " STORE_HANDLER_TYPE " , <nl> + 165 : " UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE " , <nl> + 166 : " UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE " , <nl> + 167 : " WEAK_ARRAY_LIST_TYPE " , <nl> + 168 : " WEAK_CELL_TYPE " , <nl> 1024 : " JS_PROXY_TYPE " , <nl> 1025 : " JS_GLOBAL_OBJECT_TYPE " , <nl> 1026 : " JS_GLOBAL_PROXY_TYPE " , <nl> <nl> <nl> # List of known V8 maps . <nl> KNOWN_MAPS = { <nl> - ( " read_only_space " , 0x00111 ) : ( 74 , " FreeSpaceMap " ) , <nl> + ( " read_only_space " , 0x00111 ) : ( 73 , " FreeSpaceMap " ) , <nl> ( " read_only_space " , 0x00161 ) : ( 68 , " MetaMap " ) , <nl> ( " read_only_space " , 0x001e1 ) : ( 67 , " NullMap " ) , <nl> - ( " read_only_space " , 0x00249 ) : ( 154 , " DescriptorArrayMap " ) , <nl> - ( " read_only_space " , 0x002a9 ) : ( 149 , " WeakFixedArrayMap " ) , <nl> - ( " read_only_space " , 0x002f9 ) : ( 77 , " OnePointerFillerMap " ) , <nl> - ( " read_only_space " , 0x00349 ) : ( 77 , " TwoPointerFillerMap " ) , <nl> + ( " read_only_space " , 0x00249 ) : ( 153 , " DescriptorArrayMap " ) , <nl> + ( " read_only_space " , 0x002a9 ) : ( 148 , " WeakFixedArrayMap " ) , <nl> + ( " read_only_space " , 0x002f9 ) : ( 76 , " OnePointerFillerMap " ) , <nl> + ( " read_only_space " , 0x00349 ) : ( 76 , " TwoPointerFillerMap " ) , <nl> ( " read_only_space " , 0x003c9 ) : ( 67 , " UninitializedMap " ) , <nl> ( " read_only_space " , 0x00439 ) : ( 8 , " OneByteInternalizedStringMap " ) , <nl> ( " read_only_space " , 0x004d9 ) : ( 67 , " UndefinedMap " ) , <nl> ( " read_only_space " , 0x00539 ) : ( 65 , " HeapNumberMap " ) , <nl> ( " read_only_space " , 0x005b9 ) : ( 67 , " TheHoleMap " ) , <nl> ( " read_only_space " , 0x00661 ) : ( 67 , " BooleanMap " ) , <nl> - ( " read_only_space " , 0x00739 ) : ( 72 , " ByteArrayMap " ) , <nl> - ( " read_only_space " , 0x00789 ) : ( 124 , " FixedArrayMap " ) , <nl> - ( " read_only_space " , 0x007d9 ) : ( 124 , " FixedCOWArrayMap " ) , <nl> - ( " read_only_space " , 0x00829 ) : ( 127 , " HashTableMap " ) , <nl> + ( " read_only_space " , 0x00739 ) : ( 71 , " ByteArrayMap " ) , <nl> + ( " read_only_space " , 0x00789 ) : ( 123 , " FixedArrayMap " ) , <nl> + ( " read_only_space " , 0x007d9 ) : ( 123 , " FixedCOWArrayMap " ) , <nl> + ( " read_only_space " , 0x00829 ) : ( 126 , " HashTableMap " ) , <nl> ( " read_only_space " , 0x00879 ) : ( 64 , " SymbolMap " ) , <nl> ( " read_only_space " , 0x008c9 ) : ( 40 , " OneByteStringMap " ) , <nl> - ( " read_only_space " , 0x00919 ) : ( 137 , " ScopeInfoMap " ) , <nl> - ( " read_only_space " , 0x00969 ) : ( 161 , " SharedFunctionInfoMap " ) , <nl> + ( " read_only_space " , 0x00919 ) : ( 136 , " ScopeInfoMap " ) , <nl> + ( " read_only_space " , 0x00969 ) : ( 160 , " SharedFunctionInfoMap " ) , <nl> ( " read_only_space " , 0x009b9 ) : ( 69 , " CodeMap " ) , <nl> - ( " read_only_space " , 0x00a09 ) : ( 144 , " FunctionContextMap " ) , <nl> - ( " read_only_space " , 0x00a59 ) : ( 152 , " CellMap " ) , <nl> - ( " read_only_space " , 0x00aa9 ) : ( 160 , " GlobalPropertyCellMap " ) , <nl> - ( " read_only_space " , 0x00af9 ) : ( 71 , " ForeignMap " ) , <nl> - ( " read_only_space " , 0x00b49 ) : ( 150 , " TransitionArrayMap " ) , <nl> - ( " read_only_space " , 0x00b99 ) : ( 156 , " FeedbackVectorMap " ) , <nl> + ( " read_only_space " , 0x00a09 ) : ( 143 , " FunctionContextMap " ) , <nl> + ( " read_only_space " , 0x00a59 ) : ( 151 , " CellMap " ) , <nl> + ( " read_only_space " , 0x00aa9 ) : ( 159 , " GlobalPropertyCellMap " ) , <nl> + ( " read_only_space " , 0x00af9 ) : ( 70 , " ForeignMap " ) , <nl> + ( " read_only_space " , 0x00b49 ) : ( 149 , " TransitionArrayMap " ) , <nl> + ( " read_only_space " , 0x00b99 ) : ( 155 , " FeedbackVectorMap " ) , <nl> ( " read_only_space " , 0x00c39 ) : ( 67 , " ArgumentsMarkerMap " ) , <nl> ( " read_only_space " , 0x00cd9 ) : ( 67 , " ExceptionMap " ) , <nl> ( " read_only_space " , 0x00d79 ) : ( 67 , " TerminationExceptionMap " ) , <nl> ( " read_only_space " , 0x00e21 ) : ( 67 , " OptimizedOutMap " ) , <nl> ( " read_only_space " , 0x00ec1 ) : ( 67 , " StaleRegisterMap " ) , <nl> - ( " read_only_space " , 0x00f31 ) : ( 146 , " NativeContextMap " ) , <nl> - ( " read_only_space " , 0x00f81 ) : ( 145 , " ModuleContextMap " ) , <nl> - ( " read_only_space " , 0x00fd1 ) : ( 143 , " EvalContextMap " ) , <nl> - ( " read_only_space " , 0x01021 ) : ( 147 , " ScriptContextMap " ) , <nl> - ( " read_only_space " , 0x01071 ) : ( 139 , " AwaitContextMap " ) , <nl> - ( " read_only_space " , 0x010c1 ) : ( 140 , " BlockContextMap " ) , <nl> - ( " read_only_space " , 0x01111 ) : ( 141 , " CatchContextMap " ) , <nl> - ( " read_only_space " , 0x01161 ) : ( 148 , " WithContextMap " ) , <nl> - ( " read_only_space " , 0x011b1 ) : ( 142 , " DebugEvaluateContextMap " ) , <nl> - ( " read_only_space " , 0x01201 ) : ( 138 , " ScriptContextTableMap " ) , <nl> - ( " read_only_space " , 0x01251 ) : ( 126 , " ClosureFeedbackCellArrayMap " ) , <nl> - ( " read_only_space " , 0x012a1 ) : ( 76 , " FeedbackMetadataArrayMap " ) , <nl> - ( " read_only_space " , 0x012f1 ) : ( 124 , " ArrayListMap " ) , <nl> + ( " read_only_space " , 0x00f31 ) : ( 145 , " NativeContextMap " ) , <nl> + ( " read_only_space " , 0x00f81 ) : ( 144 , " ModuleContextMap " ) , <nl> + ( " read_only_space " , 0x00fd1 ) : ( 142 , " EvalContextMap " ) , <nl> + ( " read_only_space " , 0x01021 ) : ( 146 , " ScriptContextMap " ) , <nl> + ( " read_only_space " , 0x01071 ) : ( 138 , " AwaitContextMap " ) , <nl> + ( " read_only_space " , 0x010c1 ) : ( 139 , " BlockContextMap " ) , <nl> + ( " read_only_space " , 0x01111 ) : ( 140 , " CatchContextMap " ) , <nl> + ( " read_only_space " , 0x01161 ) : ( 147 , " WithContextMap " ) , <nl> + ( " read_only_space " , 0x011b1 ) : ( 141 , " DebugEvaluateContextMap " ) , <nl> + ( " read_only_space " , 0x01201 ) : ( 137 , " ScriptContextTableMap " ) , <nl> + ( " read_only_space " , 0x01251 ) : ( 125 , " ClosureFeedbackCellArrayMap " ) , <nl> + ( " read_only_space " , 0x012a1 ) : ( 75 , " FeedbackMetadataArrayMap " ) , <nl> + ( " read_only_space " , 0x012f1 ) : ( 123 , " ArrayListMap " ) , <nl> ( " read_only_space " , 0x01341 ) : ( 66 , " BigIntMap " ) , <nl> - ( " read_only_space " , 0x01391 ) : ( 125 , " ObjectBoilerplateDescriptionMap " ) , <nl> - ( " read_only_space " , 0x013e1 ) : ( 73 , " BytecodeArrayMap " ) , <nl> - ( " read_only_space " , 0x01431 ) : ( 153 , " CodeDataContainerMap " ) , <nl> - ( " read_only_space " , 0x01481 ) : ( 75 , " FixedDoubleArrayMap " ) , <nl> - ( " read_only_space " , 0x014d1 ) : ( 132 , " GlobalDictionaryMap " ) , <nl> - ( " read_only_space " , 0x01521 ) : ( 155 , " ManyClosuresCellMap " ) , <nl> - ( " read_only_space " , 0x01571 ) : ( 124 , " ModuleInfoMap " ) , <nl> - ( " read_only_space " , 0x015c1 ) : ( 70 , " MutableHeapNumberMap " ) , <nl> - ( " read_only_space " , 0x01611 ) : ( 131 , " NameDictionaryMap " ) , <nl> - ( " read_only_space " , 0x01661 ) : ( 155 , " NoClosuresCellMap " ) , <nl> - ( " read_only_space " , 0x016b1 ) : ( 133 , " NumberDictionaryMap " ) , <nl> - ( " read_only_space " , 0x01701 ) : ( 155 , " OneClosureCellMap " ) , <nl> - ( " read_only_space " , 0x01751 ) : ( 128 , " OrderedHashMapMap " ) , <nl> - ( " read_only_space " , 0x017a1 ) : ( 129 , " OrderedHashSetMap " ) , <nl> - ( " read_only_space " , 0x017f1 ) : ( 130 , " OrderedNameDictionaryMap " ) , <nl> - ( " read_only_space " , 0x01841 ) : ( 158 , " PreparseDataMap " ) , <nl> - ( " read_only_space " , 0x01891 ) : ( 159 , " PropertyArrayMap " ) , <nl> - ( " read_only_space " , 0x018e1 ) : ( 151 , " SideEffectCallHandlerInfoMap " ) , <nl> - ( " read_only_space " , 0x01931 ) : ( 151 , " SideEffectFreeCallHandlerInfoMap " ) , <nl> - ( " read_only_space " , 0x01981 ) : ( 151 , " NextCallSideEffectFreeCallHandlerInfoMap " ) , <nl> - ( " read_only_space " , 0x019d1 ) : ( 134 , " SimpleNumberDictionaryMap " ) , <nl> - ( " read_only_space " , 0x01a21 ) : ( 124 , " SloppyArgumentsElementsMap " ) , <nl> - ( " read_only_space " , 0x01a71 ) : ( 162 , " SmallOrderedHashMapMap " ) , <nl> - ( " read_only_space " , 0x01ac1 ) : ( 163 , " SmallOrderedHashSetMap " ) , <nl> - ( " read_only_space " , 0x01b11 ) : ( 164 , " SmallOrderedNameDictionaryMap " ) , <nl> - ( " read_only_space " , 0x01b61 ) : ( 120 , " SourceTextModuleMap " ) , <nl> - ( " read_only_space " , 0x01bb1 ) : ( 135 , " StringTableMap " ) , <nl> - ( " read_only_space " , 0x01c01 ) : ( 121 , " SyntheticModuleMap " ) , <nl> - ( " read_only_space " , 0x01c51 ) : ( 166 , " UncompiledDataWithoutPreparseDataMap " ) , <nl> - ( " read_only_space " , 0x01ca1 ) : ( 167 , " UncompiledDataWithPreparseDataMap " ) , <nl> - ( " read_only_space " , 0x01cf1 ) : ( 168 , " WeakArrayListMap " ) , <nl> - ( " read_only_space " , 0x01d41 ) : ( 136 , " EphemeronHashTableMap " ) , <nl> - ( " read_only_space " , 0x01d91 ) : ( 123 , " EmbedderDataArrayMap " ) , <nl> - ( " read_only_space " , 0x01de1 ) : ( 169 , " WeakCellMap " ) , <nl> - ( " read_only_space " , 0x01e31 ) : ( 58 , " NativeSourceStringMap " ) , <nl> - ( " read_only_space " , 0x01e81 ) : ( 32 , " StringMap " ) , <nl> - ( " read_only_space " , 0x01ed1 ) : ( 41 , " ConsOneByteStringMap " ) , <nl> - ( " read_only_space " , 0x01f21 ) : ( 33 , " ConsStringMap " ) , <nl> - ( " read_only_space " , 0x01f71 ) : ( 45 , " ThinOneByteStringMap " ) , <nl> - ( " read_only_space " , 0x01fc1 ) : ( 37 , " ThinStringMap " ) , <nl> - ( " read_only_space " , 0x02011 ) : ( 35 , " SlicedStringMap " ) , <nl> - ( " read_only_space " , 0x02061 ) : ( 43 , " SlicedOneByteStringMap " ) , <nl> - ( " read_only_space " , 0x020b1 ) : ( 34 , " ExternalStringMap " ) , <nl> - ( " read_only_space " , 0x02101 ) : ( 42 , " ExternalOneByteStringMap " ) , <nl> - ( " read_only_space " , 0x02151 ) : ( 50 , " UncachedExternalStringMap " ) , <nl> - ( " read_only_space " , 0x021a1 ) : ( 0 , " InternalizedStringMap " ) , <nl> - ( " read_only_space " , 0x021f1 ) : ( 2 , " ExternalInternalizedStringMap " ) , <nl> - ( " read_only_space " , 0x02241 ) : ( 10 , " ExternalOneByteInternalizedStringMap " ) , <nl> - ( " read_only_space " , 0x02291 ) : ( 18 , " UncachedExternalInternalizedStringMap " ) , <nl> - ( " read_only_space " , 0x022e1 ) : ( 26 , " UncachedExternalOneByteInternalizedStringMap " ) , <nl> - ( " read_only_space " , 0x02331 ) : ( 58 , " UncachedExternalOneByteStringMap " ) , <nl> - ( " read_only_space " , 0x02381 ) : ( 67 , " SelfReferenceMarkerMap " ) , <nl> - ( " read_only_space " , 0x023e9 ) : ( 88 , " EnumCacheMap " ) , <nl> - ( " read_only_space " , 0x02489 ) : ( 83 , " ArrayBoilerplateDescriptionMap " ) , <nl> - ( " read_only_space " , 0x02679 ) : ( 91 , " InterceptorInfoMap " ) , <nl> - ( " read_only_space " , 0x04f11 ) : ( 78 , " AccessCheckInfoMap " ) , <nl> - ( " read_only_space " , 0x04f61 ) : ( 79 , " AccessorInfoMap " ) , <nl> - ( " read_only_space " , 0x04fb1 ) : ( 80 , " AccessorPairMap " ) , <nl> - ( " read_only_space " , 0x05001 ) : ( 81 , " AliasedArgumentsEntryMap " ) , <nl> - ( " read_only_space " , 0x05051 ) : ( 82 , " AllocationMementoMap " ) , <nl> - ( " read_only_space " , 0x050a1 ) : ( 84 , " AsmWasmDataMap " ) , <nl> - ( " read_only_space " , 0x050f1 ) : ( 85 , " AsyncGeneratorRequestMap " ) , <nl> - ( " read_only_space " , 0x05141 ) : ( 86 , " ClassPositionsMap " ) , <nl> - ( " read_only_space " , 0x05191 ) : ( 87 , " DebugInfoMap " ) , <nl> - ( " read_only_space " , 0x051e1 ) : ( 89 , " FunctionTemplateInfoMap " ) , <nl> - ( " read_only_space " , 0x05231 ) : ( 90 , " FunctionTemplateRareDataMap " ) , <nl> - ( " read_only_space " , 0x05281 ) : ( 92 , " InterpreterDataMap " ) , <nl> - ( " read_only_space " , 0x052d1 ) : ( 93 , " ObjectTemplateInfoMap " ) , <nl> - ( " read_only_space " , 0x05321 ) : ( 94 , " PromiseCapabilityMap " ) , <nl> - ( " read_only_space " , 0x05371 ) : ( 95 , " PromiseReactionMap " ) , <nl> - ( " read_only_space " , 0x053c1 ) : ( 96 , " PrototypeInfoMap " ) , <nl> - ( " read_only_space " , 0x05411 ) : ( 97 , " ScriptMap " ) , <nl> - ( " read_only_space " , 0x05461 ) : ( 98 , " SourcePositionTableWithFrameCacheMap " ) , <nl> - ( " read_only_space " , 0x054b1 ) : ( 99 , " SourceTextModuleInfoEntryMap " ) , <nl> - ( " read_only_space " , 0x05501 ) : ( 100 , " StackFrameInfoMap " ) , <nl> - ( " read_only_space " , 0x05551 ) : ( 101 , " StackTraceFrameMap " ) , <nl> - ( " read_only_space " , 0x055a1 ) : ( 102 , " TemplateObjectDescriptionMap " ) , <nl> - ( " read_only_space " , 0x055f1 ) : ( 103 , " Tuple2Map " ) , <nl> - ( " read_only_space " , 0x05641 ) : ( 104 , " Tuple3Map " ) , <nl> - ( " read_only_space " , 0x05691 ) : ( 105 , " WasmCapiFunctionDataMap " ) , <nl> - ( " read_only_space " , 0x056e1 ) : ( 106 , " WasmDebugInfoMap " ) , <nl> - ( " read_only_space " , 0x05731 ) : ( 107 , " WasmExceptionTagMap " ) , <nl> - ( " read_only_space " , 0x05781 ) : ( 108 , " WasmExportedFunctionDataMap " ) , <nl> - ( " read_only_space " , 0x057d1 ) : ( 109 , " WasmIndirectFunctionTableMap " ) , <nl> - ( " read_only_space " , 0x05821 ) : ( 110 , " WasmJSFunctionDataMap " ) , <nl> - ( " read_only_space " , 0x05871 ) : ( 111 , " CallableTaskMap " ) , <nl> - ( " read_only_space " , 0x058c1 ) : ( 112 , " CallbackTaskMap " ) , <nl> - ( " read_only_space " , 0x05911 ) : ( 113 , " PromiseFulfillReactionJobTaskMap " ) , <nl> - ( " read_only_space " , 0x05961 ) : ( 114 , " PromiseRejectReactionJobTaskMap " ) , <nl> - ( " read_only_space " , 0x059b1 ) : ( 115 , " PromiseResolveThenableJobTaskMap " ) , <nl> - ( " read_only_space " , 0x05a01 ) : ( 116 , " InternalClassMap " ) , <nl> - ( " read_only_space " , 0x05a51 ) : ( 117 , " SmiPairMap " ) , <nl> - ( " read_only_space " , 0x05aa1 ) : ( 118 , " SmiBoxMap " ) , <nl> - ( " read_only_space " , 0x05af1 ) : ( 119 , " SortStateMap " ) , <nl> - ( " read_only_space " , 0x05b41 ) : ( 122 , " AllocationSiteWithWeakNextMap " ) , <nl> - ( " read_only_space " , 0x05b91 ) : ( 122 , " AllocationSiteWithoutWeakNextMap " ) , <nl> - ( " read_only_space " , 0x05be1 ) : ( 157 , " LoadHandler1Map " ) , <nl> - ( " read_only_space " , 0x05c31 ) : ( 157 , " LoadHandler2Map " ) , <nl> - ( " read_only_space " , 0x05c81 ) : ( 157 , " LoadHandler3Map " ) , <nl> - ( " read_only_space " , 0x05cd1 ) : ( 165 , " StoreHandler0Map " ) , <nl> - ( " read_only_space " , 0x05d21 ) : ( 165 , " StoreHandler1Map " ) , <nl> - ( " read_only_space " , 0x05d71 ) : ( 165 , " StoreHandler2Map " ) , <nl> - ( " read_only_space " , 0x05dc1 ) : ( 165 , " StoreHandler3Map " ) , <nl> + ( " read_only_space " , 0x01391 ) : ( 124 , " ObjectBoilerplateDescriptionMap " ) , <nl> + ( " read_only_space " , 0x013e1 ) : ( 72 , " BytecodeArrayMap " ) , <nl> + ( " read_only_space " , 0x01431 ) : ( 152 , " CodeDataContainerMap " ) , <nl> + ( " read_only_space " , 0x01481 ) : ( 74 , " FixedDoubleArrayMap " ) , <nl> + ( " read_only_space " , 0x014d1 ) : ( 131 , " GlobalDictionaryMap " ) , <nl> + ( " read_only_space " , 0x01521 ) : ( 154 , " ManyClosuresCellMap " ) , <nl> + ( " read_only_space " , 0x01571 ) : ( 123 , " ModuleInfoMap " ) , <nl> + ( " read_only_space " , 0x015c1 ) : ( 130 , " NameDictionaryMap " ) , <nl> + ( " read_only_space " , 0x01611 ) : ( 154 , " NoClosuresCellMap " ) , <nl> + ( " read_only_space " , 0x01661 ) : ( 132 , " NumberDictionaryMap " ) , <nl> + ( " read_only_space " , 0x016b1 ) : ( 154 , " OneClosureCellMap " ) , <nl> + ( " read_only_space " , 0x01701 ) : ( 127 , " OrderedHashMapMap " ) , <nl> + ( " read_only_space " , 0x01751 ) : ( 128 , " OrderedHashSetMap " ) , <nl> + ( " read_only_space " , 0x017a1 ) : ( 129 , " OrderedNameDictionaryMap " ) , <nl> + ( " read_only_space " , 0x017f1 ) : ( 157 , " PreparseDataMap " ) , <nl> + ( " read_only_space " , 0x01841 ) : ( 158 , " PropertyArrayMap " ) , <nl> + ( " read_only_space " , 0x01891 ) : ( 150 , " SideEffectCallHandlerInfoMap " ) , <nl> + ( " read_only_space " , 0x018e1 ) : ( 150 , " SideEffectFreeCallHandlerInfoMap " ) , <nl> + ( " read_only_space " , 0x01931 ) : ( 150 , " NextCallSideEffectFreeCallHandlerInfoMap " ) , <nl> + ( " read_only_space " , 0x01981 ) : ( 133 , " SimpleNumberDictionaryMap " ) , <nl> + ( " read_only_space " , 0x019d1 ) : ( 123 , " SloppyArgumentsElementsMap " ) , <nl> + ( " read_only_space " , 0x01a21 ) : ( 161 , " SmallOrderedHashMapMap " ) , <nl> + ( " read_only_space " , 0x01a71 ) : ( 162 , " SmallOrderedHashSetMap " ) , <nl> + ( " read_only_space " , 0x01ac1 ) : ( 163 , " SmallOrderedNameDictionaryMap " ) , <nl> + ( " read_only_space " , 0x01b11 ) : ( 119 , " SourceTextModuleMap " ) , <nl> + ( " read_only_space " , 0x01b61 ) : ( 134 , " StringTableMap " ) , <nl> + ( " read_only_space " , 0x01bb1 ) : ( 120 , " SyntheticModuleMap " ) , <nl> + ( " read_only_space " , 0x01c01 ) : ( 165 , " UncompiledDataWithoutPreparseDataMap " ) , <nl> + ( " read_only_space " , 0x01c51 ) : ( 166 , " UncompiledDataWithPreparseDataMap " ) , <nl> + ( " read_only_space " , 0x01ca1 ) : ( 167 , " WeakArrayListMap " ) , <nl> + ( " read_only_space " , 0x01cf1 ) : ( 135 , " EphemeronHashTableMap " ) , <nl> + ( " read_only_space " , 0x01d41 ) : ( 122 , " EmbedderDataArrayMap " ) , <nl> + ( " read_only_space " , 0x01d91 ) : ( 168 , " WeakCellMap " ) , <nl> + ( " read_only_space " , 0x01de1 ) : ( 58 , " NativeSourceStringMap " ) , <nl> + ( " read_only_space " , 0x01e31 ) : ( 32 , " StringMap " ) , <nl> + ( " read_only_space " , 0x01e81 ) : ( 41 , " ConsOneByteStringMap " ) , <nl> + ( " read_only_space " , 0x01ed1 ) : ( 33 , " ConsStringMap " ) , <nl> + ( " read_only_space " , 0x01f21 ) : ( 45 , " ThinOneByteStringMap " ) , <nl> + ( " read_only_space " , 0x01f71 ) : ( 37 , " ThinStringMap " ) , <nl> + ( " read_only_space " , 0x01fc1 ) : ( 35 , " SlicedStringMap " ) , <nl> + ( " read_only_space " , 0x02011 ) : ( 43 , " SlicedOneByteStringMap " ) , <nl> + ( " read_only_space " , 0x02061 ) : ( 34 , " ExternalStringMap " ) , <nl> + ( " read_only_space " , 0x020b1 ) : ( 42 , " ExternalOneByteStringMap " ) , <nl> + ( " read_only_space " , 0x02101 ) : ( 50 , " UncachedExternalStringMap " ) , <nl> + ( " read_only_space " , 0x02151 ) : ( 0 , " InternalizedStringMap " ) , <nl> + ( " read_only_space " , 0x021a1 ) : ( 2 , " ExternalInternalizedStringMap " ) , <nl> + ( " read_only_space " , 0x021f1 ) : ( 10 , " ExternalOneByteInternalizedStringMap " ) , <nl> + ( " read_only_space " , 0x02241 ) : ( 18 , " UncachedExternalInternalizedStringMap " ) , <nl> + ( " read_only_space " , 0x02291 ) : ( 26 , " UncachedExternalOneByteInternalizedStringMap " ) , <nl> + ( " read_only_space " , 0x022e1 ) : ( 58 , " UncachedExternalOneByteStringMap " ) , <nl> + ( " read_only_space " , 0x02331 ) : ( 67 , " SelfReferenceMarkerMap " ) , <nl> + ( " read_only_space " , 0x02399 ) : ( 87 , " EnumCacheMap " ) , <nl> + ( " read_only_space " , 0x02439 ) : ( 82 , " ArrayBoilerplateDescriptionMap " ) , <nl> + ( " read_only_space " , 0x02629 ) : ( 90 , " InterceptorInfoMap " ) , <nl> + ( " read_only_space " , 0x04ec1 ) : ( 77 , " AccessCheckInfoMap " ) , <nl> + ( " read_only_space " , 0x04f11 ) : ( 78 , " AccessorInfoMap " ) , <nl> + ( " read_only_space " , 0x04f61 ) : ( 79 , " AccessorPairMap " ) , <nl> + ( " read_only_space " , 0x04fb1 ) : ( 80 , " AliasedArgumentsEntryMap " ) , <nl> + ( " read_only_space " , 0x05001 ) : ( 81 , " AllocationMementoMap " ) , <nl> + ( " read_only_space " , 0x05051 ) : ( 83 , " AsmWasmDataMap " ) , <nl> + ( " read_only_space " , 0x050a1 ) : ( 84 , " AsyncGeneratorRequestMap " ) , <nl> + ( " read_only_space " , 0x050f1 ) : ( 85 , " ClassPositionsMap " ) , <nl> + ( " read_only_space " , 0x05141 ) : ( 86 , " DebugInfoMap " ) , <nl> + ( " read_only_space " , 0x05191 ) : ( 88 , " FunctionTemplateInfoMap " ) , <nl> + ( " read_only_space " , 0x051e1 ) : ( 89 , " FunctionTemplateRareDataMap " ) , <nl> + ( " read_only_space " , 0x05231 ) : ( 91 , " InterpreterDataMap " ) , <nl> + ( " read_only_space " , 0x05281 ) : ( 92 , " ObjectTemplateInfoMap " ) , <nl> + ( " read_only_space " , 0x052d1 ) : ( 93 , " PromiseCapabilityMap " ) , <nl> + ( " read_only_space " , 0x05321 ) : ( 94 , " PromiseReactionMap " ) , <nl> + ( " read_only_space " , 0x05371 ) : ( 95 , " PrototypeInfoMap " ) , <nl> + ( " read_only_space " , 0x053c1 ) : ( 96 , " ScriptMap " ) , <nl> + ( " read_only_space " , 0x05411 ) : ( 97 , " SourcePositionTableWithFrameCacheMap " ) , <nl> + ( " read_only_space " , 0x05461 ) : ( 98 , " SourceTextModuleInfoEntryMap " ) , <nl> + ( " read_only_space " , 0x054b1 ) : ( 99 , " StackFrameInfoMap " ) , <nl> + ( " read_only_space " , 0x05501 ) : ( 100 , " StackTraceFrameMap " ) , <nl> + ( " read_only_space " , 0x05551 ) : ( 101 , " TemplateObjectDescriptionMap " ) , <nl> + ( " read_only_space " , 0x055a1 ) : ( 102 , " Tuple2Map " ) , <nl> + ( " read_only_space " , 0x055f1 ) : ( 103 , " Tuple3Map " ) , <nl> + ( " read_only_space " , 0x05641 ) : ( 104 , " WasmCapiFunctionDataMap " ) , <nl> + ( " read_only_space " , 0x05691 ) : ( 105 , " WasmDebugInfoMap " ) , <nl> + ( " read_only_space " , 0x056e1 ) : ( 106 , " WasmExceptionTagMap " ) , <nl> + ( " read_only_space " , 0x05731 ) : ( 107 , " WasmExportedFunctionDataMap " ) , <nl> + ( " read_only_space " , 0x05781 ) : ( 108 , " WasmIndirectFunctionTableMap " ) , <nl> + ( " read_only_space " , 0x057d1 ) : ( 109 , " WasmJSFunctionDataMap " ) , <nl> + ( " read_only_space " , 0x05821 ) : ( 110 , " CallableTaskMap " ) , <nl> + ( " read_only_space " , 0x05871 ) : ( 111 , " CallbackTaskMap " ) , <nl> + ( " read_only_space " , 0x058c1 ) : ( 112 , " PromiseFulfillReactionJobTaskMap " ) , <nl> + ( " read_only_space " , 0x05911 ) : ( 113 , " PromiseRejectReactionJobTaskMap " ) , <nl> + ( " read_only_space " , 0x05961 ) : ( 114 , " PromiseResolveThenableJobTaskMap " ) , <nl> + ( " read_only_space " , 0x059b1 ) : ( 115 , " InternalClassMap " ) , <nl> + ( " read_only_space " , 0x05a01 ) : ( 116 , " SmiPairMap " ) , <nl> + ( " read_only_space " , 0x05a51 ) : ( 117 , " SmiBoxMap " ) , <nl> + ( " read_only_space " , 0x05aa1 ) : ( 118 , " SortStateMap " ) , <nl> + ( " read_only_space " , 0x05af1 ) : ( 121 , " AllocationSiteWithWeakNextMap " ) , <nl> + ( " read_only_space " , 0x05b41 ) : ( 121 , " AllocationSiteWithoutWeakNextMap " ) , <nl> + ( " read_only_space " , 0x05b91 ) : ( 156 , " LoadHandler1Map " ) , <nl> + ( " read_only_space " , 0x05be1 ) : ( 156 , " LoadHandler2Map " ) , <nl> + ( " read_only_space " , 0x05c31 ) : ( 156 , " LoadHandler3Map " ) , <nl> + ( " read_only_space " , 0x05c81 ) : ( 164 , " StoreHandler0Map " ) , <nl> + ( " read_only_space " , 0x05cd1 ) : ( 164 , " StoreHandler1Map " ) , <nl> + ( " read_only_space " , 0x05d21 ) : ( 164 , " StoreHandler2Map " ) , <nl> + ( " read_only_space " , 0x05d71 ) : ( 164 , " StoreHandler3Map " ) , <nl> ( " map_space " , 0x00111 ) : ( 1057 , " ExternalMap " ) , <nl> ( " map_space " , 0x00161 ) : ( 1073 , " JSMessageObjectMap " ) , <nl> } <nl> <nl> ( " read_only_space " , 0x00d49 ) : " TerminationException " , <nl> ( " read_only_space " , 0x00df1 ) : " OptimizedOut " , <nl> ( " read_only_space " , 0x00e91 ) : " StaleRegister " , <nl> - ( " read_only_space " , 0x023d1 ) : " EmptyEnumCache " , <nl> - ( " read_only_space " , 0x02439 ) : " EmptyPropertyArray " , <nl> - ( " read_only_space " , 0x02449 ) : " EmptyByteArray " , <nl> - ( " read_only_space " , 0x02459 ) : " EmptyObjectBoilerplateDescription " , <nl> - ( " read_only_space " , 0x02471 ) : " EmptyArrayBoilerplateDescription " , <nl> - ( " read_only_space " , 0x024d9 ) : " EmptyClosureFeedbackCellArray " , <nl> - ( " read_only_space " , 0x024e9 ) : " EmptySloppyArgumentsElements " , <nl> - ( " read_only_space " , 0x02509 ) : " EmptySlowElementDictionary " , <nl> - ( " read_only_space " , 0x02551 ) : " EmptyOrderedHashMap " , <nl> - ( " read_only_space " , 0x02579 ) : " EmptyOrderedHashSet " , <nl> - ( " read_only_space " , 0x025a1 ) : " EmptyFeedbackMetadata " , <nl> - ( " read_only_space " , 0x025b1 ) : " EmptyPropertyCell " , <nl> - ( " read_only_space " , 0x025d9 ) : " EmptyPropertyDictionary " , <nl> - ( " read_only_space " , 0x02629 ) : " NoOpInterceptorInfo " , <nl> - ( " read_only_space " , 0x026c9 ) : " EmptyWeakArrayList " , <nl> - ( " read_only_space " , 0x026e1 ) : " InfinityValue " , <nl> - ( " read_only_space " , 0x026f1 ) : " MinusZeroValue " , <nl> - ( " read_only_space " , 0x02701 ) : " MinusInfinityValue " , <nl> - ( " read_only_space " , 0x02711 ) : " SelfReferenceMarker " , <nl> - ( " read_only_space " , 0x02769 ) : " OffHeapTrampolineRelocationInfo " , <nl> - ( " read_only_space " , 0x02781 ) : " TrampolineTrivialCodeDataContainer " , <nl> - ( " read_only_space " , 0x02799 ) : " TrampolinePromiseRejectionCodeDataContainer " , <nl> - ( " read_only_space " , 0x027b1 ) : " GlobalThisBindingScopeInfo " , <nl> - ( " read_only_space " , 0x02819 ) : " EmptyFunctionScopeInfo " , <nl> - ( " read_only_space " , 0x02869 ) : " HashSeed " , <nl> + ( " read_only_space " , 0x02381 ) : " EmptyEnumCache " , <nl> + ( " read_only_space " , 0x023e9 ) : " EmptyPropertyArray " , <nl> + ( " read_only_space " , 0x023f9 ) : " EmptyByteArray " , <nl> + ( " read_only_space " , 0x02409 ) : " EmptyObjectBoilerplateDescription " , <nl> + ( " read_only_space " , 0x02421 ) : " EmptyArrayBoilerplateDescription " , <nl> + ( " read_only_space " , 0x02489 ) : " EmptyClosureFeedbackCellArray " , <nl> + ( " read_only_space " , 0x02499 ) : " EmptySloppyArgumentsElements " , <nl> + ( " read_only_space " , 0x024b9 ) : " EmptySlowElementDictionary " , <nl> + ( " read_only_space " , 0x02501 ) : " EmptyOrderedHashMap " , <nl> + ( " read_only_space " , 0x02529 ) : " EmptyOrderedHashSet " , <nl> + ( " read_only_space " , 0x02551 ) : " EmptyFeedbackMetadata " , <nl> + ( " read_only_space " , 0x02561 ) : " EmptyPropertyCell " , <nl> + ( " read_only_space " , 0x02589 ) : " EmptyPropertyDictionary " , <nl> + ( " read_only_space " , 0x025d9 ) : " NoOpInterceptorInfo " , <nl> + ( " read_only_space " , 0x02679 ) : " EmptyWeakArrayList " , <nl> + ( " read_only_space " , 0x02691 ) : " InfinityValue " , <nl> + ( " read_only_space " , 0x026a1 ) : " MinusZeroValue " , <nl> + ( " read_only_space " , 0x026b1 ) : " MinusInfinityValue " , <nl> + ( " read_only_space " , 0x026c1 ) : " SelfReferenceMarker " , <nl> + ( " read_only_space " , 0x02719 ) : " OffHeapTrampolineRelocationInfo " , <nl> + ( " read_only_space " , 0x02731 ) : " TrampolineTrivialCodeDataContainer " , <nl> + ( " read_only_space " , 0x02749 ) : " TrampolinePromiseRejectionCodeDataContainer " , <nl> + ( " read_only_space " , 0x02761 ) : " GlobalThisBindingScopeInfo " , <nl> + ( " read_only_space " , 0x027c9 ) : " EmptyFunctionScopeInfo " , <nl> + ( " read_only_space " , 0x02819 ) : " HashSeed " , <nl> ( " old_space " , 0x00111 ) : " ArgumentsIteratorAccessor " , <nl> ( " old_space " , 0x00181 ) : " ArrayLengthAccessor " , <nl> ( " old_space " , 0x001f1 ) : " BoundFunctionLengthAccessor " , <nl>
|
[ object ] Remove MutableHeapNumber
|
v8/v8
|
489e7deb7ea28c5bf6093b682827a0f3c8ae01e8
|
2019-08-20T19:04:04Z
|
deleted file mode 100755 <nl> index 0418251a98d . . 00000000000 <nl> mmm a / dbms / tests / test_runner . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # script to run query to databases <nl> - <nl> - function usage ( ) <nl> - { <nl> - cat < < EOF <nl> - usage : $ 0 test_queries . sql <nl> - <nl> - This script run queries from test file and check output <nl> - <nl> - OPTIONS : <nl> - - h Show this message <nl> - EOF <nl> - } <nl> - <nl> - TIMES = 1 <nl> - test_file = $ 1 <nl> - log = $ test_file " _log_ $ ( date + % H_ % M_ % d_ % m_ % Y ) " <nl> - echo " Log to $ log " <nl> - <nl> - while getopts “ h ” OPTION <nl> - do <nl> - case $ OPTION in <nl> - h ) <nl> - usage <nl> - exit 0 <nl> - ; ; <nl> - ? ) <nl> - usage <nl> - exit 0 <nl> - ; ; <nl> - esac <nl> - done <nl> - <nl> - if [ [ ! - f $ test_file ] ] ; then <nl> - echo " Not found : test file " <nl> - exit 1 <nl> - fi <nl> - <nl> - function execute ( ) <nl> - { <nl> - echo " start time : $ ( date ) " > $ log <nl> - queries = ( " $ { @ } " ) <nl> - queries_count = $ { # queries [ @ ] } <nl> - <nl> - index = 0 <nl> - while [ " $ index " - lt " $ queries_count " ] ; do <nl> - query = $ { queries [ $ index ] } <nl> - <nl> - if [ [ $ query = = " " ] ] ; then <nl> - let " index = $ index + 1 " <nl> - continue <nl> - fi <nl> - <nl> - comment_re = ' - - . * ' <nl> - if [ [ $ query = ~ $ comment_re ] ] ; then <nl> - echo " $ query " <nl> - echo <nl> - else <nl> - echo " query : " " $ query " <nl> - expect - c " # ! / bin / bash <nl> - # ! / bin / expect <nl> - <nl> - # Set timeout <nl> - set timeout 600 <nl> - <nl> - # Get arguments <nl> - set query [ lindex $ argv 0 ] <nl> - <nl> - spawn clickhouse - client - - multiline ; <nl> - expect \ " : ) \ " <nl> - send \ " $ query ; \ r \ " ; <nl> - expect \ " : ) \ " <nl> - send \ " quit \ " ; " > > " $ log " <nl> - fi <nl> - let " index = $ index + 1 " <nl> - done <nl> - <nl> - echo " stop time : $ ( date ) " > > $ log <nl> - } <nl> - <nl> - mapfile - t test_queries < $ test_file <nl> - <nl> - execute " $ { test_queries [ @ ] } " <nl> - <nl> - echo " Error list " <nl> - cat $ log <nl> - <nl> - echo <nl> - echo Error list \ : <nl> - cat $ log | grep - iP ' error | exception ' <nl>
|
dbms : removed old test script [ # METR - 2944 ] .
|
ClickHouse/ClickHouse
|
82f6b4a73d46f98411829374efc2c277fb06e781
|
2014-03-25T22:53:48Z
|
mmm a / hphp / hack / src / monitor / monitorConnection . ml <nl> ppp b / hphp / hack / src / monitor / monitorConnection . ml <nl> let connect_and_shut_down config = <nl> else Result . Ok ServerMonitorUtils . SHUTDOWN_UNVERIFIED <nl> <nl> let connect_once config handoff_options = <nl> + ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> + ( * CONNECTION HANDSHAKES * ) <nl> + ( * Explains what connect_once does + returns , and how callers use the result . * ) <nl> + ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> + ( * 1 . OPEN SOCKET . After this point we have a working stdin / stdout to the * ) <nl> + ( * process . Implemented in establish_connection . * ) <nl> + ( * | catch EConnRefused / ENoEnt / Timeout 1s when lockfile present - > * ) <nl> + ( * Result . Error Server_busy . * ) <nl> + ( * This is unexpected ! after all the monitor is always responsive , * ) <nl> + ( * and indeed start_server waits until responsive before returning . * ) <nl> + ( * - > " hh_client check / ide " - > retry from step 1 , up to 800 times . * ) <nl> + ( * The number 800 is hard - coded in 9 places through the codebase . * ) <nl> + ( * - > " hh_client start " - > print " replacing unresponsive server " * ) <nl> + ( * kill_server ; start_server ; exit . * ) <nl> + ( * | catch EConnRefused / ENoEnt / Timeout 1s when lockfile absent - > * ) <nl> + ( * Result . Error Server_missing . * ) <nl> + ( * - > " hh_client ide " - > raise Exit_with IDE_no_server . * ) <nl> + ( * - > " hh_client check " - > start_server ; retry step 1 , up to 800x . * ) <nl> + ( * - > " hh_client start " - > start_server ; exit . * ) <nl> + ( * | catch other exception - > unhandled . * ) <nl> + ( * * ) <nl> + ( * 2 . SEND VERSION ; READ VERSION ; CHECK VERSIONS . After this point we can * ) <nl> + ( * safely marshal OCaml types back and forth . Implemented in get_cstate * ) <nl> + ( * and verify_cstate . * ) <nl> + ( * | catch any exception when lockfile present - > * ) <nl> + ( * close_connection ; Result . Error Monitor_connection_failure . * ) <nl> + ( * This is unexpected ! * ) <nl> + ( * - > " hh_client check / ide " - > retry from step 1 , up to 800 times . * ) <nl> + ( * - > " hh_client start " - > print " replacing unresponsive server " * ) <nl> + ( * kill_server ; start_server ; exit . * ) <nl> + ( * | catch any exception when lockfile absent - > * ) <nl> + ( * close_connection ; Result . Error Server_missing . * ) <nl> + ( * - > " hh_client ide " - > raise Exit_with IDE_no_server * ) <nl> + ( * - > " hh_client check " - > start_server ; retry step 1 , up to 800x . * ) <nl> + ( * - > " hh_client start " - > start_server ; exit . * ) <nl> + ( * | if version numbers differ - > * ) <nl> + ( * Result . Error Build_mismatch . * ) <nl> + ( * - > " hh_client ide " - > raise Exit_with IDE_no_server . * ) <nl> + ( * - > " hh_client check " - > close_log_tailer ; retry from step 1 . * ) <nl> + ( * - > " hh_client start " - > start_server ; exit . * ) <nl> + ( * * ) <nl> + ( * 3 . SEND HANDOFF ; READ RESPONSE . After this point we have a working * ) <nl> + ( * connection to a server who we believe is ready to handle our messages . * ) <nl> + ( * Handoff is the stage of the protocol when we ' re speaking to the monitor * ) <nl> + ( * rather than directly to the server process itself . Implemented in * ) <nl> + ( * send_server_handoff_rpc and consume_prehandoff_message . * ) <nl> + ( * | response Server_name_not_found - > * ) <nl> + ( * raise Exit_with Server_name_not_found . * ) <nl> + ( * | response Server_not_alive_dormant - > * ) <nl> + ( * print " Waiting for server to start " ; retry step 5 , unlimited times . * ) <nl> + ( * | response Server_dormant_connections_limit_reached - > * ) <nl> + ( * Result . Error Server_dormant . * ) <nl> + ( * - > " hh_client ide " - > raise Exit_with IDE_no_server . * ) <nl> + ( * - > " hh_client start " - > print " Server already exists but is * ) <nl> + ( * dormant " ; exit . * ) <nl> + ( * - > " hh_client check " - > print " No server running , and connection * ) <nl> + ( * limit reached for waiting on the next server to be started . * ) <nl> + ( * Please wait patiently . " raise Exit_with No_server_running . * ) <nl> + ( * | response Server_died - > * ) <nl> + ( * print " Last killed by OOM / signal / stopped by signal / exited " ; * ) <nl> + ( * wait for server to close ; Result . Error Server_died . * ) <nl> + ( * - > " hh_client ide " - > raise Exit_with IDE_no_server . * ) <nl> + ( * - > " hh_client start " - > start_server . * ) <nl> + ( * - > " hh_client check " - > retry from step 1 , up to 800 times . * ) <nl> + ( * | catch any exception - > unhandled . * ) <nl> + ( * * ) <nl> + ( * The following two steps aren ' t implemented inside connect_once but are * ) <nl> + ( * typically done by callers after connect_once has succeeded . . . * ) <nl> + ( * * ) <nl> + ( * 4 . READ " HELLO " FROM SERVER . After this point we have evidence that the * ) <nl> + ( * server is ready to handle our messages . We basically gobble whatever * ) <nl> + ( * the server sends until it finally sends a line with just " hello " . * ) <nl> + ( * Implemented in wait_for_server_hello . * ) <nl> + ( * | read anything other than " hello " - > retry from step 4 , up to 800x . * ) <nl> + ( * | catch Timeout 1s - > retry from step 4 , up to 800 times . * ) <nl> + ( * | catch exception EndOfFile / Sys_error - > * ) <nl> + ( * raise ServerHungUp . * ) <nl> + ( * - > " hh_client ide / check " - > program exit , code = No_server_running . * ) <nl> + ( * - > clientStart never actually bothers to do step 4 . * ) <nl> + ( * | catch other exception - > unhandled . * ) <nl> + ( * * ) <nl> + ( * 5 . SEND CONNECTION TYPE ; READ RESPONSE . After this point we have * ) <nl> + ( * evidence that the server is able to handle our connection . The * ) <nl> + ( * connection type indicates Persistent vs Non - persistent . * ) <nl> + ( * | reponse Denied_due_to_existing_persistent_connection . * ) <nl> + ( * - > " hh_client lsp " - > raise Lsp . Error_server_start . * ) <nl> + ( * | catch any exception - > unhandled . * ) <nl> + ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> let open Result in <nl> connect_to_monitor config > > = fun ( ic , oc , cstate ) - > <nl> verify_cstate ic cstate > > = fun ( ) - > <nl>
|
Add docs about client - > server connection
|
facebook/hhvm
|
e8b8785ba839e5656d8fbf83d4a5e3b998cabe18
|
2017-05-17T16:04:38Z
|
mmm a / arangod / RocksDBEngine / RocksDBCounterManager . cpp <nl> ppp b / arangod / RocksDBEngine / RocksDBCounterManager . cpp <nl> void RocksDBCounterManager : : CMValue : : serialize ( VPackBuilder & b ) const { <nl> / / / Constructor needs to be called synchrunously , <nl> / / / will load counts from the db and scan the WAL <nl> RocksDBCounterManager : : RocksDBCounterManager ( rocksdb : : DB * db ) <nl> - : _syncing ( false ) , _db ( db ) { <nl> + : _lastSync ( 0 ) , _syncing ( false ) , _db ( db ) { <nl> readSettings ( ) ; <nl> readIndexEstimates ( ) ; <nl> readCounterValues ( ) ; <nl> Result RocksDBCounterManager : : sync ( bool force ) { <nl> <nl> rocksdb : : WriteOptions writeOptions ; <nl> rocksdb : : TransactionDB * db = rocksutils : : globalRocksDB ( ) ; <nl> + auto seqNumber = db - > GetLatestSequenceNumber ( ) ; <nl> std : : unique_ptr < rocksdb : : Transaction > rtrx ( <nl> db - > BeginTransaction ( writeOptions ) ) ; <nl> <nl> Result RocksDBCounterManager : : sync ( bool force ) { <nl> key . string ( ) , value ) ; <nl> if ( ! s . ok ( ) ) { <nl> rtrx - > Rollback ( ) ; <nl> - LOG_TOPIC ( WARN , Logger : : ENGINES ) < < " writing counters failed " ; <nl> - return rocksutils : : convertStatus ( s ) ; <nl> + auto rStatus = rocksutils : : convertStatus ( s ) ; <nl> + LOG_TOPIC ( WARN , Logger : : ENGINES ) < < " writing counters failed : " < < rStatus . errorMessage ( ) ; <nl> + return rStatus ; <nl> } <nl> } <nl> <nl> Result RocksDBCounterManager : : sync ( bool force ) { <nl> b . openObject ( ) ; <nl> b . add ( " tick " , VPackValue ( std : : to_string ( TRI_CurrentTickServer ( ) ) ) ) ; <nl> b . add ( " hlc " , VPackValue ( std : : to_string ( TRI_HybridLogicalClock ( ) ) ) ) ; <nl> + b . add ( " lastSync " , VPackValue ( std : : to_string ( seqNumber ) ) ) ; <nl> b . close ( ) ; <nl> <nl> VPackSlice slice = b . slice ( ) ; <nl> Result RocksDBCounterManager : : sync ( bool force ) { <nl> key . string ( ) , value ) ; <nl> <nl> if ( ! s . ok ( ) ) { <nl> - LOG_TOPIC ( WARN , Logger : : ENGINES ) < < " writing settings failed " ; <nl> + auto rStatus = rocksutils : : convertStatus ( s ) ; <nl> + LOG_TOPIC ( WARN , Logger : : ENGINES ) < < " writing settings failed : " < < rStatus . errorMessage ( ) ; <nl> rtrx - > Rollback ( ) ; <nl> - return rocksutils : : convertStatus ( s ) ; <nl> + return rStatus ; <nl> } <nl> <nl> / / Now persist the index estimates and key generators <nl> Result RocksDBCounterManager : : sync ( bool force ) { <nl> TRI_ASSERT ( rocksCollection ! = nullptr ) ; <nl> Result res = rocksCollection - > serializeIndexEstimates ( rtrx . get ( ) ) ; <nl> if ( ! res . ok ( ) ) { <nl> + LOG_TOPIC ( WARN , Logger : : ENGINES ) < < " writing index estimates failed : " < < res . errorMessage ( ) ; <nl> return res ; <nl> } <nl> <nl> res = rocksCollection - > serializeKeyGenerator ( rtrx . get ( ) ) ; <nl> if ( ! res . ok ( ) ) { <nl> + LOG_TOPIC ( WARN , Logger : : ENGINES ) < < " writing key generators failed : " < < res . errorMessage ( ) ; <nl> return res ; <nl> } <nl> } <nl> Result RocksDBCounterManager : : sync ( bool force ) { <nl> / / we have to commit all counters in one batch <nl> s = rtrx - > Commit ( ) ; <nl> if ( s . ok ( ) ) { <nl> + { <nl> + WRITE_LOCKER ( guard , _rwLock ) ; <nl> + _lastSync = seqNumber ; <nl> + } <nl> for ( std : : pair < uint64_t , CMValue > const & pair : copy ) { <nl> _syncedSeqNums [ pair . first ] = pair . second . _sequenceNum ; <nl> } <nl> void RocksDBCounterManager : : readSettings ( ) { <nl> LOG_TOPIC ( TRACE , Logger : : ENGINES ) < < " using last hlc : " < < lastHlc ; <nl> TRI_HybridLogicalClock ( lastHlc ) ; <nl> } <nl> + <nl> + _lastSync = basics : : VelocyPackHelper : : stringUInt64 ( slice . get ( " lastSync " ) ) ; <nl> + LOG_TOPIC ( TRACE , Logger : : ENGINES ) < < " last background settings sync : " <nl> + < < _lastSync ; <nl> } catch ( . . . ) { <nl> LOG_TOPIC ( WARN , Logger : : ENGINES ) <nl> < < " unable to read initial settings : invalid data " ; <nl> class WBReader final : public rocksdb : : WriteBatch : : Handler { <nl> <nl> / / / earliest safe sequence number to throw away from wal <nl> rocksdb : : SequenceNumber RocksDBCounterManager : : earliestSeqNeeded ( ) const { <nl> - rocksdb : : SequenceNumber start = UINT64_MAX ; <nl> - for ( auto const & pair : _counters ) { <nl> - start = std : : min ( start , pair . second . _sequenceNum ) ; <nl> - } <nl> - return start ; <nl> + READ_LOCKER ( guard , _rwLock ) ; <nl> + return _lastSync ; <nl> } <nl> <nl> / / / parse the WAL with the above handler parser class <nl> bool RocksDBCounterManager : : parseRocksWAL ( ) { <nl> WRITE_LOCKER ( guard , _rwLock ) ; <nl> TRI_ASSERT ( _counters . size ( ) > 0 ) ; <nl> <nl> - rocksdb : : SequenceNumber start = earliestSeqNeeded ( ) ; <nl> + rocksdb : : SequenceNumber start = _lastSync ; <nl> / / Tell the WriteBatch reader the transaction markers to look for <nl> auto handler = std : : make_unique < WBReader > ( & _estimators , & _generators ) ; <nl> <nl> mmm a / arangod / RocksDBEngine / RocksDBCounterManager . h <nl> ppp b / arangod / RocksDBEngine / RocksDBCounterManager . h <nl> class RocksDBCounterManager { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> std : : unordered_map < uint64_t , rocksdb : : SequenceNumber > _syncedSeqNums ; <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief last sync sequence number <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + rocksdb : : SequenceNumber _lastSync ; <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief currently syncing <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl>
|
Further checks / fixes for RocksDB recovery process ( )
|
arangodb/arangodb
|
e373d343c8e5a2c8f5bee4aa4e0455823bbd20c6
|
2017-08-23T09:07:10Z
|
mmm a / xbmc / cores / AudioEngine / Engines / ActiveAE / ActiveAE . cpp <nl> ppp b / xbmc / cores / AudioEngine / Engines / ActiveAE / ActiveAE . cpp <nl> void CActiveAE : : ApplySettingsToFormat ( AEAudioFormat & format , AudioSettings & sett <nl> { <nl> format . m_channelLayout = AE_CH_LAYOUT_2_0 ; <nl> } <nl> + <nl> + / / sinks may not support mono <nl> + if ( format . m_channelLayout . Count ( ) = = 1 ) <nl> + { <nl> + format . m_channelLayout = AE_CH_LAYOUT_2_0 ; <nl> + } <nl> } <nl> } <nl> <nl>
|
Merge pull request from FernetMenta / aefixes
|
xbmc/xbmc
|
1cb38f9f2877cc9138247fd986c3d320516239f8
|
2013-09-18T16:20:55Z
|
mmm a / src / Processors / Transforms / AggregatingTransform . cpp <nl> ppp b / src / Processors / Transforms / AggregatingTransform . cpp <nl> AggregatingTransform : : AggregatingTransform ( Block header , AggregatingTransformPar <nl> <nl> AggregatingTransform : : AggregatingTransform ( <nl> Block header , AggregatingTransformParamsPtr params_ , ManyAggregatedDataPtr many_data_ , <nl> - size_t current_variant , size_t temporary_data_merge_threads_ , size_t max_threads_ ) <nl> + size_t current_variant , size_t max_threads_ , size_t temporary_data_merge_threads_ ) <nl> : IProcessor ( { std : : move ( header ) } , { params_ - > getHeader ( ) } ) , params ( std : : move ( params_ ) ) <nl> , key_columns ( params - > params . keys_size ) <nl> , aggregate_columns ( params - > params . aggregates_size ) <nl> mmm a / src / Processors / Transforms / AggregatingTransform . h <nl> ppp b / src / Processors / Transforms / AggregatingTransform . h <nl> class AggregatingTransform : public IProcessor <nl> / / / For Parallel aggregating . <nl> AggregatingTransform ( Block header , AggregatingTransformParamsPtr params_ , <nl> ManyAggregatedDataPtr many_data , size_t current_variant , <nl> - size_t temporary_data_merge_threads , size_t max_threads ) ; <nl> + size_t max_threads , size_t temporary_data_merge_threads ) ; <nl> ~ AggregatingTransform ( ) override ; <nl> <nl> String getName ( ) const override { return " AggregatingTransform " ; } <nl>
|
Merge pull request from palasonic1 / palasonic - fix - params - order
|
ClickHouse/ClickHouse
|
152923aaa4521dde96be830e5cf22d5818e72cf5
|
2020-05-06T18:47:41Z
|
mmm a / bitcoin - qt . pro <nl> ppp b / bitcoin - qt . pro <nl> contains ( BITCOIN_NEED_QT_PLUGINS , 1 ) { <nl> DEFINES + = HAVE_BUILD_INFO <nl> } <nl> <nl> - # disable quite some warnings because bitcoin core " sins " a lot <nl> - QMAKE_CXXFLAGS_WARN_ON = - fdiagnostics - show - option - Wall - Wno - strict - aliasing - Wno - invalid - offsetof - Wno - unused - variable - Wno - unused - parameter - Wno - sign - compare - Wno - char - subscripts - Wno - unused - value - Wno - sequence - point - Wno - parentheses - Wno - unknown - pragmas - Wno - switch <nl> + QMAKE_CXXFLAGS_WARN_ON = - fdiagnostics - show - option - Wall - Wextra - Wformat - Wformat - security - Wno - invalid - offsetof - Wno - sign - compare - Wno - unused - parameter <nl> <nl> # Input <nl> DEPENDPATH + = src / qt src src json / include <nl> mmm a / share / qt / extract_strings_qt . py <nl> ppp b / share / qt / extract_strings_qt . py <nl> def parse_po ( text ) : <nl> messages = parse_po ( out ) <nl> <nl> f = open ( OUT_CPP , ' w ' ) <nl> - f . write ( ' # include < QtGlobal > \ n ' ) <nl> - f . write ( ' / / Automatically generated by extract_strings . py \ n ' ) <nl> - f . write ( ' static const char * bitcoin_strings [ ] = { ' ) <nl> + f . write ( " " " # include < QtGlobal > <nl> + / / Automatically generated by extract_strings . py <nl> + # ifdef __GNUC__ <nl> + # define UNUSED __attribute__ ( ( unused ) ) <nl> + # else <nl> + # define UNUSED <nl> + # endif <nl> + " " " ) <nl> + f . write ( ' static const char UNUSED * bitcoin_strings [ ] = { ' ) <nl> for ( msgid , msgstr ) in messages : <nl> if msgid ! = EMPTY : <nl> f . write ( ' QT_TRANSLATE_NOOP ( " bitcoin - core " , % s ) , \ n ' % ( ' \ n ' . join ( msgid ) ) ) <nl> mmm a / src / addrman . cpp <nl> ppp b / src / addrman . cpp <nl> bool CAddrMan : : Add_ ( const CAddress & addr , const CNetAddr & source , int64 nTimePen <nl> pinfo - > nServices | = addr . nServices ; <nl> <nl> / / do not update if no new information is present <nl> - if ( ! addr . nTime | | pinfo - > nTime & & addr . nTime < = pinfo - > nTime ) <nl> + if ( ! addr . nTime | | ( pinfo - > nTime & & addr . nTime < = pinfo - > nTime ) ) <nl> return false ; <nl> <nl> / / do not update if the entry was already in the " tried " table <nl> mmm a / src / bignum . h <nl> ppp b / src / bignum . h <nl> class CBigNum : public BIGNUM <nl> while ( isxdigit ( * psz ) ) <nl> { <nl> * this < < = 4 ; <nl> - int n = phexdigit [ * psz + + ] ; <nl> + int n = phexdigit [ ( unsigned char ) * psz + + ] ; <nl> * this + = n ; <nl> } <nl> if ( fNegative ) <nl> mmm a / src / bitcoinrpc . cpp <nl> ppp b / src / bitcoinrpc . cpp <nl> Value getbalance ( const Array & params , bool fHelp ) <nl> list < pair < CBitcoinAddress , int64 > > listSent ; <nl> wtx . GetAmounts ( allGeneratedImmature , allGeneratedMature , listReceived , listSent , allFee , strSentAccount ) ; <nl> if ( wtx . GetDepthInMainChain ( ) > = nMinDepth ) <nl> + { <nl> BOOST_FOREACH ( const PAIRTYPE ( CBitcoinAddress , int64 ) & r , listReceived ) <nl> nBalance + = r . second ; <nl> + } <nl> BOOST_FOREACH ( const PAIRTYPE ( CBitcoinAddress , int64 ) & r , listSent ) <nl> nBalance - = r . second ; <nl> nBalance - = allFee ; <nl> void ListTransactions ( const CWalletTx & wtx , const string & strAccount , int nMinDe <nl> <nl> / / Received <nl> if ( listReceived . size ( ) > 0 & & wtx . GetDepthInMainChain ( ) > = nMinDepth ) <nl> + { <nl> BOOST_FOREACH ( const PAIRTYPE ( CBitcoinAddress , int64 ) & r , listReceived ) <nl> { <nl> string account ; <nl> void ListTransactions ( const CWalletTx & wtx , const string & strAccount , int nMinDe <nl> ret . push_back ( entry ) ; <nl> } <nl> } <nl> + } <nl> } <nl> <nl> void AcentryToJSON ( const CAccountingEntry & acentry , const string & strAccount , Array & ret ) <nl> mmm a / src / db . cpp <nl> ppp b / src / db . cpp <nl> bool CTxDB : : LoadBlockIndex ( ) <nl> / / check level 4 : check whether spent txouts were spent within the main chain <nl> int nOutput = 0 ; <nl> if ( nCheckLevel > 3 ) <nl> + { <nl> BOOST_FOREACH ( const CDiskTxPos & txpos , txindex . vSpent ) <nl> { <nl> if ( ! txpos . IsNull ( ) ) <nl> bool CTxDB : : LoadBlockIndex ( ) <nl> } <nl> nOutput + + ; <nl> } <nl> + } <nl> } <nl> / / check level 5 : check whether all prevouts are marked spent <nl> if ( nCheckLevel > 4 ) <nl> + { <nl> BOOST_FOREACH ( const CTxIn & txin , tx . vin ) <nl> { <nl> CTxIndex txindex ; <nl> bool CTxDB : : LoadBlockIndex ( ) <nl> pindexFork = pindex - > pprev ; <nl> } <nl> } <nl> + } <nl> } <nl> } <nl> } <nl> mmm a / src / keystore . h <nl> ppp b / src / keystore . h <nl> class CKeyStore <nl> mutable CCriticalSection cs_KeyStore ; <nl> <nl> public : <nl> + virtual ~ CKeyStore ( ) { } <nl> + <nl> / / Add a key to the store . <nl> virtual bool AddKey ( const CKey & key ) = 0 ; <nl> <nl> mmm a / src / main . cpp <nl> ppp b / src / main . cpp <nl> bool CBlock : : ConnectBlock ( CTxDB & txdb , CBlockIndex * pindex ) <nl> / / This rule applies to all blocks whose timestamp is after March 15 , 2012 , 0 : 00 UTC . <nl> / / On testnet it is enabled as of februari 20 , 2012 , 0 : 00 UTC . <nl> if ( pindex - > nTime > 1331769600 | | ( fTestNet & & pindex - > nTime > 1329696000 ) ) <nl> + { <nl> BOOST_FOREACH ( CTransaction & tx , vtx ) <nl> { <nl> CTxIndex txindexOld ; <nl> if ( txdb . ReadTxIndex ( tx . GetHash ( ) , txindexOld ) ) <nl> + { <nl> BOOST_FOREACH ( CDiskTxPos & pos , txindexOld . vSpent ) <nl> if ( pos . IsNull ( ) ) <nl> return false ; <nl> + } <nl> } <nl> + } <nl> <nl> / / BIP16 didn ' t become active until Apr 1 2012 ( Feb 15 on testnet ) <nl> int64 nBIP16SwitchTime = fTestNet ? 1329264000 : 1333238400 ; <nl> mmm a / src / main . h <nl> ppp b / src / main . h <nl> class CTransaction <nl> <nl> / / To limit dust spam , require MIN_TX_FEE / MIN_RELAY_TX_FEE if any output is less than 0 . 01 <nl> if ( nMinFee < nBaseFee ) <nl> + { <nl> BOOST_FOREACH ( const CTxOut & txout , vout ) <nl> if ( txout . nValue < CENT ) <nl> nMinFee = nBaseFee ; <nl> + } <nl> <nl> / / Raise the price as the block approaches full <nl> if ( nBlockSize ! = 1 & & nNewBlockSize > = MAX_BLOCK_SIZE_GEN / 2 ) <nl> mmm a / src / makefile . osx <nl> ppp b / src / makefile . osx <nl> CFLAGS = - g <nl> endif <nl> <nl> # ppc doesn ' t work because we don ' t support big - endian <nl> - CFLAGS + = - Wextra - Wno - sign - compare - Wno - char - subscripts - Wno - invalid - offsetof - Wformat - security \ <nl> + CFLAGS + = - Wextra - Wno - sign - compare - Wno - invalid - offsetof - Wformat - security \ <nl> $ ( DEBUGFLAGS ) $ ( DEFS ) $ ( INCLUDEPATHS ) <nl> <nl> OBJS = \ <nl> mmm a / src / makefile . unix <nl> ppp b / src / makefile . unix <nl> LIBS + = \ <nl> <nl> DEBUGFLAGS = - g <nl> CXXFLAGS = - O2 <nl> - xCXXFLAGS = - pthread - Wextra - Wno - sign - compare - Wno - char - subscripts - Wno - invalid - offsetof - Wformat - Wformat - security \ <nl> + xCXXFLAGS = - pthread - Wall - Wextra - Wno - sign - compare - Wno - invalid - offsetof - Wno - unused - parameter - Wformat - Wformat - security \ <nl> $ ( DEBUGFLAGS ) $ ( DEFS ) $ ( HARDENING ) $ ( CXXFLAGS ) <nl> <nl> OBJS = \ <nl> mmm a / src / net . cpp <nl> ppp b / src / net . cpp <nl> void ThreadOpenConnections2 ( void * parg ) <nl> if ( fShutdown ) <nl> return ; <nl> <nl> - bool fAddSeeds = false ; <nl> - <nl> / / Add seed nodes if IRC isn ' t working <nl> bool fTOR = ( fUseProxy & & addrProxy . GetPort ( ) = = 9050 ) ; <nl> if ( addrman . size ( ) = = 0 & & ( GetTime ( ) - nStart > 60 | | fTOR ) & & ! fTestNet ) <nl> void ThreadOpenConnections2 ( void * parg ) <nl> / / Choose an address to connect to based on most recently seen <nl> / / <nl> CAddress addrConnect ; <nl> - int64 nBest = std : : numeric_limits < int64 > : : min ( ) ; <nl> <nl> / / Only connect to one address per a . b . ? . ? range . <nl> / / Do this here so we don ' t have to critsect vNodes inside mapAddresses critsect . <nl> mmm a / src / qt / addresstablemodel . cpp <nl> ppp b / src / qt / addresstablemodel . cpp <nl> struct AddressTableEntry <nl> } ; <nl> <nl> / / Private implementation <nl> - struct AddressTablePriv <nl> + class AddressTablePriv <nl> { <nl> + public : <nl> CWallet * wallet ; <nl> QList < AddressTableEntry > cachedAddressTable ; <nl> <nl> mmm a / src / qt / bitcoinstrings . cpp <nl> ppp b / src / qt / bitcoinstrings . cpp <nl> <nl> # include < QtGlobal > <nl> / / Automatically generated by extract_strings . py <nl> - static const char * bitcoin_strings [ ] = { QT_TRANSLATE_NOOP ( " bitcoin - core " , " " <nl> + # ifdef __GNUC__ <nl> + # define UNUSED __attribute__ ( ( unused ) ) <nl> + # else <nl> + # define UNUSED <nl> + # endif <nl> + static const char UNUSED * bitcoin_strings [ ] = { QT_TRANSLATE_NOOP ( " bitcoin - core " , " " <nl> " Unable to bind to port % d on this computer . Bitcoin is probably already " <nl> " running . " ) , <nl> QT_TRANSLATE_NOOP ( " bitcoin - core " , " Warning : Disk space is low " ) , <nl> mmm a / src / qt / editaddressdialog . cpp <nl> ppp b / src / qt / editaddressdialog . cpp <nl> void EditAddressDialog : : accept ( ) <nl> tr ( " New key generation failed . " ) , <nl> QMessageBox : : Ok , QMessageBox : : Ok ) ; <nl> return ; <nl> + case AddressTableModel : : OK : <nl> + / / Failed with unknown reason . Just reject . <nl> + break ; <nl> } <nl> <nl> return ; <nl> mmm a / src / qt / sendcoinsdialog . cpp <nl> ppp b / src / qt / sendcoinsdialog . cpp <nl> void SendCoinsDialog : : on_sendButton_clicked ( ) <nl> tr ( " Error : The transaction was rejected . This might happen if some of the coins in your wallet were already spent , such as if you used a copy of wallet . dat and coins were spent in the copy but not marked as spent here . " ) , <nl> QMessageBox : : Ok , QMessageBox : : Ok ) ; <nl> break ; <nl> + case WalletModel : : Aborted : / / User aborted , nothing to do <nl> + break ; <nl> case WalletModel : : OK : <nl> accept ( ) ; <nl> break ; <nl> mmm a / src / qt / transactiontablemodel . cpp <nl> ppp b / src / qt / transactiontablemodel . cpp <nl> struct TxLessThan <nl> } ; <nl> <nl> / / Private implementation <nl> - struct TransactionTablePriv <nl> + class TransactionTablePriv <nl> { <nl> + public : <nl> TransactionTablePriv ( CWallet * wallet , TransactionTableModel * parent ) : <nl> wallet ( wallet ) , <nl> parent ( parent ) <nl> mmm a / src / qt / walletmodel . h <nl> ppp b / src / qt / walletmodel . h <nl> class WalletModel : public QObject <nl> DuplicateAddress , <nl> TransactionCreationFailed , / / Error returned when wallet is still locked <nl> TransactionCommitFailed , <nl> - Aborted , <nl> - MiscError <nl> + Aborted <nl> } ; <nl> <nl> enum EncryptionStatus <nl> mmm a / src / script . cpp <nl> ppp b / src / script . cpp <nl> bool ExtractAddresses ( const CScript & scriptPubKey , txnouttype & typeRet , vector < C <nl> if ( typeRet = = TX_MULTISIG ) <nl> { <nl> nRequiredRet = vSolutions . front ( ) [ 0 ] ; <nl> - int n = vSolutions . back ( ) [ 0 ] ; <nl> for ( int i = 1 ; i < vSolutions . size ( ) - 1 ; i + + ) <nl> { <nl> CBitcoinAddress address ; <nl> mmm a / src / uint256 . h <nl> ppp b / src / uint256 . h <nl> class base_uint <nl> / / hex string to uint <nl> static char phexdigit [ 256 ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xa , 0xb , 0xc , 0xd , 0xe , 0xf , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xa , 0xb , 0xc , 0xd , 0xe , 0xf , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; <nl> const char * pbegin = psz ; <nl> - while ( phexdigit [ * psz ] | | * psz = = ' 0 ' ) <nl> + while ( phexdigit [ ( unsigned char ) * psz ] | | * psz = = ' 0 ' ) <nl> psz + + ; <nl> psz - - ; <nl> unsigned char * p1 = ( unsigned char * ) pn ; <nl> mmm a / src / util . cpp <nl> ppp b / src / util . cpp <nl> <nl> # include " headers . h " <nl> # include " strlcpy . h " <nl> # include < boost / algorithm / string / join . hpp > <nl> + <nl> + / / Work around clang compilation problem in Boost 1 . 46 : <nl> + / / / usr / include / boost / program_options / detail / config_file . hpp : 163 : 17 : error : call to function ' to_internal ' that is neither visible in the template definition nor found by argument - dependent lookup <nl> + / / See also : http : / / stackoverflow . com / questions / 10020179 / compilation - fail - in - boost - librairies - program - options <nl> + / / http : / / clang . debian . net / status . php ? version = 3 . 0 & key = CANNOT_FIND_FUNCTION <nl> + namespace boost { <nl> + namespace program_options { <nl> + std : : string to_internal ( const std : : string & ) ; <nl> + } <nl> + } <nl> + <nl> # include < boost / program_options / detail / config_file . hpp > <nl> # include < boost / program_options / parsers . hpp > <nl> # include < boost / filesystem . hpp > <nl> vector < unsigned char > DecodeBase64 ( const char * p , bool * pfInvalid ) <nl> <nl> while ( 1 ) <nl> { <nl> - int dec = decode64_table [ * p ] ; <nl> + int dec = decode64_table [ ( unsigned char ) * p ] ; <nl> if ( dec = = - 1 ) break ; <nl> p + + ; <nl> switch ( mode ) <nl> vector < unsigned char > DecodeBase64 ( const char * p , bool * pfInvalid ) <nl> break ; <nl> <nl> case 2 : / / 4n + 2 base64 characters processed : require ' = = ' <nl> - if ( left | | p [ 0 ] ! = ' = ' | | p [ 1 ] ! = ' = ' | | decode64_table [ p [ 2 ] ] ! = - 1 ) <nl> + if ( left | | p [ 0 ] ! = ' = ' | | p [ 1 ] ! = ' = ' | | decode64_table [ ( unsigned char ) p [ 2 ] ] ! = - 1 ) <nl> * pfInvalid = true ; <nl> break ; <nl> <nl> case 3 : / / 4n + 3 base64 characters processed : require ' = ' <nl> - if ( left | | p [ 0 ] ! = ' = ' | | decode64_table [ p [ 1 ] ] ! = - 1 ) <nl> + if ( left | | p [ 0 ] ! = ' = ' | | decode64_table [ ( unsigned char ) p [ 1 ] ] ! = - 1 ) <nl> * pfInvalid = true ; <nl> break ; <nl> } <nl> mmm a / src / wallet . cpp <nl> ppp b / src / wallet . cpp <nl> void CWalletTx : : AddSupportingTransactions ( CTxDB & txdb ) <nl> vtxPrev . push_back ( tx ) ; <nl> <nl> if ( nDepth < COPY_DEPTH ) <nl> + { <nl> BOOST_FOREACH ( const CTxIn & txin , tx . vin ) <nl> vWorkQueue . push_back ( txin . prevout . hash ) ; <nl> + } <nl> } <nl> } <nl> } <nl> mmm a / src / wallet . h <nl> ppp b / src / wallet . h <nl> class CWalletTx : public CMerkleTx <nl> return false ; <nl> <nl> if ( mapPrev . empty ( ) ) <nl> + { <nl> BOOST_FOREACH ( const CMerkleTx & tx , vtxPrev ) <nl> mapPrev [ tx . GetHash ( ) ] = & tx ; <nl> + } <nl> <nl> BOOST_FOREACH ( const CTxIn & txin , ptx - > vin ) <nl> { <nl>
|
Merge pull request from laanwj / 2012_04_clang
|
bitcoin/bitcoin
|
5a701eb7ea16b87b56263996ee8e98ec89e2a3d8
|
2012-04-15T18:39:15Z
|
mmm a / src / mongo / s / chunk_manager . cpp <nl> ppp b / src / mongo / s / chunk_manager . cpp <nl> namespace { <nl> ShardVersionMap shardVersions ; <nl> Timer t ; <nl> <nl> - bool success = _load ( config , chunkMap , shards , shardVersions , oldManager ) ; <nl> + bool success = _load ( config , chunkMap , shards , & shardVersions , oldManager ) ; <nl> <nl> if ( success ) { <nl> { <nl> namespace { <nl> bool ChunkManager : : _load ( const string & config , <nl> ChunkMap & chunkMap , <nl> set < Shard > & shards , <nl> - ShardVersionMap & shardVersions , <nl> + ShardVersionMap * shardVersions , <nl> const ChunkManager * oldManager ) <nl> { <nl> <nl> namespace { <nl> / / Get the old max version <nl> _version = oldManager - > getVersion ( ) ; <nl> / / Load a copy of the old versions <nl> - shardVersions = oldManager - > _shardVersions ; <nl> + * shardVersions = oldManager - > _shardVersions ; <nl> <nl> / / Load a copy of the chunk map , replacing the chunk manager with our own <nl> const ChunkMap & oldChunkMap = oldManager - > getChunkMap ( ) ; <nl> namespace { <nl> <nl> / / Attach a diff tracker for the versioned chunk data <nl> CMConfigDiffTracker differ ( this ) ; <nl> - differ . attach ( _ns , chunkMap , _version , shardVersions ) ; <nl> + differ . attach ( _ns , chunkMap , _version , * shardVersions ) ; <nl> <nl> / / Diff tracker should * always * find at least one chunk if collection exists <nl> int diffsApplied = differ . calculateConfigDiff ( config ) ; <nl> namespace { <nl> LOG ( 2 ) < < " loaded " < < diffsApplied < < " chunks into new chunk manager for " < < _ns <nl> < < " with version " < < _version ; <nl> <nl> - / / Add all the shards we find to the shards set <nl> - for ( ShardVersionMap : : iterator it = shardVersions . begin ( ) ; it ! = shardVersions . end ( ) ; it + + ) { <nl> - shards . insert ( it - > first ) ; <nl> + / / Add all existing shards we find to the shards set <nl> + for ( ShardVersionMap : : iterator it = shardVersions - > begin ( ) ; <nl> + it ! = shardVersions - > end ( ) ; <nl> + ) { <nl> + if ( Shard : : findIfExists ( it - > first ) . ok ( ) ) { <nl> + shards . insert ( it - > first ) ; <nl> + + + it ; <nl> + } <nl> + else { <nl> + shardVersions - > erase ( it + + ) ; <nl> + } <nl> } <nl> <nl> return true ; <nl> namespace { <nl> <nl> / / Set all our data to empty <nl> chunkMap . clear ( ) ; <nl> - shardVersions . clear ( ) ; <nl> + shardVersions - > clear ( ) ; <nl> _version = ChunkVersion ( 0 , 0 , OID ( ) ) ; <nl> <nl> return true ; <nl> namespace { <nl> <nl> / / Set all our data to empty to be extra safe <nl> chunkMap . clear ( ) ; <nl> - shardVersions . clear ( ) ; <nl> + shardVersions - > clear ( ) ; <nl> _version = ChunkVersion ( 0 , 0 , OID ( ) ) ; <nl> <nl> return allInconsistent ; <nl> mmm a / src / mongo / s / chunk_manager . h <nl> ppp b / src / mongo / s / chunk_manager . h <nl> namespace mongo { <nl> bool _load ( const std : : string & config , <nl> ChunkMap & chunks , <nl> std : : set < Shard > & shards , <nl> - ShardVersionMap & shardVersions , <nl> + ShardVersionMap * shardVersions , <nl> const ChunkManager * oldManager ) ; <nl> static bool _isValid ( const ChunkMap & chunks ) ; <nl> <nl>
|
SERVER - 17586 Update ShardVersionMap in ChunkManager when shard is deleted during balancing
|
mongodb/mongo
|
465ca1774ddb7078566cb2edf0408f5881d6aae3
|
2015-03-18T13:33:32Z
|
mmm a / doc / gitian - building . md <nl> ppp b / doc / gitian - building . md <nl> First we need to log in as ` root ` to set up dependencies and make sure that our <nl> user can use the sudo command . Type / paste the following in the terminal : <nl> <nl> ` ` ` bash <nl> - apt - get install git ruby sudo apt - cacher - ng qemu - utils debootstrap lxc python - cheetah parted kpartx bridge - utils make ubuntu - archive - keyring <nl> + apt - get install git ruby sudo apt - cacher - ng qemu - utils debootstrap lxc python - cheetah parted kpartx bridge - utils make ubuntu - archive - keyring curl <nl> adduser debian sudo <nl> ` ` ` <nl> <nl>
|
Add curl to Gitian setup instrustions
|
bitcoin/bitcoin
|
ce41cf082c861cc8d333b811b3101d52d06f50ec
|
2016-03-09T09:20:16Z
|
mmm a / tensorflow / python / ops / nn . py <nl> ppp b / tensorflow / python / ops / nn . py <nl> <nl> <nl> @ @ l2_normalize <nl> @ @ local_response_normalization <nl> + @ @ sufficient_statistics <nl> + @ @ aggregate_moments <nl> @ @ moments <nl> <nl> # # Losses <nl> def separable_conv2d ( input , depthwise_filter , pointwise_filter , strides , <nl> padding = " VALID " , name = name ) <nl> <nl> <nl> + def sufficient_statistics ( x , axes , shift = True , keep_dims = False , name = None ) : <nl> + " " " Calculate the sufficient statistics for the mean and variance of ` x ` . <nl> + <nl> + These sufficient statistics are computed using the one pass algorithm on <nl> + an input that ' s optionally shifted using the value of the 1st element in ` x ` . <nl> + See : <nl> + https : / / en . wikipedia . org / wiki / Algorithms_for_calculating_variance # Computing_shifted_data <nl> + <nl> + Args : <nl> + x : A ` Tensor ` . <nl> + axes : Array of ints . Axes along which to compute mean and variance . <nl> + shift : If true , shift the data to provide more numerically stable results . <nl> + keep_dims : produce statistics with the same dimensionality as the input . <nl> + name : Name used to scope the operations that compute the sufficient stats . <nl> + <nl> + Returns : <nl> + Four ` Tensor ` objects of the same type as ` x ` : <nl> + * the count ( number of elements to average over ) . <nl> + * the ( possibly shifted ) sum of the elements in the array . <nl> + * the ( possibly shifted ) sum of squares of the elements in the array . <nl> + * the shift by which the mean must be corrected or None if ` shift ` is False . <nl> + " " " <nl> + with ops . op_scope ( [ x , axes ] , name , " sufficient_statistics " ) : <nl> + x = ops . convert_to_tensor ( x , name = " x " ) <nl> + x_shape = x . get_shape ( ) <nl> + if x_shape . is_fully_defined ( ) : <nl> + counts = 1 <nl> + m_shape = [ ] <nl> + for d in xrange ( x_shape . ndims ) : <nl> + dim = x_shape [ d ] . value <nl> + if d in set ( axes ) : <nl> + counts * = dim <nl> + dim = 1 <nl> + m_shape . append ( dim ) <nl> + counts = constant_op . constant ( counts , dtype = x . dtype ) <nl> + else : # shape needs to be inferred at runtime . <nl> + x_shape = array_ops . shape ( x ) <nl> + select_axes = sparse_ops . sparse_to_dense ( axes , array_ops . shape ( x_shape ) , <nl> + True , False ) <nl> + m_shape = math_ops . select ( select_axes , array_ops . ones_like ( x_shape ) , <nl> + x_shape ) <nl> + counts = math_ops . cast ( <nl> + math_ops . reduce_prod ( x_shape / m_shape ) , <nl> + x . dtype , <nl> + name = " count " ) <nl> + if shift : <nl> + shift_value = array_ops . slice ( x , array_ops . zeros_like ( m_shape ) , m_shape ) <nl> + m_ss = math_ops . sub ( x , shift_value ) <nl> + v_ss = math_ops . squared_difference ( x , shift_value ) <nl> + if keep_dims : <nl> + shift_value = array_ops . identity ( shift_value , name = " shift " ) <nl> + else : <nl> + shift_value = array_ops . squeeze ( shift_value , <nl> + squeeze_dims = axes , <nl> + name = " shift " ) <nl> + else : # not shift . <nl> + m_ss = x <nl> + v_ss = math_ops . square ( x ) <nl> + shift_value = None <nl> + m_ss = math_ops . reduce_sum ( m_ss , axes , keep_dims = keep_dims , name = " mean_ss " ) <nl> + v_ss = math_ops . reduce_sum ( v_ss , axes , keep_dims = keep_dims , name = " var_ss " ) <nl> + return counts , m_ss , v_ss , shift_value <nl> + <nl> + <nl> + def aggregate_moments ( counts , mean_ss , variance_ss , shift , name = None ) : <nl> + " " " Calculate the mean and variance of based on the sufficient statistics . <nl> + <nl> + Args : <nl> + counts : A ` Tensor ` containing a the total count of the data ( one value ) . <nl> + mean_ss : A ` Tensor ` containing the mean sufficient statistics : the ( possibly <nl> + shifted ) sum of the elements to average over . <nl> + variance_ss : A ` Tensor ` containing the variance sufficient statistics : the <nl> + ( possibly shifted ) squared sum of the data to compute the variance over . <nl> + shift : A ` Tensor ` containing the value by which the data is shifted for <nl> + numerical stability , or ` None ` if no shift was performed . <nl> + name : Name used to scope the operations that compute the moments . <nl> + <nl> + Returns : <nl> + Two ` Tensor ` objects : ` mean ` and ` variance ` . <nl> + " " " <nl> + with ops . op_scope ( [ counts , mean_ss , variance_ss , shift ] , name , " aggregate " ) : <nl> + divisor = math_ops . inv ( counts , name = " divisor " ) <nl> + if shift is not None : <nl> + shifted_mean = math_ops . mul ( mean_ss , divisor , name = " shifted_mean " ) <nl> + mean = math_ops . add ( shifted_mean , shift , name = " mean " ) <nl> + else : # no shift . <nl> + shifted_mean = math_ops . mul ( mean_ss , divisor , name = " mean " ) <nl> + mean = shifted_mean <nl> + variance = math_ops . sub ( <nl> + math_ops . mul ( variance_ss , divisor ) , <nl> + math_ops . square ( shifted_mean ) , <nl> + name = " variance " ) <nl> + return ( mean , variance ) <nl> + <nl> + <nl> def moments ( x , axes , name = None , keep_dims = False ) : <nl> " " " Calculate the mean and variance of ` x ` . <nl> <nl> def moments ( x , axes , name = None , keep_dims = False ) : <nl> Two ` Tensor ` objects : ` mean ` and ` variance ` . <nl> " " " <nl> with ops . op_scope ( [ x , axes ] , name , " moments " ) : <nl> - x = ops . convert_to_tensor ( x , name = " x " ) <nl> - x_shape = x . get_shape ( ) <nl> - if all ( x_shape [ d ] . value is not None for d in axes ) : <nl> - # The shape is known in the relevant axes , so we can statically <nl> - # compute the divisor . <nl> - divisor = 1 . 0 <nl> - for d in set ( axes ) : <nl> - divisor * = x . get_shape ( ) [ d ] . value <nl> - divisor = constant_op . constant ( 1 . 0 / divisor , x . dtype , name = " divisor " ) <nl> - else : <nl> - divisor = constant_op . constant ( 1 . 0 , dtype = x . dtype ) <nl> - x_dynamic_shape = array_ops . shape ( x ) <nl> - for d in set ( axes ) : <nl> - divisor * = math_ops . cast ( x_dynamic_shape [ d ] , x . dtype ) <nl> - divisor = math_ops . inv ( divisor , name = " divisor " ) <nl> - constant_axes = constant_op . constant ( axes , name = " axes " ) <nl> - # Note : We do not use Mean here because it is very slow on GPU . <nl> - mean = math_ops . mul ( <nl> - math_ops . reduce_sum ( x , <nl> - constant_axes , <nl> - keep_dims = True ) , <nl> - divisor , <nl> - name = " mean " ) <nl> - var = math_ops . mul ( <nl> - math_ops . reduce_sum ( <nl> - math_ops . squared_difference ( x , mean ) , <nl> - constant_axes , <nl> - keep_dims = keep_dims ) , <nl> - divisor , <nl> - name = " variance " ) <nl> - if keep_dims : <nl> - return mean , var <nl> - else : <nl> - return array_ops . squeeze ( mean , squeeze_dims = axes ) , var <nl> + counts , m_ss , v_ss , shift = sufficient_statistics ( x , <nl> + axes , <nl> + keep_dims = keep_dims , <nl> + name = name ) <nl> + return aggregate_moments ( counts , m_ss , v_ss , shift , name = name ) <nl> <nl> <nl> def batch_normalization ( x , <nl> mmm a / tensorflow / python / ops / nn_test . py <nl> ppp b / tensorflow / python / ops / nn_test . py <nl> def testShapedDropoutShapeError ( self ) : <nl> _ = tf . nn . dropout ( t , keep_prob , noise_shape = [ 1 , 1 ] ) <nl> <nl> <nl> - class BatchNormWithGlobalNormalizationTest ( tf . test . TestCase ) : <nl> + class BatchNormalizationTest ( tf . test . TestCase ) : <nl> <nl> def _npBatchNorm ( self , x , m , v , beta , gamma , epsilon , <nl> scale_after_normalization , shift_after_normalization ) : <nl> def testBatchNormGradImpl ( self ) : <nl> else : <nl> all_grads = sess . run ( [ dx , dm , dv , db , odx , odm , odv , odb ] ) <nl> to_check = [ " dx " , " dm " , " dv " , " db " ] <nl> - for i , n in enumerate ( to_check ) : <nl> - print ( n ) <nl> + for i , _ in enumerate ( to_check ) : <nl> self . assertAllClose ( <nl> all_grads [ i + len ( to_check ) ] , all_grads [ i ] , atol = 0 . 000001 ) <nl> <nl> def testBatchNormArbitraryShapes ( self ) : <nl> atol = 0 . 005 ) <nl> <nl> <nl> + class SufficientStatisticsTest ( tf . test . TestCase ) : <nl> + <nl> + def _npSuffStats ( self , x , axes , shift , keep_dims ) : <nl> + axis = tuple ( axes ) <nl> + if shift : <nl> + shift_value = x [ [ slice ( None ) if i not in set ( axis ) else slice ( 0 , 1 ) <nl> + for i in xrange ( x . ndim ) ] ] <nl> + m_ss = np . sum ( x - shift_value , axis = axis , keepdims = keep_dims ) <nl> + v_ss = np . sum ( <nl> + ( x - shift_value ) * ( x - shift_value ) , <nl> + axis = axis , <nl> + keepdims = keep_dims ) <nl> + else : <nl> + shift_value = None <nl> + m_ss = np . sum ( x , axis = axis , keepdims = keep_dims ) <nl> + v_ss = np . sum ( x * x , axis = axis , keepdims = keep_dims ) <nl> + count = 1 . 0 <nl> + for d in xrange ( x . ndim ) : <nl> + if d in set ( axes ) : <nl> + count * = x . shape [ d ] <nl> + if not keep_dims : <nl> + shift_value = np . squeeze ( shift_value , axis = axis ) <nl> + return count , m_ss , v_ss , shift_value <nl> + <nl> + def _opSuffStats ( self , x , axes , shift , keep_dims ) : <nl> + return tf . nn . sufficient_statistics ( x , axes , shift , keep_dims ) <nl> + <nl> + def _testSuffStats ( self , x_shape , axes , shift , keep_dims , has_shape ) : <nl> + x_val = np . random . random_sample ( x_shape ) . astype ( np . float32 ) <nl> + np_c , np_m , np_v , np_s = self . _npSuffStats ( x_val , axes , shift , keep_dims ) <nl> + for use_gpu in [ True , False ] : <nl> + with self . test_session ( use_gpu = use_gpu ) as sess : <nl> + if has_shape : <nl> + x = tf . constant ( x_val , name = " x " ) <nl> + x . set_shape ( x_shape ) <nl> + op_c , op_m , op_v , op_s = self . _opSuffStats ( x , axes , shift , keep_dims ) <nl> + if shift : <nl> + tf_c , tf_m , tf_v , tf_s = sess . run ( [ op_c , op_m , op_v , op_s ] ) <nl> + else : <nl> + tf_c , tf_m , tf_v = sess . run ( [ op_c , op_m , op_v ] ) <nl> + else : <nl> + x = tf . placeholder ( dtype = tf . float32 , <nl> + shape = [ None ] * len ( x_shape ) , <nl> + name = " x " ) <nl> + op_c , op_m , op_v , op_s = self . _opSuffStats ( x , axes , shift , keep_dims ) <nl> + if shift : <nl> + tf_c , tf_m , tf_v , tf_s = sess . run ( <nl> + [ op_c , op_m , op_v , op_s ] , <nl> + feed_dict = { x : x_val } ) <nl> + else : <nl> + tf_c , tf_m , tf_v = sess . run ( <nl> + [ op_c , op_m , op_v ] , <nl> + feed_dict = { x : x_val } ) <nl> + self . assertAllClose ( np_c , tf_c , atol = 0 . 000001 ) <nl> + self . assertAllClose ( np_m , tf_m , atol = 0 . 000001 ) <nl> + self . assertAllClose ( np_v , tf_v , atol = 0 . 000001 ) <nl> + if shift : <nl> + self . assertAllClose ( np_s , tf_s , atol = 0 . 000001 ) <nl> + <nl> + def testSuffStats ( self ) : <nl> + for has_shape in [ True , False ] : <nl> + for keep_dims in [ True , False ] : <nl> + for shift in [ True , False ] : <nl> + self . _testSuffStats ( [ 2 , 3 ] , [ 1 ] , shift , keep_dims , has_shape ) <nl> + self . _testSuffStats ( [ 2 , 3 ] , [ 0 ] , shift , keep_dims , has_shape ) <nl> + self . _testSuffStats ( [ 1 , 2 , 3 ] , [ 0 , 2 ] , shift , keep_dims , has_shape ) <nl> + <nl> + <nl> + class AggregateMomentsTest ( tf . test . TestCase ) : <nl> + <nl> + def _npAggregateMoments ( self , counts , mean_ss , variance_ss , shift ) : <nl> + mean = mean_ss / counts <nl> + variance = variance_ss / counts - mean * mean <nl> + if shift is not None : <nl> + mean + = shift <nl> + return mean , variance <nl> + <nl> + def _opAggregateMoments ( self , counts , mean_ss , variance_ss , shift ) : <nl> + return tf . nn . aggregate_moments ( counts , mean_ss , variance_ss , shift ) <nl> + <nl> + def _testAggregateMoments ( self , shape , shift ) : <nl> + counts = np . ones ( [ 1 ] ) . astype ( np . float32 ) <nl> + mean_ss = np . random . random_sample ( shape ) . astype ( np . float32 ) <nl> + variance_ss = np . random . random_sample ( shape ) . astype ( np . float32 ) <nl> + variance_ss * = variance_ss <nl> + if shift : <nl> + shift_v = np . random . random_sample ( shape ) . astype ( np . float32 ) <nl> + else : <nl> + shift_v = None <nl> + npm , npv = self . _npAggregateMoments ( counts , mean_ss , variance_ss , shift_v ) <nl> + for use_gpu in [ True , False ] : <nl> + with self . test_session ( use_gpu = use_gpu ) as sess : <nl> + tf_counts = tf . constant ( counts , name = " counts " ) <nl> + tf_mean_ss = tf . constant ( mean_ss , name = " mean_ss " ) <nl> + tf_variance_ss = tf . constant ( variance_ss , name = " variance_ss " ) <nl> + if shift : <nl> + tf_shift_v = tf . constant ( shift_v , name = " shift " ) <nl> + else : <nl> + tf_shift_v = None <nl> + opm , opv = self . _opAggregateMoments ( tf_counts , tf_mean_ss , <nl> + tf_variance_ss , tf_shift_v ) <nl> + tfm , tfv = sess . run ( [ opm , opv ] ) <nl> + self . assertAllClose ( npm , tfm , atol = 0 . 000001 ) <nl> + self . assertAllClose ( npv , tfv , atol = 0 . 000001 ) <nl> + <nl> + def testAggregateMoments ( self ) : <nl> + for shift in [ True , False ] : <nl> + self . _testAggregateMoments ( [ 3 ] , shift ) <nl> + self . _testAggregateMoments ( [ 2 , 3 ] , shift ) <nl> + <nl> + <nl> class MomentsTest ( tf . test . TestCase ) : <nl> <nl> def RunMomentTestWithDynamicShape ( self , shape , axes , keep_dims ) : <nl> def testMeanGlobalGradient ( self ) : <nl> def testVarGlobalGradient ( self ) : <nl> self . _testGlobalGradient ( from_y = " var " ) <nl> <nl> + def testOutputNamesNoKeep ( self ) : <nl> + " " " Make sure the output names are stable . " " " <nl> + with self . test_session ( ) : <nl> + mean , var = tf . nn . moments ( tf . constant ( [ 1 ] ) , [ 0 ] , keep_dims = False ) <nl> + self . assertEquals ( mean . op . name , " moments / aggregate / mean " ) <nl> + self . assertEquals ( var . op . name , " moments / aggregate / variance " ) <nl> + <nl> + def testOutputNamesKeep ( self ) : <nl> + " " " Make sure the output names are stable . " " " <nl> + with self . test_session ( ) : <nl> + mean , var = tf . nn . moments ( tf . constant ( [ 1 ] ) , [ 0 ] , keep_dims = True ) <nl> + self . assertEquals ( mean . op . name , " moments / aggregate / mean " ) <nl> + self . assertEquals ( var . op . name , " moments / aggregate / variance " ) <nl> + <nl> <nl> class ComputeSampledLogitsTest ( tf . test . TestCase ) : <nl> <nl>
|
Switch nn . moments ( ) to using a one - pass stable algorithm .
|
tensorflow/tensorflow
|
bce6216610d57f8f4b1e9e79836737df109c4e42
|
2016-02-25T17:01:18Z
|
mmm a / tensorflow / compiler / xla / client / client . cc <nl> ppp b / tensorflow / compiler / xla / client / client . cc <nl> Status Client : : TransferToInfeed ( const Literal & literal , int64 replica_id , <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + StatusOr < std : : unique_ptr < Literal > > Client : : TransferFromOutfeed ( <nl> + const Shape * shape_with_layout , int64 replica_id , <nl> + const DeviceHandle * device_handle ) { <nl> + TransferFromOutfeedRequest request ; <nl> + if ( device_handle ) { <nl> + * request . mutable_device_handle ( ) = * device_handle ; <nl> + } <nl> + request . set_replica_id ( replica_id ) ; <nl> + if ( shape_with_layout ! = nullptr ) { <nl> + * request . mutable_shape_with_layout ( ) = * shape_with_layout ; <nl> + } <nl> + TransferFromOutfeedResponse response ; <nl> + <nl> + VLOG ( 1 ) < < " making transfer from outfeed request " ; <nl> + VLOG ( 3 ) < < " TransferFromOutfeedRequest : { " < < request . DebugString ( ) < < " } " ; <nl> + Status s = stub_ - > TransferFromOutfeed ( & request , & response ) ; <nl> + VLOG ( 1 ) < < " done with request " ; <nl> + <nl> + if ( ! s . ok ( ) ) { <nl> + return s ; <nl> + } <nl> + VLOG ( 3 ) < < " TransferFromOutfeedResponse : { " < < response . DebugString ( ) < < " } " ; <nl> + <nl> + if ( ! response . has_literal ( ) ) { <nl> + return FailedPrecondition ( <nl> + " server provided response without a literal in " <nl> + " TransferToClient request " ) ; <nl> + } <nl> + <nl> + return WrapUnique ( response . release_literal ( ) ) ; <nl> + } <nl> + <nl> Status Client : : ResetDevice ( ) { <nl> ResetDeviceRequest request ; <nl> ResetDeviceResponse response ; <nl> mmm a / tensorflow / compiler / xla / client / client . h <nl> ppp b / tensorflow / compiler / xla / client / client . h <nl> class Client { <nl> Status TransferToInfeed ( const Literal & literal , int64 replica_id = 0 , <nl> const DeviceHandle * device_handle = nullptr ) ; <nl> <nl> + / / Transfers from the Outfeed of the device . <nl> + / / <nl> + / / device_handle and replica_id together specify a particular device ; a device <nl> + / / assigned for the given replica_id among the replicas that the given device <nl> + / / handle belongs to . <nl> + StatusOr < std : : unique_ptr < Literal > > TransferFromOutfeed ( <nl> + const Shape * shape_with_layout , int64 replica_id = 0 , <nl> + const DeviceHandle * device_handle = nullptr ) ; <nl> + <nl> / / Resets the device , clearing all existing state on the device . <nl> Status ResetDevice ( ) ; <nl> <nl> mmm a / tensorflow / compiler / xla / client / computation_builder . cc <nl> ppp b / tensorflow / compiler / xla / client / computation_builder . cc <nl> ComputationDataHandle ComputationBuilder : : Infeed ( const Shape & shape , <nl> } <nl> <nl> void ComputationBuilder : : Outfeed ( const ComputationDataHandle & operand , <nl> + const Shape & shape , <nl> const string & outfeed_config ) { <nl> if ( ! first_error_ . ok ( ) | | ! PrepareComputation ( ) . ok ( ) ) { <nl> return ; <nl> void ComputationBuilder : : Outfeed ( const ComputationDataHandle & operand , <nl> OutfeedRequest request ; <nl> request . set_outfeed_config ( outfeed_config ) ; <nl> * request . mutable_operand ( ) = operand ; <nl> + * request . mutable_shape ( ) = shape ; <nl> OpRequest op_request ; <nl> * op_request . mutable_outfeed_request ( ) = request ; <nl> * op_request . mutable_computation ( ) = computation_ . handle ( ) ; <nl> mmm a / tensorflow / compiler / xla / client / computation_builder . h <nl> ppp b / tensorflow / compiler / xla / client / computation_builder . h <nl> class ComputationBuilder { <nl> tensorflow : : gtl : : ArraySlice < int64 > rhs_dilation , <nl> const ConvolutionDimensionNumbers & dimension_numbers ) ; <nl> <nl> - / / Enqueues an infeed instruction onto the computation , which reads data of <nl> - / / the given shape from the infeed buffer of the device . <nl> + / / Enqueues an infeed instruction onto the computation , which writes data of <nl> + / / the given shape to the infeed buffer of the device . <nl> ComputationDataHandle Infeed ( const Shape & shape , const string & config = " " ) ; <nl> <nl> / / Enqueues an outfeed instruction onto the computation . This instruction <nl> / / generates outgoing data transfers for the given data . <nl> - void Outfeed ( const ComputationDataHandle & operand , <nl> + void Outfeed ( const ComputationDataHandle & operand , const Shape & shape , <nl> const string & outfeed_config ) ; <nl> <nl> / / Enqueues a call instruction onto the computation . <nl> mmm a / tensorflow / compiler / xla / service / generic_transfer_manager . cc <nl> ppp b / tensorflow / compiler / xla / service / generic_transfer_manager . cc <nl> Status GenericTransferManager : : TransferLiteralToInfeed ( <nl> return Unimplemented ( " Infeed is not supported on GPU ( b / 30467474 ) " ) ; <nl> } <nl> <nl> + Status GenericTransferManager : : TransferLiteralFromOutfeed ( <nl> + perftools : : gputools : : StreamExecutor * executor , const Shape & literal_shape , <nl> + Literal * literal ) { <nl> + return Unimplemented ( " Outfeed is not supported on CPU / GPU ( b / 30467474 ) " ) ; <nl> + } <nl> + <nl> Status GenericTransferManager : : ResetDevices ( <nl> tensorflow : : gtl : : ArraySlice < perftools : : gputools : : StreamExecutor * > <nl> executors ) { <nl> mmm a / tensorflow / compiler / xla / service / generic_transfer_manager . h <nl> ppp b / tensorflow / compiler / xla / service / generic_transfer_manager . h <nl> class GenericTransferManager : public TransferManager { <nl> Status TransferLiteralToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> const Literal & literal ) override ; <nl> <nl> + Status TransferLiteralFromOutfeed ( <nl> + perftools : : gputools : : StreamExecutor * executor , const Shape & literal_shape , <nl> + Literal * literal ) override ; <nl> + <nl> Status ResetDevices ( <nl> tensorflow : : gtl : : ArraySlice < perftools : : gputools : : StreamExecutor * > <nl> executors ) override ; <nl> mmm a / tensorflow / compiler / xla / service / hlo_instruction . cc <nl> ppp b / tensorflow / compiler / xla / service / hlo_instruction . cc <nl> HloInstruction : : CreateCrossReplicaSum ( const Shape & shape , <nl> } <nl> <nl> / * static * / std : : unique_ptr < HloInstruction > HloInstruction : : CreateOutfeed ( <nl> - HloInstruction * operand , tensorflow : : StringPiece outfeed_config ) { <nl> + const Shape & shape , HloInstruction * operand , <nl> + tensorflow : : StringPiece outfeed_config ) { <nl> std : : unique_ptr < HloInstruction > instruction = <nl> WrapUnique ( new HloInstruction ( HloOpcode : : kOutfeed , ShapeUtil : : MakeNil ( ) ) ) ; <nl> instruction - > AppendOperand ( operand ) ; <nl> instruction - > outfeed_config_ = outfeed_config . ToString ( ) ; <nl> + instruction - > outfeed_shape_ = shape ; <nl> return instruction ; <nl> } <nl> <nl> Status HloInstruction : : AcceptOrdered ( <nl> return visitor - > FinishVisit ( this ) ; <nl> } <nl> <nl> + const Shape & HloInstruction : : outfeed_shape ( ) const { <nl> + DCHECK_EQ ( opcode_ , HloOpcode : : kOutfeed ) ; <nl> + TF_DCHECK_OK ( ShapeUtil : : ValidateShapeWithOptionalLayout ( shape_ ) ) ; <nl> + return outfeed_shape_ ; <nl> + } <nl> + <nl> const Shape & HloInstruction : : shape ( ) const { <nl> TF_DCHECK_OK ( ShapeUtil : : ValidateShapeWithOptionalLayout ( shape_ ) ) ; <nl> return shape_ ; <nl> mmm a / tensorflow / compiler / xla / service / hlo_instruction . h <nl> ppp b / tensorflow / compiler / xla / service / hlo_instruction . h <nl> class HloInstruction { <nl> <nl> / / Creates an outfeed instruction , which outputs data . <nl> static std : : unique_ptr < HloInstruction > CreateOutfeed ( <nl> - HloInstruction * operand , tensorflow : : StringPiece outfeed_config ) ; <nl> + const Shape & shape , HloInstruction * operand , <nl> + tensorflow : : StringPiece outfeed_config ) ; <nl> <nl> / / Creates a send instruction with the given channel id , which sends the <nl> / / operand data to a unique receive instruction in another computation that <nl> class HloInstruction { <nl> / / Precondition : opcode ( ) = = HloOpcode : : kOutfeed <nl> const string & outfeed_config ( ) const ; <nl> <nl> + / / Returns the shape for the Outfeed instruction . <nl> + / / Precondition : opcode ( ) = = HloOpcode : : kOutfeed <nl> + const Shape & outfeed_shape ( ) const ; <nl> + <nl> / / Gets / sets the while_condition or while_body HloComputation for While . The <nl> / / setters should only be called by HloModule or HloComputation methods . <nl> / / <nl> class HloInstruction { <nl> / / Returns how this instruction uses elements of its ` i ` th operand . <nl> UseKind OperandElementUse ( int64 i ) const ; <nl> <nl> + / / Shape of outfeed request . <nl> + Shape outfeed_shape_ ; <nl> + <nl> / / Result shape of this instruction . <nl> Shape shape_ ; <nl> <nl> mmm a / tensorflow / compiler / xla / service / layout_assignment . cc <nl> ppp b / tensorflow / compiler / xla / service / layout_assignment . cc <nl> string LayoutConstraints : : ToString ( ) const { <nl> for ( int64 i = 0 ; i < instruction - > operand_count ( ) ; + + i ) { <nl> if ( OperandLayout ( instruction , i ) ! = nullptr ) { <nl> tensorflow : : strings : : StrAppend ( <nl> - & output , " operand ( " , i , " ) : " , <nl> - OperandLayout ( instruction , i ) - > ToString ( ) , " \ n " ) ; <nl> + & output , " operand ( " , i , <nl> + " ) : " , OperandLayout ( instruction , i ) - > ToString ( ) , " \ n " ) ; <nl> } <nl> } <nl> for ( const LogicalBuffer * buffer : <nl> Status LayoutAssignment : : AddMandatoryConstraints ( <nl> / / TODO ( b / 31425034 ) : Change infeeds to be more like parameters , with <nl> / / shapes in the ComputationLayout . <nl> shape_with_layout = & instruction - > shape ( ) ; <nl> + } else if ( instruction - > opcode ( ) = = HloOpcode : : kOutfeed ) { <nl> + / / Constrain the input to the Outfeed instruction to be the expected <nl> + / / layout of the Outfeed . <nl> + TF_RETURN_IF_ERROR ( constraints - > SetOperandLayout ( <nl> + instruction - > outfeed_shape ( ) , instruction . get ( ) , 0 ) ) ; <nl> } else if ( instruction - > opcode ( ) = = HloOpcode : : kParameter ) { <nl> / / Parameter layouts must match the respective layout in <nl> / / ComputationLayout . <nl> mmm a / tensorflow / compiler / xla / service / service . cc <nl> ppp b / tensorflow / compiler / xla / service / service . cc <nl> StatusOr < GlobalDataHandle > Service : : ExecuteAndRegisterResult ( <nl> tensorflow : : gtl : : ArraySlice < perftools : : gputools : : DeviceMemoryBase > > <nl> repeated_arguments ( backend - > Replicas ( ) . size ( ) , arguments ) ; <nl> <nl> - TF_ASSIGN_OR_RETURN ( <nl> - auto results , <nl> - executable - > ExecuteOnStreams ( run_options , repeated_arguments ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( auto results , executable - > ExecuteOnStreams ( <nl> + run_options , repeated_arguments ) ) ; <nl> TF_RET_CHECK ( ! results . empty ( ) ) ; <nl> result = results [ 0 ] ; <nl> } <nl> tensorflow : : Status Service : : TransferToServer ( const TransferToServerRequest * arg , <nl> <nl> se : : StreamExecutor * stream_executor ; <nl> if ( arg - > has_device_handle ( ) ) { <nl> - TF_ASSIGN_OR_RETURN ( <nl> - stream_executor , <nl> - execute_backend_ - > stream_executor ( arg - > device_handle ( ) . handle ( ) ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( stream_executor , execute_backend_ - > stream_executor ( <nl> + arg - > device_handle ( ) . handle ( ) ) ) ; <nl> } else { <nl> stream_executor = execute_backend_ - > default_stream_executor ( ) ; <nl> } <nl> tensorflow : : Status Service : : TransferToServer ( const TransferToServerRequest * arg , <nl> execute_backend_ . get ( ) , stream_executor - > device_ordinal ( ) , allocation , <nl> shape , StrCat ( " TransferToServer literal of size " , allocation_size ) ) ; <nl> <nl> - TF_ASSIGN_OR_RETURN ( <nl> - auto replicas , <nl> - execute_backend_ - > Replicas ( stream_executor - > device_ordinal ( ) ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( auto replicas , execute_backend_ - > Replicas ( <nl> + stream_executor - > device_ordinal ( ) ) ) ; <nl> for ( se : : StreamExecutor * executor : replicas ) { <nl> TF_RETURN_IF_ERROR ( <nl> execute_backend_ - > transfer_manager ( ) - > TransferLiteralToDevice ( <nl> tensorflow : : Status Service : : TransferToInfeed ( const TransferToInfeedRequest * arg , <nl> <nl> se : : StreamExecutor * executor ; <nl> if ( arg - > has_device_handle ( ) ) { <nl> - TF_ASSIGN_OR_RETURN ( <nl> - auto replicas , <nl> - execute_backend_ - > Replicas ( arg - > device_handle ( ) . handle ( ) ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( auto replicas , execute_backend_ - > Replicas ( <nl> + arg - > device_handle ( ) . handle ( ) ) ) ; <nl> executor = replicas [ arg - > replica_id ( ) ] ; <nl> } else { <nl> executor = execute_backend_ - > Replicas ( ) [ arg - > replica_id ( ) ] ; <nl> tensorflow : : Status Service : : TransferToInfeed ( const TransferToInfeedRequest * arg , <nl> executor , arg - > literal ( ) ) ; <nl> } <nl> <nl> + tensorflow : : Status Service : : TransferFromOutfeed ( <nl> + const TransferFromOutfeedRequest * arg , <nl> + TransferFromOutfeedResponse * result ) { <nl> + const int64 replica_count = execute_backend_ - > Replicas ( ) . size ( ) ; <nl> + if ( arg - > replica_id ( ) < 0 | | arg - > replica_id ( ) > = replica_count ) { <nl> + return FailedPrecondition ( <nl> + " The replica_id = % lld on TransferFromOutfeedRequest not in range [ 0 , " <nl> + " % lld ) " , <nl> + arg - > replica_id ( ) , replica_count ) ; <nl> + } <nl> + <nl> + se : : StreamExecutor * executor ; <nl> + if ( arg - > has_device_handle ( ) ) { <nl> + TF_ASSIGN_OR_RETURN ( auto replicas , execute_backend_ - > Replicas ( <nl> + arg - > device_handle ( ) . handle ( ) ) ) ; <nl> + executor = replicas [ arg - > replica_id ( ) ] ; <nl> + } else { <nl> + executor = execute_backend_ - > Replicas ( ) [ arg - > replica_id ( ) ] ; <nl> + } <nl> + <nl> + return execute_backend_ - > transfer_manager ( ) - > TransferLiteralFromOutfeed ( <nl> + executor , arg - > shape_with_layout ( ) , result - > mutable_literal ( ) ) ; <nl> + } <nl> + <nl> tensorflow : : Status Service : : ResetDevice ( const ResetDeviceRequest * arg , <nl> ResetDeviceResponse * result ) { <nl> return execute_backend_ - > ResetDevices ( ) ; <nl> tensorflow : : Status Service : : GetComputationShape ( <nl> VersionedComputationHandle versioned_handle = <nl> computation - > GetVersionedHandle ( ) ; <nl> <nl> - TF_ASSIGN_OR_RETURN ( <nl> - auto program_shape , <nl> - computation - > ComputeProgramShape ( versioned_handle . version ) ) ; <nl> + TF_ASSIGN_OR_RETURN ( auto program_shape , computation - > ComputeProgramShape ( <nl> + versioned_handle . version ) ) ; <nl> * result - > mutable_program_shape ( ) = * program_shape ; <nl> return tensorflow : : Status : : OK ( ) ; <nl> } <nl> mmm a / tensorflow / compiler / xla / service / service . h <nl> ppp b / tensorflow / compiler / xla / service / service . h <nl> class Service : public ServiceInterface { <nl> const TransferToInfeedRequest * arg , <nl> TransferToInfeedResponse * result ) override ; <nl> <nl> + / / Transfers data from the Outfeed othe device to the literal provided by the <nl> + / / client . <nl> + tensorflow : : Status TransferFromOutfeed ( <nl> + const TransferFromOutfeedRequest * arg , <nl> + TransferFromOutfeedResponse * result ) override ; <nl> + <nl> / / Resets devices , clearing all existing state on all the devices associated <nl> / / with this service ( including memory allocated on the devices ) . <nl> / / <nl> mmm a / tensorflow / compiler / xla / service / transfer_manager . h <nl> ppp b / tensorflow / compiler / xla / service / transfer_manager . h <nl> class TransferManager { <nl> perftools : : gputools : : StreamExecutor * executor , <nl> const Literal & literal ) = 0 ; <nl> <nl> + / / Transfers the given literal from the Outfeed interface of the device , <nl> + / / using the given executor . <nl> + virtual Status TransferLiteralFromOutfeed ( <nl> + perftools : : gputools : : StreamExecutor * executor , const Shape & literal_shape , <nl> + Literal * literal ) = 0 ; <nl> + <nl> / / Resets the devices associated with this transfer manager . <nl> virtual Status ResetDevices ( <nl> tensorflow : : gtl : : ArraySlice < perftools : : gputools : : StreamExecutor * > <nl> mmm a / tensorflow / compiler / xla / service / user_computation . cc <nl> ppp b / tensorflow / compiler / xla / service / user_computation . cc <nl> Status UserComputation : : AddOutfeedInstruction ( <nl> const OutfeedRequest & outfeed_request ) { <nl> tensorflow : : mutex_lock lock ( mutex_ ) ; <nl> <nl> + const Shape & shape = outfeed_request . shape ( ) ; <nl> + if ( ShapeUtil : : IsNestedTuple ( shape ) ) { <nl> + return InvalidArgument ( " Outfeed does not support nested tuple shapes " ) ; <nl> + } <nl> + if ( ! LayoutUtil : : HasLayout ( shape ) ) { <nl> + return InvalidArgument ( " Given shape to Outfeed must have a layout " ) ; <nl> + } <nl> + <nl> / / Verify that operand is valid . <nl> TF_RETURN_IF_ERROR ( LookUpRequest ( outfeed_request . operand ( ) ) . status ( ) ) ; <nl> <nl> Status UserComputation : : AddOutfeedInstruction ( <nl> OperationRequest & request = <nl> ( * session_computation_ . mutable_requests ( ) ) [ handle . handle ( ) ] ; <nl> * request . mutable_output_handle ( ) = handle ; <nl> - * request . mutable_output_shape ( ) = ShapeUtil : : MakeNil ( ) ; <nl> + * request . mutable_output_shape ( ) = shape ; <nl> * request . mutable_request ( ) - > mutable_outfeed_request ( ) = outfeed_request ; <nl> <nl> VLOG ( 1 ) < < " AddOutfeedInstruction ( " < < GetVersionedHandleInternal ( ) <nl> HloInstruction * ComputationLowerer : : Visit ( <nl> const OutfeedRequest & outfeed_request = <nl> request . request ( ) . outfeed_request ( ) ; <nl> HloInstruction * operand = Visit ( outfeed_request . operand ( ) , visited ) ; <nl> - hlo_instruction = <nl> - hlo_builder_ . AddInstruction ( HloInstruction : : CreateOutfeed ( <nl> - operand , outfeed_request . outfeed_config ( ) ) ) ; <nl> + hlo_instruction = hlo_builder_ . AddInstruction ( <nl> + HloInstruction : : CreateOutfeed ( outfeed_request . shape ( ) , operand , <nl> + outfeed_request . outfeed_config ( ) ) ) ; <nl> break ; <nl> } <nl> <nl> mmm a / tensorflow / compiler / xla / service_interface . h <nl> ppp b / tensorflow / compiler / xla / service_interface . h <nl> class ServiceInterface { <nl> virtual tensorflow : : Status TransferToInfeed ( <nl> const TransferToInfeedRequest * arg , TransferToInfeedResponse * result ) = 0 ; <nl> <nl> + virtual tensorflow : : Status TransferFromOutfeed ( <nl> + const TransferFromOutfeedRequest * arg , <nl> + TransferFromOutfeedResponse * result ) = 0 ; <nl> + <nl> virtual tensorflow : : Status ResetDevice ( const ResetDeviceRequest * arg , <nl> ResetDeviceResponse * result ) = 0 ; <nl> <nl> mmm a / tensorflow / compiler / xla / xla . proto <nl> ppp b / tensorflow / compiler / xla / xla . proto <nl> message TransferToClientRequest { <nl> GlobalDataHandle data = 1 ; <nl> <nl> / / This optional field directs the service to return the literal in this <nl> - / / layout . A shape is used to hold the layout to accomodate tuples . <nl> + / / layout . A shape is used to hold the layout to accommodate tuples . <nl> Shape shape_with_layout = 2 ; <nl> } <nl> <nl> message TransferToInfeedRequest { <nl> message TransferToInfeedResponse { <nl> } <nl> <nl> + message TransferFromOutfeedRequest { <nl> + / / This optional field directs the service to return the literal in this <nl> + / / layout . A shape is used to hold the layout to accommodate tuples . <nl> + Shape shape_with_layout = 1 ; <nl> + <nl> + int64 replica_id = 2 ; <nl> + DeviceHandle device_handle = 3 ; <nl> + } <nl> + <nl> + message TransferFromOutfeedResponse { <nl> + Literal literal = 1 ; <nl> + } <nl> + <nl> message ResetDeviceRequest { <nl> DeviceHandle device_handle = 1 ; <nl> } <nl> mmm a / tensorflow / compiler / xla / xla_data . proto <nl> ppp b / tensorflow / compiler / xla / xla_data . proto <nl> message InfeedRequest { <nl> } <nl> <nl> message OutfeedRequest { <nl> + / / The shape of the data returned by reading the device ' s outfeed buffer . <nl> + Shape shape = 1 ; <nl> + <nl> / / Operand to the Outfeed . Supports tuple . <nl> ComputationDataHandle operand = 2 ; <nl> <nl>
|
[ XLA ] Add basic outfeed support .
|
tensorflow/tensorflow
|
efc8f98d45df835bac2373e19f1da57e3a1ea2d0
|
2017-02-27T23:42:08Z
|
mmm a / db / queryoptimizer . cpp <nl> ppp b / db / queryoptimizer . cpp <nl> namespace mongo { <nl> _ns ( ns ) , <nl> _or ( ! query . getField ( " $ or " ) . eoo ( ) ) , <nl> _query ( query . getOwned ( ) ) , <nl> - _fros ( ns , _query ) , <nl> + _org ( ns , _query ) , <nl> _i ( ) , <nl> _honorRecordedPlan ( honorRecordedPlan ) , <nl> _bestGuessOnly ( bestGuessOnly ) , <nl> _hint ( ( hint & & ! hint - > eoo ( ) ) ? hint - > wrap ( ) : BSONObj ( ) ) , <nl> _mayYield ( mayYield ) , <nl> _tableScanned ( ) { <nl> - if ( ! order . isEmpty ( ) | | ! min . isEmpty ( ) | | ! max . isEmpty ( ) | | ! _fros . getSpecial ( ) . empty ( ) ) { <nl> + if ( ! order . isEmpty ( ) | | ! min . isEmpty ( ) | | ! max . isEmpty ( ) | | ! _org . getSpecial ( ) . empty ( ) ) { <nl> _or = false ; <nl> } <nl> if ( _or & & uselessOr ( _hint . firstElement ( ) ) ) { <nl> namespace mongo { <nl> return _currentQps - > runOp ( op ) ; <nl> } <nl> + + _i ; <nl> - auto_ptr < FieldRangeSetPair > frsp ( _fros . topFrsp ( ) ) ; <nl> - auto_ptr < FieldRangeSetPair > originalFrsp ( _fros . topFrspOriginal ( ) ) ; <nl> + auto_ptr < FieldRangeSetPair > frsp ( _org . topFrsp ( ) ) ; <nl> + auto_ptr < FieldRangeSetPair > originalFrsp ( _org . topFrspOriginal ( ) ) ; <nl> BSONElement hintElt = _hint . firstElement ( ) ; <nl> _currentQps . reset ( new QueryPlanSet ( _ns , frsp , originalFrsp , _query , BSONObj ( ) , & hintElt , _honorRecordedPlan , BSONObj ( ) , BSONObj ( ) , _bestGuessOnly , _mayYield ) ) ; <nl> shared_ptr < QueryOp > ret ( _currentQps - > runOp ( op ) ) ; <nl> namespace mongo { <nl> _tableScanned = true ; <nl> } else { <nl> / / If the full table was scanned , don ' t bother popping the last or clause . <nl> - _fros . popOrClause ( ret - > qp ( ) . nsd ( ) , ret - > qp ( ) . idxNo ( ) , ret - > qp ( ) . indexed ( ) ? ret - > qp ( ) . indexKey ( ) : BSONObj ( ) ) ; <nl> + _org . popOrClause ( ret - > qp ( ) . nsd ( ) , ret - > qp ( ) . idxNo ( ) , ret - > qp ( ) . indexed ( ) ? ret - > qp ( ) . indexKey ( ) : BSONObj ( ) ) ; <nl> } <nl> return ret ; <nl> } <nl> namespace mongo { <nl> if ( ! id ) { <nl> return true ; <nl> } <nl> - return QueryUtilIndexed : : uselessOr ( _fros , nsd , nsd - > idxNo ( * id ) ) ; <nl> + return QueryUtilIndexed : : uselessOr ( _org , nsd , nsd - > idxNo ( * id ) ) ; <nl> } <nl> - return QueryUtilIndexed : : uselessOr ( _fros , nsd , - 1 ) ; <nl> + return QueryUtilIndexed : : uselessOr ( _org , nsd , - 1 ) ; <nl> } <nl> <nl> MultiCursor : : MultiCursor ( const char * ns , const BSONObj & pattern , const BSONObj & order , shared_ptr < CursorOp > op , bool mayYield ) <nl> namespace mongo { <nl> return make_pair ( BSONObj ( ) , 0 ) ; <nl> } <nl> <nl> - bool QueryUtilIndexed : : uselessOr ( const FieldRangeOrSet & fros , NamespaceDetails * d , int hintIdx ) { <nl> - for ( list < FieldRangeSetPair > : : const_iterator i = fros . _originalOrSets . begin ( ) ; i ! = fros . _originalOrSets . end ( ) ; + + i ) { <nl> + bool QueryUtilIndexed : : uselessOr ( const OrRangeGenerator & org , NamespaceDetails * d , int hintIdx ) { <nl> + for ( list < FieldRangeSetPair > : : const_iterator i = org . _originalOrSets . begin ( ) ; i ! = org . _originalOrSets . end ( ) ; + + i ) { <nl> if ( hintIdx ! = - 1 ) { <nl> if ( ! indexUseful ( * i , d , hintIdx , BSONObj ( ) ) ) { <nl> return true ; <nl> mmm a / db / queryoptimizer . h <nl> ppp b / db / queryoptimizer . h <nl> namespace mongo { <nl> } <nl> <nl> / * * @ return true iff more $ or clauses need to be scanned . * / <nl> - bool mayRunMore ( ) const { return _or ? ( ! _tableScanned & & ! _fros . orFinished ( ) ) : _i = = 0 ; } <nl> + bool mayRunMore ( ) const { return _or ? ( ! _tableScanned & & ! _org . orFinished ( ) ) : _i = = 0 ; } <nl> / * * @ return non - $ or version of explain output . * / <nl> BSONObj oldExplain ( ) const { assertNotOr ( ) ; return _currentQps - > explain ( ) ; } <nl> / * * @ return true iff this is not a $ or query and a plan is selected based on previous success of this plan . * / <nl> namespace mongo { <nl> const char * _ns ; <nl> bool _or ; <nl> BSONObj _query ; <nl> - FieldRangeOrSet _fros ; <nl> + OrRangeGenerator _org ; <nl> auto_ptr < QueryPlanSet > _currentQps ; <nl> int _i ; <nl> bool _honorRecordedPlan ; <nl> namespace mongo { <nl> static void clearIndexesForPatterns ( const FieldRangeSetPair & frsp , const BSONObj & order ) ; <nl> / * * Return a recorded best index for the single or multi key pattern . * / <nl> static pair < BSONObj , long long > bestIndexForPatterns ( const FieldRangeSetPair & frsp , const BSONObj & order ) ; <nl> - static bool uselessOr ( const FieldRangeOrSet & fros , NamespaceDetails * d , int hintIdx ) ; <nl> + static bool uselessOr ( const OrRangeGenerator & org , NamespaceDetails * d , int hintIdx ) ; <nl> } ; <nl> <nl> } / / namespace mongo <nl> mmm a / db / queryutil - inl . h <nl> ppp b / db / queryutil - inl . h <nl> namespace mongo { <nl> return ret ; <nl> } <nl> <nl> - inline FieldRangeSetPair * FieldRangeOrSet : : topFrsp ( ) const { <nl> + inline FieldRangeSetPair * OrRangeGenerator : : topFrsp ( ) const { <nl> FieldRangeSetPair * ret = new FieldRangeSetPair ( _baseSet ) ; <nl> if ( _orSets . size ( ) ) { <nl> * ret & = _orSets . front ( ) ; <nl> namespace mongo { <nl> return ret ; <nl> } <nl> <nl> - inline FieldRangeSetPair * FieldRangeOrSet : : topFrspOriginal ( ) const { <nl> + inline FieldRangeSetPair * OrRangeGenerator : : topFrspOriginal ( ) const { <nl> FieldRangeSetPair * ret = new FieldRangeSetPair ( _baseSet ) ; <nl> if ( _originalOrSets . size ( ) ) { <nl> * ret & = _originalOrSets . front ( ) ; <nl> mmm a / db / queryutil . cpp <nl> ppp b / db / queryutil . cpp <nl> namespace mongo { <nl> return b . obj ( ) ; <nl> } <nl> <nl> - FieldRangeOrSet : : FieldRangeOrSet ( const char * ns , const BSONObj & query , bool optimize ) <nl> + OrRangeGenerator : : OrRangeGenerator ( const char * ns , const BSONObj & query , bool optimize ) <nl> : _baseSet ( ns , query , optimize ) , _orFound ( ) { <nl> <nl> BSONObjIterator i ( _baseSet . originalQuery ( ) ) ; <nl> namespace mongo { <nl> } <nl> } <nl> <nl> - void FieldRangeOrSet : : assertMayPopOrClause ( ) { <nl> + void OrRangeGenerator : : assertMayPopOrClause ( ) { <nl> massert ( 13274 , " no or clause to pop " , ! orFinished ( ) ) ; <nl> } <nl> <nl> - void FieldRangeOrSet : : popOrClause ( NamespaceDetails * nsd , int idxNo , const BSONObj & keyPattern ) { <nl> + void OrRangeGenerator : : popOrClause ( NamespaceDetails * nsd , int idxNo , const BSONObj & keyPattern ) { <nl> assertMayPopOrClause ( ) ; <nl> auto_ptr < FieldRangeSet > holder ; <nl> const FieldRangeSet * toDiff = & _originalOrSets . front ( ) . frsForIndex ( nsd , idxNo ) ; <nl> namespace mongo { <nl> popOrClause ( toDiff , nsd , idxNo , keyPattern ) ; <nl> } <nl> <nl> - void FieldRangeOrSet : : popOrClauseSingleKey ( ) { <nl> + void OrRangeGenerator : : popOrClauseSingleKey ( ) { <nl> assertMayPopOrClause ( ) ; <nl> FieldRangeSet * toDiff = & _originalOrSets . front ( ) . _singleKey ; <nl> popOrClause ( toDiff ) ; <nl> namespace mongo { <nl> * empty we do not constrain the previous clause ' s ranges using index keys , <nl> * which may reduce opportunities for range elimination . <nl> * / <nl> - void FieldRangeOrSet : : popOrClause ( const FieldRangeSet * toDiff , NamespaceDetails * d , int idxNo , const BSONObj & keyPattern ) { <nl> + void OrRangeGenerator : : popOrClause ( const FieldRangeSet * toDiff , NamespaceDetails * d , int idxNo , const BSONObj & keyPattern ) { <nl> list < FieldRangeSetPair > : : iterator i = _orSets . begin ( ) ; <nl> list < FieldRangeSetPair > : : iterator j = _originalOrSets . begin ( ) ; <nl> + + i ; <nl> mmm a / db / queryutil . h <nl> ppp b / db / queryutil . h <nl> namespace mongo { <nl> * / <nl> class FieldRangeSet { <nl> public : <nl> - friend class FieldRangeOrSet ; <nl> + friend class OrRangeGenerator ; <nl> friend class FieldRangeVector ; <nl> FieldRangeSet ( const char * ns , const BSONObj & query , bool singleKey , bool optimize = true ) ; <nl> <nl> namespace mongo { <nl> BSONObj simplifiedQueryForIndex ( NamespaceDetails * d , int idxNo , const BSONObj & keyPattern ) const ; <nl> FieldRangeSet _singleKey ; <nl> FieldRangeSet _multiKey ; <nl> - friend class FieldRangeOrSet ; <nl> + friend class OrRangeGenerator ; <nl> friend struct QueryUtilIndexed ; <nl> } ; <nl> <nl> namespace mongo { <nl> * for the current $ or clause , in some cases by excluding ranges that were <nl> * included in a previous clause . <nl> * / <nl> - class FieldRangeOrSet { <nl> + class OrRangeGenerator { <nl> public : <nl> - FieldRangeOrSet ( const char * ns , const BSONObj & query , bool optimize = true ) ; <nl> + OrRangeGenerator ( const char * ns , const BSONObj & query , bool optimize = true ) ; <nl> <nl> / * * <nl> * @ return true iff we are done scanning $ or clauses . if there ' s a <nl> mmm a / s / chunk . cpp <nl> ppp b / s / chunk . cpp <nl> namespace mongo { <nl> rwlock lk ( _lock , false ) ; <nl> <nl> / / TODO look into FieldRangeSetOr <nl> - FieldRangeOrSet fros ( _ns . c_str ( ) , query , false ) ; <nl> + OrRangeGenerator org ( _ns . c_str ( ) , query , false ) ; <nl> <nl> - const string special = fros . getSpecial ( ) ; <nl> + const string special = org . getSpecial ( ) ; <nl> if ( special = = " 2d " ) { <nl> BSONForEach ( field , query ) { <nl> if ( getGtLtOp ( field ) = = BSONObj : : opNEAR ) { <nl> namespace mongo { <nl> } <nl> <nl> do { <nl> - boost : : scoped_ptr < FieldRangeSetPair > frsp ( fros . topFrsp ( ) ) ; <nl> + boost : : scoped_ptr < FieldRangeSetPair > frsp ( org . topFrsp ( ) ) ; <nl> { <nl> / / special case if most - significant field isn ' t in query <nl> FieldRange range = frsp - > singleKeyRange ( _key . key ( ) . firstElement ( ) . fieldName ( ) ) ; <nl> namespace mongo { <nl> / / return ; <nl> } <nl> <nl> - if ( fros . moreOrClauses ( ) ) <nl> - fros . popOrClauseSingleKey ( ) ; <nl> + if ( org . moreOrClauses ( ) ) <nl> + org . popOrClauseSingleKey ( ) ; <nl> <nl> } <nl> - while ( fros . moreOrClauses ( ) ) ; <nl> + while ( org . moreOrClauses ( ) ) ; <nl> } <nl> <nl> void ChunkManager : : getShardsForRange ( set < Shard > & shards , const BSONObj & min , const BSONObj & max ) { <nl>
|
rename FieldRangeOrSet to OrRangeGenerator
|
mongodb/mongo
|
ddd7dd323dabdc4cd55fd753bb71c3340e2f4872
|
2011-05-02T17:33:52Z
|
mmm a / dbms / src / DataTypes / DataTypeAggregateFunction . h <nl> ppp b / dbms / src / DataTypes / DataTypeAggregateFunction . h <nl> namespace ErrorCodes <nl> } <nl> <nl> <nl> - / * * Тип - состояние агрегатной функции . <nl> - * Параметры типа - это агрегатная функция , типы её аргументов и её параметры ( для параметрических агрегатных функций ) . <nl> + / * * Type - the state of the aggregate function . <nl> + * Type parameters is an aggregate function , the types of its arguments , and its parameters ( for parametric aggregate functions ) . <nl> * / <nl> class DataTypeAggregateFunction final : public IDataType <nl> { <nl> class DataTypeAggregateFunction final : public IDataType <nl> <nl> DataTypePtr clone ( ) const override { return std : : make_shared < DataTypeAggregateFunction > ( function , argument_types , parameters ) ; } <nl> <nl> - / / / NOTE Эти две функции сериализации одиночных значений несовместимы с функциями ниже . <nl> + / / / NOTE These two functions for serializing single values are incompatible with the functions below . <nl> void serializeBinary ( const Field & field , WriteBuffer & ostr ) const override ; <nl> void deserializeBinary ( Field & field , ReadBuffer & istr ) const override ; <nl> <nl> mmm a / dbms / src / DataTypes / DataTypeArray . h <nl> ppp b / dbms / src / DataTypes / DataTypeArray . h <nl> namespace DB <nl> class DataTypeArray final : public IDataType <nl> { <nl> private : <nl> - / / / Расширенный тип элементов массивов . <nl> + / / / Extended type of array elements . <nl> DataTypeTraits : : EnrichedDataTypePtr enriched_nested ; <nl> - / / / Тип элементов массивов . <nl> + / / / The type of array elements . <nl> DataTypePtr nested ; <nl> - / / / Тип смещений . <nl> + / / / Type of offsets . <nl> DataTypePtr offsets ; <nl> <nl> public : <nl> class DataTypeArray final : public IDataType <nl> void serializeTextCSV ( const IColumn & column , size_t row_num , WriteBuffer & ostr ) const override ; <nl> void deserializeTextCSV ( IColumn & column , ReadBuffer & istr , const char delimiter ) const override ; <nl> <nl> - / * * Потоковая сериализация массивов устроена по - особенному : <nl> - * - записываются / читаются элементы , уложенные подряд , без размеров массивов ; <nl> - * - размеры записываются / читаются в отдельный столбец , <nl> - * и о записи / чтении размеров должна позаботиться вызывающая сторона . <nl> - * Это нужно , так как при реализации вложенных структур , несколько массивов могут иметь общие размеры . <nl> + / * * Streaming serialization of arrays is arranged in a special way : <nl> + * - elements placed in a row are written / read without array sizes ; <nl> + * - the sizes are written / read in a separate column , <nl> + * and the caller must take care of writing / reading the sizes . <nl> + * This is necessary , because when implementing nested structures , several arrays can have common sizes . <nl> * / <nl> <nl> - / * * Записать только значения , без размеров . Вызывающая сторона также должна куда - нибудь записать смещения . * / <nl> + / * * Write only values , without dimensions . The caller also needs to record the offsets somewhere . * / <nl> void serializeBinaryBulk ( const IColumn & column , WriteBuffer & ostr , size_t offset , size_t limit ) const override ; <nl> <nl> - / * * Прочитать только значения , без размеров . <nl> - * При этом , в column уже заранее должны быть считаны все размеры . <nl> + / * * Read only values , without dimensions . <nl> + * In this case , all the sizes must already be read in the column beforehand . <nl> * / <nl> void deserializeBinaryBulk ( IColumn & column , ReadBuffer & istr , size_t limit , double avg_value_size_hint ) const override ; <nl> <nl> - / * * Записать размеры . * / <nl> + / * * Write the dimensions . * / <nl> void serializeOffsets ( const IColumn & column , WriteBuffer & ostr , size_t offset , size_t limit ) const ; <nl> <nl> - / * * Прочитать размеры . Вызывайте этот метод перед чтением значений . * / <nl> + / * * Read the dimensions . Call this method before reading the values . * / <nl> void deserializeOffsets ( IColumn & column , ReadBuffer & istr , size_t limit ) const ; <nl> <nl> ColumnPtr createColumn ( ) const override ; <nl> mmm a / dbms / src / DataTypes / DataTypeNested . h <nl> ppp b / dbms / src / DataTypes / DataTypeNested . h <nl> <nl> namespace DB <nl> { <nl> <nl> - / * * Хранит набор пар ( имя , тип ) для вложенной структуры данных . <nl> - * Используется только при создании таблицы . Во всех остальных случаях не используется , так как раскрывается в набор отдельных столбцов с типами . <nl> + / * * Stores a set of pairs ( name , type ) for the nested data structure . <nl> + * Used only when creating a table . In all other cases , it is not used , since it is expanded into a set of individual columns with types . <nl> * / <nl> class DataTypeNested final : public IDataTypeDummy <nl> { <nl> private : <nl> - / / / Имена и типы вложенных массивов . <nl> + / / / Names and types of nested arrays . <nl> NamesAndTypesListPtr nested ; <nl> <nl> public : <nl> class DataTypeNested final : public IDataTypeDummy <nl> const NamesAndTypesListPtr & getNestedTypesList ( ) const { return nested ; } <nl> <nl> static std : : string concatenateNestedName ( const std : : string & nested_table_name , const std : : string & nested_field_name ) ; <nl> - / / / Возвращает префикс имени до первой точки ' . ' . Или имя без изменений , если точки нет . <nl> + / / / Returns the prefix of the name to the first ' . ' . Or the name is unchanged if there is no dot . <nl> static std : : string extractNestedTableName ( const std : : string & nested_name ) ; <nl> - / / / Возвращает суффикс имени после первой точки справа ' . ' . Или имя без изменений , если точки нет . <nl> + / / / Returns the name suffix after the first dot on the right ' . ' . Or the name is unchanged if there is no dot . <nl> static std : : string extractNestedColumnName ( const std : : string & nested_name ) ; <nl> <nl> - / / / Создает новый список в котором колонки типа Nested заменены на несколько вида имя_колонки . имя_вложенной_ячейки <nl> + / / / Creates a new list in which Nested - type columns are replaced by several columns form of ` column_name . cell_name ` <nl> static NamesAndTypesListPtr expandNestedColumns ( const NamesAndTypesList & names_and_types ) ; <nl> } ; <nl> <nl> mmm a / dbms / src / DataTypes / DataTypeNumberBase . h <nl> ppp b / dbms / src / DataTypes / DataTypeNumberBase . h <nl> <nl> namespace DB <nl> { <nl> <nl> - / * * Реализует часть интерфейса IDataType , общую для всяких чисел <nl> - * - ввод и вывод в текстовом виде . <nl> + / * * Implements part of the IDataType interface , common to all numbers <nl> + * - input and output in text form . <nl> * / <nl> template < typename T > <nl> class DataTypeNumberBase : public IDataType <nl> mmm a / dbms / src / DataTypes / DataTypeSet . h <nl> ppp b / dbms / src / DataTypes / DataTypeSet . h <nl> <nl> namespace DB <nl> { <nl> <nl> - / * * Тип данных , соответствующий множеству значений в секции IN . <nl> - * Используется только как промежуточный вариант при вычислении выражений . <nl> + / * * The data type corresponding to the set of values in the IN section . <nl> + * Used only as an intermediate option when evaluating expressions . <nl> * / <nl> class DataTypeSet final : public IDataTypeDummy <nl> { <nl> mmm a / dbms / src / DataTypes / DataTypeTuple . h <nl> ppp b / dbms / src / DataTypes / DataTypeTuple . h <nl> <nl> namespace DB <nl> { <nl> <nl> - / * * Тип данных - кортеж . <nl> - * Используется как промежуточный результат при вычислении выражений . <nl> - * Также может быть использовать в качестве столбца - результата выполнения запроса . <nl> - * Не может быть сохранён в таблицы . <nl> + / * * Tuple data type . <nl> + * Used as an intermediate result when evaluating expressions . <nl> + * Also can be used as a column - the result of the query execution . <nl> + * Can not be saved to tables . <nl> * / <nl> class DataTypeTuple final : public IDataType <nl> { <nl> class DataTypeTuple final : public IDataType <nl> void deserializeTextJSON ( IColumn & column , ReadBuffer & istr ) const override ; <nl> void serializeTextXML ( const IColumn & column , size_t row_num , WriteBuffer & ostr ) const override ; <nl> <nl> - / / / Кортежи в формате CSV будем сериализовать , как отдельные столбцы ( то есть , теряя их вложенность в кортеж ) . <nl> + / / / Tuples in CSV format will be serialized as separate columns ( that is , losing their nesting in the tuple ) . <nl> void serializeTextCSV ( const IColumn & column , size_t row_num , WriteBuffer & ostr ) const override ; <nl> void deserializeTextCSV ( IColumn & column , ReadBuffer & istr , const char delimiter ) const override ; <nl> <nl> void serializeBinaryBulk ( const IColumn & column , WriteBuffer & ostr , size_t offset , size_t limit ) const override ; <nl> <nl> - / * * limit обязательно должен быть в точности равен количеству сериализованных значений . <nl> - * Именно из - за этого ( невозможности читать меньший кусок записанных данных ) , Tuple не могут быть использованы для хранения данных в таблицах . <nl> - * ( Хотя могут быть использованы для передачи данных по сети в Native формате . ) <nl> + / * * ` limit ` must be exactly equal to the number of serialized values . <nl> + * It is because of this ( the inability to read a smaller piece of recorded data ) that Tuple can not be used to store data in tables . <nl> + * ( Although they can be used to transfer data over a network in Native format . ) <nl> * / <nl> void deserializeBinaryBulk ( IColumn & column , ReadBuffer & istr , size_t limit , double avg_value_size_hint ) const override ; <nl> <nl> mmm a / dbms / src / DataTypes / FieldToDataType . h <nl> ppp b / dbms / src / DataTypes / FieldToDataType . h <nl> class IDataType ; <nl> using DataTypePtr = std : : shared_ptr < IDataType > ; <nl> <nl> <nl> - / * * Для заданного значения Field возвращает минимальный тип данных , позволяющий хранить значение этого типа . <nl> - * В случае , если Field - массив , конвертирует все элементы к общему типу . <nl> + / * * For a given value , Field returns the minimum data type that allows this value to be stored . <nl> + * In case Field is an array , converts all elements to a common type . <nl> * / <nl> class FieldToDataType : public StaticVisitor < DataTypePtr > <nl> { <nl> mmm a / dbms / src / DataTypes / IDataTypeDummy . h <nl> ppp b / dbms / src / DataTypes / IDataTypeDummy . h <nl> <nl> namespace DB <nl> { <nl> <nl> - / * * Базовые класс для типов данных , которые не поддерживают сериализацию и десериализацию , <nl> - * а возникают лишь в качестве промежуточного результата вычислений . <nl> + / * * The base class for data types that do not support serialization and deserialization , <nl> + * but arise only as an intermediate result of the calculations . <nl> * <nl> - * То есть , этот класс используется всего лишь чтобы отличить соответствующий тип данных от других . <nl> + * That is , this class is used just to distinguish the corresponding data type from the others . <nl> * / <nl> class IDataTypeDummy : public IDataType <nl> { <nl> mmm a / dbms / src / Databases / DatabaseCloud . h <nl> ppp b / dbms / src / Databases / DatabaseCloud . h <nl> namespace Poco { class Logger ; } <nl> namespace DB <nl> { <nl> <nl> - / * * Позволяет создавать " облачные таблицы " . <nl> - * Список таких таблиц хранится в ZooKeeper . <nl> - * Все серверы , ссылающиеся на один путь в ZooKeeper , видят один и тот же список таблиц . <nl> - * CREATE , DROP , RENAME атомарны . <nl> + / * * Allows you to create " cloud tables " . <nl> + * A list of such tables is stored in ZooKeeper . <nl> + * All servers that refer to the same path in ZooKeeper see the same list of tables . <nl> + * CREATE , DROP , RENAME are atomic . <nl> * <nl> - * Для БД задаётся уровень репликации N . <nl> - * При записи в " облачную " таблицу , некоторым образом выбирается N живых серверов в разных датацентрах , <nl> - * на каждом из них создаётся локальная таблица , и в них производится запись . <nl> + * The replication level N is set for the database . <nl> + * When writing to a cloud table , N live servers are selected in some way in different datacenters , <nl> + * on each of them a local table is created , and data is written to them . <nl> * <nl> - * Движок имеет параметры : Cloud ( zookeeper_path , replication_factor , datacenter_name ) <nl> - * Пример : Cloud ( ' / clickhouse / clouds / production / ' , 3 , ' FIN ' ) <nl> + * The engine has the parameters : Cloud ( zookeeper_path , replication_factor , datacenter_name ) <nl> + * Example : Cloud ( ' / clickhouse / clouds / production / ' , 3 , ' FIN ' ) <nl> * <nl> - * Структура в ZooKeeper : <nl> + * Structure in ZooKeeper : <nl> * <nl> - * cloud_path - путь к " облаку " ; может существовать несколько разных независимых облаков <nl> - / table_definitions - множество уникальных определений таблиц , чтобы не писать их много раз для большого количества таблиц <nl> - / hash128 - > sql - отображение : хэш от определения таблицы ( идентификатор ) - > само определение таблицы в виде CREATE запроса <nl> - / tables - список таблиц <nl> - / database_name - имя базы данных <nl> + * cloud_path - the path to the " cloud " ; There may be several different independent clouds <nl> + / table_definitions - set of unique table definitions so you do not write them many times for a large number of tables <nl> + / hash128 - > sql - mapping : hash from table definition ( identifier ) - > table definition itself as CREATE query <nl> + / tables - list of tables <nl> + / database_name - name of the database <nl> / name_hash_mod - > compressed_table_list <nl> - - список таблиц сделан двухуровневым , чтобы уменьшить количество узлов в ZooKeeper при наличии большого количества таблиц <nl> - - узлы создаются для каждого остатка от деления хэша от имени таблицы , например , на 4096 <nl> - - и в каждом узле хранится список таблиц ( имя таблицы , имя локальной таблицы , хэш от структуры , список хостов ) в сжатом виде <nl> - / local_tables - список локальных таблиц , чтобы по имени локальной таблицы можно было определить её структуру <nl> + - the list of tables is made two - level to reduce the number of nodes in ZooKeeper if there are a large number of tables <nl> + - nodes are created for each remainder of the hash partition from the table name , for example , to 4096 <nl> + - and each node stores a list of tables ( table name , local table name , hash from structure , hosts list ) in a compressed form <nl> + / local_tables - a list of local tables so that by the name of the local table you can determine its structure <nl> / database_name <nl> / name_hash_mod - > compressed_table_list <nl> - - список пар ( хэш от имени таблицы , хэш от структуры ) в сжатом виде <nl> - / locality_keys - сериализованный список ключей локальности в порядке их появления <nl> - - ключ локальности - произвольная строка <nl> - - движок БД определяет серверы для расположения данных таким образом , <nl> - чтобы , при одинаковом множестве живых серверов , <nl> - одному ключу локальности соответствовала одна группа из N серверов для расположения данных . <nl> - / nodes - список серверов , на которых зарегистрированы облачные БД с таким путём в ZK <nl> - / hostname - имя хоста <nl> - TODO / alive - эфемерная нода для предварительной проверки живости <nl> - / datacenter - имя датацентра <nl> + - list of pairs ( hash from the table name , hash from the structure ) in a compressed form <nl> + / locality_keys - a serialized list of locality keys in the order in which they appear <nl> + - locality key - an arbitrary string <nl> + - the database engine defines the servers for the data location in such a way , <nl> + that , with the same set of live servers , <nl> + one locality key corresponds to one group of N servers for the data location . <nl> + / nodes - the list of servers on which cloud databases are registered with the same path in ZK <nl> + / hostname - hostname <nl> + TODO / alive - an ephemeral node for pre - testing liveliness <nl> + / datacenter - the name of the data center <nl> TODO / disk_space <nl> <nl> - * К одному облаку может относиться несколько БД , названных по - разному . Например , БД hits и visits могут относиться к одному облаку . <nl> + * For one cloud there may be more than one database named differently . For example , DB ` hits ` and ` visits ` can belong to the same cloud . <nl> * / <nl> class DatabaseCloud : public IDatabase <nl> { <nl> class DatabaseCloud : public IDatabase <nl> <nl> Context & context ; <nl> <nl> - / * * Локальные таблицы - это таблицы , находящиеся непосредственно на локальном сервере . <nl> - * Они хранят данные облачных таблиц : облачная таблица представлена несколькими локальными таблицами на разных серверах . <nl> - * Эти таблицы не видны пользователю при перечислении таблиц , хотя доступны при обращении по имени . <nl> - * Имя локальных таблиц имеет специальную форму , например , начинаться на _local , чтобы они не путались с облачными таблицами . <nl> - * Локальные таблицы загружаются лениво , при первом обращении . <nl> + / * * Local tables are tables that are located directly on the local server . <nl> + * They store the data of the cloud tables : the cloud table is represented by several local tables on different servers . <nl> + * These tables are not visible to the user when listing tables , although they are available when referring by name . <nl> + * The name of the local tables has a special form , for example , start with _local so that they do not get confused with the cloud tables . <nl> + * Local tables are loaded lazily , on first access . <nl> * / <nl> Tables local_tables_cache ; <nl> mutable std : : mutex local_tables_mutex ; <nl> class DatabaseCloud : public IDatabase <nl> private : <nl> void createZookeeperNodes ( ) ; <nl> <nl> - / / / Получить имя узла , в котором будет храниться часть списка таблиц . ( Список таблиц является двухуровневым . ) <nl> + / / / Get the name of the node in which the part of the list of tables will be stored . ( The list of tables is two - level . ) <nl> String getNameOfNodeWithTables ( const String & table_name ) const ; <nl> <nl> - / / / Хэшировать имя таблицы вместе с именем БД . <nl> + / / / Hash the table name along with the database name . <nl> Hash getTableHash ( const String & table_name ) const ; <nl> <nl> - / / / Определения таблиц хранятся косвенным образом и адресуются своим хэшом . Вычислить хэш . <nl> + / / / Table definitions are stored indirectly and addressed by its hash . Calculate the hash . <nl> Hash getHashForTableDefinition ( const String & definition ) const ; <nl> <nl> - / / / Пойти в ZooKeeper и по хэшу получить определение таблицы . <nl> + / / / Go to ZooKeeper and get a table definition by hash . <nl> String getTableDefinitionFromHash ( Hash hash ) const ; <nl> <nl> - / / / Определить серверы , на которых будут храниться данные таблицы . <nl> + / / / Define the servers on which the table data will be stored . <nl> std : : vector < String > selectHostsForTable ( const String & locality_key ) const ; <nl> } ; <nl> <nl> mmm a / dbms / src / Databases / DatabasesCommon . h <nl> ppp b / dbms / src / Databases / DatabasesCommon . h <nl> <nl> # include < Storages / IStorage . h > <nl> # include < Databases / IDatabase . h > <nl> <nl> - / / / Общая функциональность для нескольких разных движков баз данных . <nl> + / / / General functionality for several different database engines . <nl> <nl> namespace DB <nl> { <nl> <nl> <nl> - / * * Получить строку с определением таблицы на основе запроса CREATE . <nl> - * Она представляет собой запрос ATTACH , который можно выполнить для создания таблицы , находясь в нужной БД . <nl> - * См . реализацию . <nl> + / * * Get the row with the table definition based on the CREATE query . <nl> + * It is an ATTACH query that you can execute to create a table from the correspondent database . <nl> + * See the implementation . <nl> * / <nl> String getTableDefinitionFromCreateQuery ( const ASTPtr & query ) ; <nl> <nl> <nl> - / * * Создать таблицу по её определению , без использования InterpreterCreateQuery . <nl> - * ( InterpreterCreateQuery обладает более сложной функциональностью , и его нельзя использовать , если БД ещё не создана ) <nl> - * Возвращает имя таблицы и саму таблицу . <nl> + / * * Create a table by its definition , without using InterpreterCreateQuery . <nl> + * ( InterpreterCreateQuery has more complex functionality , and it can not be used if the database has not been created yet ) <nl> + * Returns the table name and the table itself . <nl> * / <nl> std : : pair < String , StoragePtr > createTableFromDefinition ( <nl> const String & definition , <nl> mmm a / dbms / src / Databases / IDatabase . h <nl> ppp b / dbms / src / Databases / IDatabase . h <nl> class IDatabase : public std : : enable_shared_from_this < IDatabase > <nl> / / / Get name of database engine . <nl> virtual String getEngineName ( ) const = 0 ; <nl> <nl> - / / / Загрузить множество существующих таблиц . Если задан thread_pool - использовать его . <nl> - / / / Можно вызывать только один раз , сразу после создания объекта . <nl> + / / / Load a set of existing tables . If thread_pool is specified , use it . <nl> + / / / You can call only once , right after the object is created . <nl> virtual void loadTables ( Context & context , ThreadPool * thread_pool , bool has_force_restore_data_flag ) = 0 ; <nl> <nl> - / / / Проверить существование таблицы . <nl> + / / / Check the existence of the table . <nl> virtual bool isTableExist ( const String & name ) const = 0 ; <nl> <nl> - / / / Получить таблицу для работы . Вернуть nullptr , если таблицы нет . <nl> + / / / Get the table for work . Return nullptr if there is no table . <nl> virtual StoragePtr tryGetTable ( const String & name ) = 0 ; <nl> <nl> - / / / Получить итератор , позволяющий перебрать все таблицы . <nl> - / / / Допустимо наличие " скрытых " таблиц , которые не видны при переборе , но видны , если получать их по имени , используя функции выше . <nl> + / / / Get an iterator that allows you to pass through all the tables . <nl> + / / / It is possible to have " hidden " tables that are not visible when passing through , but are visible if you get them by name using the functions above . <nl> virtual DatabaseIteratorPtr getIterator ( ) = 0 ; <nl> <nl> - / / / Является ли БД пустой . <nl> + / / / Is the database empty . <nl> virtual bool empty ( ) const = 0 ; <nl> <nl> - / / / Добавить таблицу в базу данных . Прописать её наличие в метаданных . <nl> + / / / Add the table to the database . Record its presence in the metadata . <nl> virtual void createTable ( <nl> const String & name , const StoragePtr & table , const ASTPtr & query , const String & engine , const Settings & settings ) = 0 ; <nl> <nl> - / / / Удалить таблицу из базы данных и вернуть её . Удалить метаданные . <nl> + / / / Delete the table from the database and return it . Delete the metadata . <nl> virtual void removeTable ( const String & name ) = 0 ; <nl> <nl> - / / / Добавить таблицу в базу данных , но не прописывать её в метаданных . БД может не поддерживать этот метод . <nl> + / / / Add a table to the database , but do not add it to the metadata . The database may not support this method . <nl> virtual void attachTable ( const String & name , const StoragePtr & table ) = 0 ; <nl> <nl> - / / / Забыть про таблицу , не удаляя её , и вернуть её . БД может не поддерживать этот метод . <nl> + / / / Forget about the table without deleting it , and return it . The database may not support this method . <nl> virtual StoragePtr detachTable ( const String & name ) = 0 ; <nl> <nl> - / / / Переименовать таблицу и , возможно , переместить таблицу в другую БД . <nl> + / / / Rename the table and possibly move the table to another database . <nl> virtual void renameTable ( <nl> const Context & context , const String & name , IDatabase & to_database , const String & to_name , const Settings & settings ) = 0 ; <nl> <nl> class IDatabase : public std : : enable_shared_from_this < IDatabase > <nl> <nl> using ASTModifier = std : : function < void ( ASTPtr & ) > ; <nl> <nl> - / / / Изменить структуру таблицы в метаданных . <nl> - / / / Нужно вызывать под TableStructureLock соответствующей таблицы . Если engine_modifier пустой , то engine не изменяется . <nl> + / / / Change the table structure in metadata . <nl> + / / / You must call under the TableStructureLock of the corresponding table . If engine_modifier is empty , then engine does not change . <nl> virtual void alterTable ( <nl> const Context & context , <nl> const String & name , <nl> class IDatabase : public std : : enable_shared_from_this < IDatabase > <nl> const ColumnDefaults & column_defaults , <nl> const ASTModifier & engine_modifier ) = 0 ; <nl> <nl> - / / / Получить запрос CREATE TABLE для таблицы . Может выдавать информацию и для detached таблиц , для которых есть метаданные . <nl> + / / / Get the CREATE TABLE query for the table . It can also provide information for detached tables for which there is metadata . <nl> virtual ASTPtr getCreateQuery ( const String & name ) const = 0 ; <nl> <nl> - / / / Попросить все таблицы завершить фоновые потоки , которые они используют , и удалить все объекты таблиц . <nl> + / / / Ask all tables to complete the background threads they are using and delete all table objects . <nl> virtual void shutdown ( ) = 0 ; <nl> <nl> - / / / Удалить метаданные , удаление которых отличается от рекурсивного удаления директории , если такие есть . <nl> + / / / Delete metadata , the deletion of which differs from the recursive deletion of the directory , if any . <nl> virtual void drop ( ) = 0 ; <nl> <nl> virtual ~ IDatabase ( ) { } <nl> mmm a / dbms / src / Dictionaries / ComplexKeyCacheDictionary . h <nl> ppp b / dbms / src / Dictionaries / ComplexKeyCacheDictionary . h <nl> class ComplexKeyCacheDictionary final : public IDictionaryBase <nl> return dict_struct . attributes [ & getAttribute ( attribute_name ) - attributes . data ( ) ] . injective ; <nl> } <nl> <nl> - / / / Во всех функциях ниже , key_columns должны быть полноценными ( не константными ) столбцами . <nl> - / / / См . требование в IDataType . h для функций текстовой сериализации . <nl> + / / / In all functions below , key_columns must be full ( non - constant ) columns . <nl> + / / / See the requirement in IDataType . h for text - serialization functions . <nl> # define DECLARE ( TYPE ) \ <nl> void get # # TYPE ( \ <nl> const std : : string & attribute_name , const ConstColumnPlainPtrs & key_columns , const DataTypes & key_types , \ <nl> mmm a / dbms / src / Dictionaries / DictionaryStructure . h <nl> ppp b / dbms / src / Dictionaries / DictionaryStructure . h <nl> enum class AttributeUnderlyingType <nl> } ; <nl> <nl> <nl> - / * * Для неявных преобразований в функциях dictGet . <nl> + / * * For implicit conversions in dictGet functions . <nl> * / <nl> bool isAttributeTypeConvertibleTo ( AttributeUnderlyingType from , AttributeUnderlyingType to ) ; <nl> <nl> mmm a / dbms / src / Dictionaries / Embedded / RegionsHierarchies . h <nl> ppp b / dbms / src / Dictionaries / Embedded / RegionsHierarchies . h <nl> <nl> # include < unordered_map > <nl> <nl> <nl> - / * * Содержит несколько иерархий регионов , загружаемых из нескольких разных файлов . <nl> - * Используется , чтобы поддержать несколько разных точек зрения о принадлежности регионов странам . <nl> - * В первую очередь , для Крыма ( Российская и Украинская точки зрения ) . <nl> + / * * Contains several hierarchies of regions , loaded from several different files . <nl> + * Used to support several different perspectives on the ownership of regions by countries . <nl> + * First of all , for the Crimea ( Russian and Ukrainian points of view ) . <nl> * / <nl> class RegionsHierarchies <nl> { <nl> class RegionsHierarchies <nl> <nl> public : <nl> / * * path_to_regions_hierarchy_file in configuration file <nl> - * должен указывать на файл с иерархией регионов " по - умолчанию " . Она будет доступна по пустому ключу . <nl> - * Кроме того , рядом ищутся файлы , к имени которых ( до расширения , если есть ) добавлен произвольный _suffix . <nl> - * Такие файлы загружаются , и иерархия регионов кладётся по ключу suffix . <nl> + * must point to the file with the hierarchy of regions " by default " . It will be accessible by an empty key . <nl> + * In addition , a number of files are searched for , the name of which ( before the extension , if any ) is added arbitrary _suffix . <nl> + * Such files are loaded , and the hierarchy of regions is put on the ` suffix ` key . <nl> * <nl> - * Например , если указано / opt / geo / regions_hierarchy . txt , <nl> - * то будет также загружен файл / opt / geo / regions_hierarchy_ua . txt , если такой есть - он будет доступен по ключу ua . <nl> + * For example , if / opt / geo / regions_hierarchy . txt is specified , <nl> + * then the / opt / geo / regions_hierarchy_ua . txt file will also be loaded , if any , it will be accessible by the ` ua ` key . <nl> * / <nl> RegionsHierarchies ( ) ; <nl> explicit RegionsHierarchies ( const std : : string & path_to_regions_hierarchy_file ) ; <nl> class RegionsHierarchies <nl> static bool isConfigured ( ) ; <nl> <nl> <nl> - / * * Перезагружает , при необходимости , все иерархии регионов . <nl> + / * * Reloads , if necessary , all hierarchies of regions . <nl> * / <nl> void reload ( ) <nl> { <nl> mmm a / dbms / src / Dictionaries / Embedded / RegionsHierarchy . h <nl> ppp b / dbms / src / Dictionaries / Embedded / RegionsHierarchy . h <nl> <nl> # define REGION_TYPE_CONTINENT 1 <nl> <nl> <nl> - / * * Класс , позволяющий узнавать , принадлежит ли регион с одним RegionID региону с другим RegionID . <nl> - * Информацию об иерархии регионов загружает из текстового файла . <nl> - * Умеет , по запросу , обновлять данные . <nl> + / * * A class that lets you know if a region belongs to one RegionID region with another RegionID . <nl> + * Information about the hierarchy of regions is downloaded from a text file . <nl> + * Can on request update the data . <nl> * / <nl> class RegionsHierarchy : private boost : : noncopyable <nl> { <nl> class RegionsHierarchy : private boost : : noncopyable <nl> using RegionDepth = UInt8 ; <nl> using RegionPopulation = UInt32 ; <nl> <nl> - / / / отношение parent ; 0 , если родителей нет - обычная lookup таблица . <nl> + / / / Relationship parent ; 0 , if there are no parents , the usual lookup table . <nl> using RegionParents = std : : vector < RegionID > ; <nl> - / / / тип региона <nl> + / / / type of region <nl> using RegionTypes = std : : vector < RegionType > ; <nl> - / / / глубина в дереве , начиная от страны ( страна : 1 , корень : 0 ) <nl> + / / / depth in the tree , starting from the country ( country : 1 , root : 0 ) <nl> using RegionDepths = std : : vector < RegionDepth > ; <nl> - / / / население региона . Если больше 2 ^ 32 - 1 , то приравнивается к этому максимуму . <nl> + / / / population of the region . If more than 2 ^ 32 - 1 , then it is equated to this maximum . <nl> using RegionPopulations = std : : vector < RegionPopulation > ; <nl> <nl> - / / / регион - > родительский регион <nl> + / / / region - > parent region <nl> RegionParents parents ; <nl> - / / / регион - > город , включающий его или 0 , если такого нет <nl> + / / / region - > city , including it or 0 , if there is none <nl> RegionParents city ; <nl> - / / / регион - > страна , включающая его или 0 , если такого нет <nl> + / / / region - > country including it or 0 , if there is none <nl> RegionParents country ; <nl> - / / / регион - > область , включающая его или 0 , если такой нет <nl> + / / / region - > area that includes it or 0 , if not <nl> RegionParents area ; <nl> - / / / регион - > округ , включающий его или 0 , если такого нет <nl> + / / / region - > district , including it or 0 , if there is none <nl> RegionParents district ; <nl> - / / / регион - > континет ( первый при подъёме по иерархии регионов ) , включающий его или 0 , если такого нет <nl> + / / / region - > the continent ( the first when climbing in the hierarchy of regions ) , including it or 0 , if there is none <nl> RegionParents continent ; <nl> - / / / регион - > континет ( последний при подъёме по иерархии регионов ) , включающий его или 0 , если такого нет <nl> + / / / region - > the continent ( the latter when you climb the hierarchy of regions ) , including it or 0 , if there is none <nl> RegionParents top_continent ; <nl> <nl> - / / / регион - > население или 0 , если неизвестно . <nl> + / / / region - > population or 0 , if unknown . <nl> RegionPopulations populations ; <nl> <nl> - / / / регион - глубина в дереве <nl> + / / / region - depth in the tree <nl> RegionDepths depths ; <nl> <nl> / / / path to file with data <nl> class RegionsHierarchy : private boost : : noncopyable <nl> RegionsHierarchy ( ) ; <nl> RegionsHierarchy ( const std : : string & path_ ) ; <nl> <nl> - / / / Перезагружает , при необходимости , иерархию регионов . Непотокобезопасно . <nl> + / / / Reloads , if necessary , the hierarchy of regions . Not threadsafe . <nl> void reload ( ) ; <nl> <nl> <nl> mmm a / dbms / src / Dictionaries / Embedded / RegionsNames . h <nl> ppp b / dbms / src / Dictionaries / Embedded / RegionsNames . h <nl> <nl> # include < Core / StringRef . h > <nl> <nl> <nl> - / * * Класс , позволяющий узнавать по id региона его текстовое название на одном из поддерживаемых языков : ru , en , ua , by , kz , tr . <nl> + / * * A class that allows you to recognize by region id its text name in one of the supported languages : ru , en , ua , by , kz , tr . <nl> * <nl> - * Информацию об именах регионов загружает из текстовых файлов с названиями следующего формата : <nl> + * Information about region names loads from text files with the following format names : <nl> * regions_names_xx . txt , <nl> - * где xx - одно из двух буквенных обозначений следующих поддерживаемых языков : <nl> + * where xx is one of the two letters of the following supported languages : <nl> * ru , en , ua , by , kz , tr . <nl> * <nl> - * Умеет , по запросу , обновлять данные . <nl> + * Can on request update the data . <nl> * / <nl> class RegionsNames <nl> { <nl> class RegionsNames <nl> using StringRefsForLanguageID = std : : vector < StringRefs > ; <nl> <nl> public : <nl> - / * * Перезагружает , при необходимости , имена регионов . <nl> + / * * Reboot , if necessary , the names of regions . <nl> * / <nl> void reload ( ) ; <nl> void reload ( const std : : string & directory ) ; <nl> class RegionsNames <nl> <nl> ModificationTimes file_modification_times = ModificationTimes ( SUPPORTED_LANGUAGES_COUNT ) ; <nl> <nl> - / / / Байты имен для каждого языка , уложенные подряд , разделенные нулями <nl> + / / / Bytes of names for each language , laid out in a row , separated by zeros <nl> CharsForLanguageID chars = CharsForLanguageID ( SUPPORTED_LANGUAGES_COUNT ) ; <nl> <nl> - / / / Отображение для каждого языка из id региона в указатель на диапазон байт имени <nl> + / / / Mapping for each language from the region id into a pointer to the byte range of the name <nl> StringRefsForLanguageID names_refs = StringRefsForLanguageID ( SUPPORTED_LANGUAGES_COUNT ) ; <nl> } ; <nl> mmm a / dbms / src / Dictionaries / Embedded / TechDataHierarchy . h <nl> ppp b / dbms / src / Dictionaries / Embedded / TechDataHierarchy . h <nl> <nl> # include < common / Types . h > <nl> <nl> <nl> - / * * @ brief Класс , позволяющий узнавать , принадлежит ли поисковая система или операционная система <nl> - * другой поисковой или операционной системе , соответственно . <nl> - * Информацию об иерархии регионов загружает из БД . <nl> + / * * @ brief Class that lets you know if a search engine or operating system belongs <nl> + * another search engine or operating system , respectively . <nl> + * Information about the hierarchy of regions is downloaded from the database . <nl> * / <nl> class TechDataHierarchy <nl> { <nl> class TechDataHierarchy <nl> static bool isConfigured ( ) ; <nl> <nl> <nl> - / / / Отношение " принадлежит " . <nl> + / / / The " belongs " relation . <nl> bool isOSIn ( UInt8 lhs , UInt8 rhs ) const <nl> { <nl> while ( lhs ! = rhs & & os_parent [ lhs ] ) <nl> class TechDataHierarchy <nl> } <nl> <nl> <nl> - / / / К самому верхнему предку . <nl> + / / / To the topmost ancestor . <nl> UInt8 OSToMostAncestor ( UInt8 x ) const <nl> { <nl> while ( os_parent [ x ] ) <nl>
|
translate comments
|
ClickHouse/ClickHouse
|
b51c6e759223ba8619a7dd231ad0d3d9ea607abc
|
2017-04-17T12:35:21Z
|
mmm a / tests / src / pressed_keys_manager / src / pressed_keys_manager_test . cpp <nl> ppp b / tests / src / pressed_keys_manager / src / pressed_keys_manager_test . cpp <nl> TEST_CASE ( " pressed_keys_manager " ) { <nl> { <nl> krbn : : pressed_keys_manager manager ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( manager . empty ( ) ) ; <nl> } <nl> <nl> TEST_CASE ( " pressed_keys_manager " ) { <nl> { <nl> krbn : : pressed_keys_manager manager ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( manager . empty ( ) ) ; <nl> } <nl> <nl> TEST_CASE ( " pressed_keys_manager " ) { <nl> { <nl> krbn : : pressed_keys_manager manager ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : consumer , <nl> - pqrs : : hid : : usage : : consumer : : mute ) ) ) ; <nl> + pqrs : : hid : : usage : : consumer : : mute ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : consumer , <nl> - pqrs : : hid : : usage : : consumer : : mute ) ) ) ; <nl> + pqrs : : hid : : usage : : consumer : : mute ) ) ; <nl> REQUIRE ( manager . empty ( ) ) ; <nl> } <nl> <nl> TEST_CASE ( " pressed_keys_manager " ) { <nl> { <nl> krbn : : pressed_keys_manager manager ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : button , <nl> - pqrs : : hid : : usage : : button : : button_1 ) ) ) ; <nl> + pqrs : : hid : : usage : : button : : button_1 ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : button , <nl> - pqrs : : hid : : usage : : button : : button_1 ) ) ) ; <nl> + pqrs : : hid : : usage : : button : : button_1 ) ) ; <nl> REQUIRE ( manager . empty ( ) ) ; <nl> } <nl> <nl> TEST_CASE ( " pressed_keys_manager " ) { <nl> { <nl> krbn : : pressed_keys_manager manager ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : consumer , <nl> - pqrs : : hid : : usage : : consumer : : mute ) ) ) ; <nl> + pqrs : : hid : : usage : : consumer : : mute ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . insert ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . insert ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : button , <nl> - pqrs : : hid : : usage : : button : : button_1 ) ) ) ; <nl> + pqrs : : hid : : usage : : button : : button_1 ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : keyboard_or_keypad , <nl> - pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ) ; <nl> + pqrs : : hid : : usage : : keyboard_or_keypad : : keyboard_a ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : consumer , <nl> - pqrs : : hid : : usage : : consumer : : mute ) ) ) ; <nl> + pqrs : : hid : : usage : : consumer : : mute ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : button , <nl> - pqrs : : hid : : usage : : button : : button_10 ) ) ) ; <nl> + pqrs : : hid : : usage : : button : : button_10 ) ) ; <nl> REQUIRE ( ! manager . empty ( ) ) ; <nl> <nl> - manager . erase ( krbn : : momentary_switch_event ( pqrs : : hid : : usage_pair ( <nl> + manager . erase ( krbn : : momentary_switch_event ( <nl> pqrs : : hid : : usage_page : : button , <nl> - pqrs : : hid : : usage : : button : : button_1 ) ) ) ; <nl> + pqrs : : hid : : usage : : button : : button_1 ) ) ; <nl> REQUIRE ( manager . empty ( ) ) ; <nl> } <nl> } <nl>
|
Update tests
|
pqrs-org/Karabiner-Elements
|
8ecc265c09a0da98ea18a3dea6b078b45f28264e
|
2020-11-28T07:45:10Z
|
mmm a / src / code - stub - assembler . cc <nl> ppp b / src / code - stub - assembler . cc <nl> CodeStubAssembler : : AllocateUninitializedJSArrayWithElements ( <nl> CHECK_EQ ( allocation_flags & ~ kAllowLargeObjectAllocation , 0 ) ; <nl> CSA_SLOW_ASSERT ( this , TaggedIsPositiveSmi ( length ) ) ; <nl> <nl> - int base_size = JSArray : : kSize ; <nl> - if ( allocation_site ! = nullptr ) base_size + = AllocationMemento : : kSize ; <nl> + TVARIABLE ( JSArray , array ) ; <nl> + TVARIABLE ( FixedArrayBase , elements ) ; <nl> <nl> - const int elements_offset = base_size ; <nl> + if ( IsIntPtrOrSmiConstantZero ( capacity , capacity_mode ) ) { <nl> + TNode < FixedArrayBase > empty_array = EmptyFixedArrayConstant ( ) ; <nl> + array = AllocateJSArray ( array_map , empty_array , length , allocation_site ) ; <nl> + return { array . value ( ) , empty_array } ; <nl> + } <nl> <nl> - / / Compute space for elements <nl> - base_size + = FixedArray : : kHeaderSize ; <nl> - TNode < IntPtrT > size = <nl> - ElementOffsetFromIndex ( capacity , kind , capacity_mode , base_size ) ; <nl> + Label out ( this ) , empty ( this ) , nonempty ( this ) ; <nl> <nl> - TVARIABLE ( JSArray , array ) ; <nl> - TVARIABLE ( FixedArrayBase , elements ) ; <nl> + Branch ( SmiEqual ( ParameterToTagged ( capacity , capacity_mode ) , SmiConstant ( 0 ) ) , <nl> + & empty , & nonempty ) ; <nl> <nl> - Label out ( this ) ; <nl> + BIND ( & empty ) ; <nl> + { <nl> + TNode < FixedArrayBase > empty_array = EmptyFixedArrayConstant ( ) ; <nl> + array = AllocateJSArray ( array_map , empty_array , length , allocation_site ) ; <nl> + elements = empty_array ; <nl> + Goto ( & out ) ; <nl> + } <nl> <nl> - / / For very large arrays in which the requested allocation exceeds the <nl> - / / maximal size of a regular heap object , we cannot use the allocation <nl> - / / folding trick . Instead , we first allocate the elements in large object <nl> - / / space , and then allocate the JSArray ( and possibly the allocation memento ) <nl> - / / in new space . <nl> - if ( allocation_flags & kAllowLargeObjectAllocation ) { <nl> - Label next ( this ) ; <nl> - GotoIf ( IsRegularHeapObjectSize ( size ) , & next ) ; <nl> + BIND ( & nonempty ) ; <nl> + { <nl> + int base_size = JSArray : : kSize ; <nl> + if ( allocation_site ! = nullptr ) base_size + = AllocationMemento : : kSize ; <nl> <nl> - CSA_CHECK ( this , IsValidFastJSArrayCapacity ( capacity , capacity_mode ) ) ; <nl> + const int elements_offset = base_size ; <nl> <nl> - / / Allocate and initialize the elements first . Full initialization is needed <nl> - / / because the upcoming JSArray allocation could trigger GC . <nl> - elements = <nl> - AllocateFixedArray ( kind , capacity , capacity_mode , allocation_flags ) ; <nl> + / / Compute space for elements <nl> + base_size + = FixedArray : : kHeaderSize ; <nl> + TNode < IntPtrT > size = <nl> + ElementOffsetFromIndex ( capacity , kind , capacity_mode , base_size ) ; <nl> <nl> - if ( IsDoubleElementsKind ( kind ) ) { <nl> - FillFixedDoubleArrayWithZero ( CAST ( elements . value ( ) ) , <nl> - ParameterToIntPtr ( capacity , capacity_mode ) ) ; <nl> - } else { <nl> - FillFixedArrayWithSmiZero ( CAST ( elements . value ( ) ) , <nl> - ParameterToIntPtr ( capacity , capacity_mode ) ) ; <nl> + / / For very large arrays in which the requested allocation exceeds the <nl> + / / maximal size of a regular heap object , we cannot use the allocation <nl> + / / folding trick . Instead , we first allocate the elements in large object <nl> + / / space , and then allocate the JSArray ( and possibly the allocation <nl> + / / memento ) in new space . <nl> + if ( allocation_flags & kAllowLargeObjectAllocation ) { <nl> + Label next ( this ) ; <nl> + GotoIf ( IsRegularHeapObjectSize ( size ) , & next ) ; <nl> + <nl> + CSA_CHECK ( this , IsValidFastJSArrayCapacity ( capacity , capacity_mode ) ) ; <nl> + <nl> + / / Allocate and initialize the elements first . Full initialization is <nl> + / / needed because the upcoming JSArray allocation could trigger GC . <nl> + elements = <nl> + AllocateFixedArray ( kind , capacity , capacity_mode , allocation_flags ) ; <nl> + <nl> + if ( IsDoubleElementsKind ( kind ) ) { <nl> + FillFixedDoubleArrayWithZero ( CAST ( elements . value ( ) ) , <nl> + ParameterToIntPtr ( capacity , capacity_mode ) ) ; <nl> + } else { <nl> + FillFixedArrayWithSmiZero ( CAST ( elements . value ( ) ) , <nl> + ParameterToIntPtr ( capacity , capacity_mode ) ) ; <nl> + } <nl> + <nl> + / / The JSArray and possibly allocation memento next . Note that <nl> + / / allocation_flags are * not * passed on here and the resulting JSArray <nl> + / / will always be in new space . <nl> + array = <nl> + AllocateJSArray ( array_map , elements . value ( ) , length , allocation_site ) ; <nl> + <nl> + Goto ( & out ) ; <nl> + <nl> + BIND ( & next ) ; <nl> } <nl> <nl> - / / The JSArray and possibly allocation memento next . Note that <nl> - / / allocation_flags are * not * passed on here and the resulting JSArray will <nl> - / / always be in new space . <nl> + / / Fold all objects into a single new space allocation . <nl> array = <nl> - AllocateJSArray ( array_map , elements . value ( ) , length , allocation_site ) ; <nl> - <nl> + AllocateUninitializedJSArray ( array_map , length , allocation_site , size ) ; <nl> + elements = UncheckedCast < FixedArrayBase > ( <nl> + InnerAllocate ( array . value ( ) , elements_offset ) ) ; <nl> + <nl> + StoreObjectFieldNoWriteBarrier ( array . value ( ) , JSObject : : kElementsOffset , <nl> + elements . value ( ) ) ; <nl> + <nl> + / / Setup elements object . <nl> + STATIC_ASSERT ( FixedArrayBase : : kHeaderSize = = 2 * kTaggedSize ) ; <nl> + RootIndex elements_map_index = IsDoubleElementsKind ( kind ) <nl> + ? RootIndex : : kFixedDoubleArrayMap <nl> + : RootIndex : : kFixedArrayMap ; <nl> + DCHECK ( RootsTable : : IsImmortalImmovable ( elements_map_index ) ) ; <nl> + StoreMapNoWriteBarrier ( elements . value ( ) , elements_map_index ) ; <nl> + <nl> + TNode < Smi > capacity_smi = ParameterToTagged ( capacity , capacity_mode ) ; <nl> + CSA_ASSERT ( this , SmiGreaterThan ( capacity_smi , SmiConstant ( 0 ) ) ) ; <nl> + StoreObjectFieldNoWriteBarrier ( elements . value ( ) , FixedArray : : kLengthOffset , <nl> + capacity_smi ) ; <nl> Goto ( & out ) ; <nl> - <nl> - BIND ( & next ) ; <nl> } <nl> <nl> - / / Fold all objects into a single new space allocation . <nl> - array = <nl> - AllocateUninitializedJSArray ( array_map , length , allocation_site , size ) ; <nl> - elements = UncheckedCast < FixedArrayBase > ( <nl> - InnerAllocate ( array . value ( ) , elements_offset ) ) ; <nl> - <nl> - StoreObjectFieldNoWriteBarrier ( array . value ( ) , JSObject : : kElementsOffset , <nl> - elements . value ( ) ) ; <nl> - <nl> - / / Setup elements object . <nl> - STATIC_ASSERT ( FixedArrayBase : : kHeaderSize = = 2 * kTaggedSize ) ; <nl> - RootIndex elements_map_index = IsDoubleElementsKind ( kind ) <nl> - ? RootIndex : : kFixedDoubleArrayMap <nl> - : RootIndex : : kFixedArrayMap ; <nl> - DCHECK ( RootsTable : : IsImmortalImmovable ( elements_map_index ) ) ; <nl> - StoreMapNoWriteBarrier ( elements . value ( ) , elements_map_index ) ; <nl> - <nl> - TNode < Smi > capacity_smi = ParameterToTagged ( capacity , capacity_mode ) ; <nl> - CSA_ASSERT ( this , SmiGreaterThan ( capacity_smi , SmiConstant ( 0 ) ) ) ; <nl> - StoreObjectFieldNoWriteBarrier ( elements . value ( ) , FixedArray : : kLengthOffset , <nl> - capacity_smi ) ; <nl> - Goto ( & out ) ; <nl> - <nl> BIND ( & out ) ; <nl> return { array . value ( ) , elements . value ( ) } ; <nl> } <nl> TNode < JSArray > CodeStubAssembler : : AllocateJSArray ( <nl> <nl> TNode < JSArray > array ; <nl> TNode < FixedArrayBase > elements ; <nl> - int capacity_as_constant ; <nl> <nl> - if ( IsIntPtrOrSmiConstantZero ( capacity , capacity_mode ) ) { <nl> - / / Array is empty . Use the shared empty fixed array instead of allocating a <nl> - / / new one . <nl> - TNode < FixedArrayBase > empty_fixed_array = <nl> - CAST ( LoadRoot ( RootIndex : : kEmptyFixedArray ) ) ; <nl> - array = <nl> - AllocateJSArray ( array_map , empty_fixed_array , length , allocation_site ) ; <nl> - } else if ( TryGetIntPtrOrSmiConstantValue ( capacity , & capacity_as_constant , <nl> - capacity_mode ) ) { <nl> - CHECK_GT ( capacity_as_constant , 0 ) ; <nl> - / / Allocate both array and elements object , and initialize the JSArray . <nl> - std : : tie ( array , elements ) = AllocateUninitializedJSArrayWithElements ( <nl> - kind , array_map , length , allocation_site , capacity , capacity_mode , <nl> - allocation_flags ) ; <nl> - / / Fill in the elements with holes . <nl> - FillFixedArrayWithValue ( kind , elements , <nl> - IntPtrOrSmiConstant ( 0 , capacity_mode ) , capacity , <nl> - RootIndex : : kTheHoleValue , capacity_mode ) ; <nl> - } else { <nl> - Label out ( this ) , empty ( this ) , nonempty ( this ) ; <nl> - TVARIABLE ( JSArray , var_array ) ; <nl> + std : : tie ( array , elements ) = AllocateUninitializedJSArrayWithElements ( <nl> + kind , array_map , length , allocation_site , capacity , capacity_mode , <nl> + allocation_flags ) ; <nl> <nl> - Branch ( SmiEqual ( ParameterToTagged ( capacity , capacity_mode ) , SmiConstant ( 0 ) ) , <nl> - & empty , & nonempty ) ; <nl> + Label out ( this ) , nonempty ( this ) ; <nl> <nl> - BIND ( & empty ) ; <nl> - { <nl> - / / Array is empty . Use the shared empty fixed array instead of allocating <nl> - / / a new one . <nl> - TNode < FixedArrayBase > empty_fixed_array = <nl> - CAST ( LoadRoot ( RootIndex : : kEmptyFixedArray ) ) ; <nl> - var_array = AllocateJSArray ( array_map , empty_fixed_array , length , <nl> - allocation_site ) ; <nl> - Goto ( & out ) ; <nl> - } <nl> - <nl> - BIND ( & nonempty ) ; <nl> - { <nl> - / / Allocate both array and elements object , and initialize the JSArray . <nl> - TNode < JSArray > array ; <nl> - std : : tie ( array , elements ) = AllocateUninitializedJSArrayWithElements ( <nl> - kind , array_map , length , allocation_site , capacity , capacity_mode , <nl> - allocation_flags ) ; <nl> - var_array = array ; <nl> - / / Fill in the elements with holes . <nl> - FillFixedArrayWithValue ( kind , elements , <nl> - IntPtrOrSmiConstant ( 0 , capacity_mode ) , capacity , <nl> - RootIndex : : kTheHoleValue , capacity_mode ) ; <nl> - Goto ( & out ) ; <nl> - } <nl> + Branch ( SmiEqual ( ParameterToTagged ( capacity , capacity_mode ) , SmiConstant ( 0 ) ) , <nl> + & out , & nonempty ) ; <nl> <nl> - BIND ( & out ) ; <nl> - array = var_array . value ( ) ; <nl> + BIND ( & nonempty ) ; <nl> + { <nl> + FillFixedArrayWithValue ( kind , elements , <nl> + IntPtrOrSmiConstant ( 0 , capacity_mode ) , capacity , <nl> + RootIndex : : kTheHoleValue , capacity_mode ) ; <nl> + Goto ( & out ) ; <nl> } <nl> <nl> + BIND ( & out ) ; <nl> return array ; <nl> } <nl> <nl> mmm a / test / mjsunit / object - get - own - property - names . js <nl> ppp b / test / mjsunit / object - get - own - property - names . js <nl> <nl> / / Test ES5 section 15 . 2 . 3 . 4 Object . getOwnPropertyNames . <nl> <nl> / / Check simple cases . <nl> + var obj = { } ; <nl> + assertEquals ( 0 , Object . getOwnPropertyNames ( obj ) . length ) ; <nl> + <nl> var obj = { a : 1 , b : 2 } ; <nl> var propertyNames = Object . getOwnPropertyNames ( obj ) ; <nl> propertyNames . sort ( ) ; <nl> assertEquals ( " a " , propertyNames [ 0 ] ) ; <nl> assertEquals ( " c " , propertyNames [ 1 ] ) ; <nl> <nl> / / Check that non - enumerable properties are being returned . <nl> + var obj = { } ; <nl> + Object . defineProperty ( obj , ' x ' , { <nl> + value : 1 , <nl> + enumerable : false <nl> + } ) ; <nl> + assertEquals ( 1 , Object . getOwnPropertyNames ( obj ) . length ) ; <nl> + <nl> var propertyNames = Object . getOwnPropertyNames ( [ 1 , 2 ] ) ; <nl> propertyNames . sort ( ) ; <nl> assertEquals ( 3 , propertyNames . length ) ; <nl> mmm a / test / mjsunit / object - keys . js <nl> ppp b / test / mjsunit / object - keys . js <nl> <nl> <nl> / / Flags : - - allow - natives - syntax <nl> <nl> + / / Ensure empty keys are handled properly <nl> + ( function ( ) { <nl> + const a = { } ; <nl> + let k = Object . keys ( a ) ; <nl> + % HeapObjectVerify ( k ) ; <nl> + assertEquals ( 0 , k . length ) ; <nl> + } ) ( ) ; <nl> + <nl> + / / Ensure non - enumerable keys are handled properly <nl> + ( function ( ) { <nl> + const a = { } ; <nl> + Object . defineProperty ( a , ' x ' , { <nl> + value : 1 , <nl> + enumerable : false <nl> + } ) ; <nl> + let k = Object . keys ( a ) ; <nl> + % HeapObjectVerify ( k ) ; <nl> + assertEquals ( 0 , k . length ) ; <nl> + <nl> + a . y = 2 ; <nl> + k = Object . keys ( a ) ; <nl> + % HeapObjectVerify ( k ) ; <nl> + assertEquals ( 1 , k . length ) ; <nl> + } ) ( ) ; <nl> + <nl> / / Ensure that mutation of the Object . keys result doesn ' t affect the <nl> / / enumeration cache for fast - mode objects . <nl> ( function ( ) { <nl>
|
Move empty elements canonicalization from call sites of
|
v8/v8
|
37ff95adc0b113be22601fd13307517290e04744
|
2019-03-04T18:07:52Z
|
mmm a / src / objective - c / GRPCClient / private / GRPCCompletionQueue . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCCompletionQueue . m <nl> - ( instancetype ) init { <nl> dispatch_async ( gDefaultConcurrentQueue , ^ { <nl> while ( YES ) { <nl> / / The following call blocks until an event is available . <nl> - grpc_event event = grpc_completion_queue_next ( unmanagedQueue , gpr_inf_future ) ; <nl> + grpc_event event = grpc_completion_queue_next ( unmanagedQueue , <nl> + gpr_inf_future ( GPR_CLOCK_REALTIME ) ) ; <nl> GRPCQueueCompletionHandler handler ; <nl> switch ( event . type ) { <nl> case GRPC_OP_COMPLETE : <nl> mmm a / src / objective - c / GRPCClient / private / GRPCWrappedCall . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCWrappedCall . m <nl> - ( instancetype ) initWithChannel : ( GRPCChannel * ) channel <nl> if ( ! _queue ) { <nl> return nil ; <nl> } <nl> - _call = grpc_channel_create_call ( channel . unmanagedChannel , _queue . unmanagedQueue , <nl> - path . UTF8String , host . UTF8String , gpr_inf_future ) ; <nl> + _call = grpc_channel_create_call ( channel . unmanagedChannel , <nl> + _queue . unmanagedQueue , <nl> + path . UTF8String , <nl> + host . UTF8String , <nl> + gpr_inf_future ( GPR_CLOCK_REALTIME ) ) ; <nl> if ( _call = = NULL ) { <nl> return nil ; <nl> } <nl>
|
Fix C library gpr_inf_future breakage
|
grpc/grpc
|
570e9417b62fd85e1aa50e873c93ebe0ff2a0d5a
|
2015-07-18T07:31:18Z
|
mmm a / src / Core / Settings . h <nl> ppp b / src / Core / Settings . h <nl> class IColumn ; <nl> M ( Bool , cast_keep_nullable , false , " CAST operator keep Nullable for result data type " , 0 ) \ <nl> M ( Bool , alter_partition_verbose_result , false , " Output information about affected parts . Currently works only for FREEZE and ATTACH commands . " , 0 ) \ <nl> M ( Bool , allow_experimental_database_materialize_mysql , false , " Allow to create database with Engine = MaterializeMySQL ( . . . ) . " , 0 ) \ <nl> + M ( Bool , system_events_show_zero_values , false , " Include all metrics , even with zero values " , 0 ) \ <nl> \ <nl> / * * Obsolete settings that do nothing but left for compatibility reasons . Remove each one after half a year of obsolescence . * / \ <nl> \ <nl> mmm a / src / Storages / System / StorageSystemEvents . cpp <nl> ppp b / src / Storages / System / StorageSystemEvents . cpp <nl> <nl> # include < Common / ProfileEvents . h > <nl> + # include < Interpreters / Context . h > <nl> # include < DataTypes / DataTypeString . h > <nl> # include < DataTypes / DataTypesNumber . h > <nl> # include < Storages / System / StorageSystemEvents . h > <nl> NamesAndTypesList StorageSystemEvents : : getNamesAndTypes ( ) <nl> } ; <nl> } <nl> <nl> - void StorageSystemEvents : : fillData ( MutableColumns & res_columns , const Context & , const SelectQueryInfo & ) const <nl> + void StorageSystemEvents : : fillData ( MutableColumns & res_columns , const Context & context , const SelectQueryInfo & ) const <nl> { <nl> for ( size_t i = 0 , end = ProfileEvents : : end ( ) ; i < end ; + + i ) <nl> { <nl> UInt64 value = ProfileEvents : : global_counters [ i ] ; <nl> <nl> - if ( 0 ! = value ) <nl> + if ( 0 ! = value | | context . getSettingsRef ( ) . system_events_show_zero_values ) <nl> { <nl> res_columns [ 0 ] - > insert ( ProfileEvents : : getName ( ProfileEvents : : Event ( i ) ) ) ; <nl> res_columns [ 1 ] - > insert ( value ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 573541ac970 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01473_system_events_zeroes . reference <nl> @ @ - 0 , 0 + 1 @ @ <nl> + 0 <nl> new file mode 100644 <nl> index 00000000000 . . 62478c525e7 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01473_system_events_zeroes . sql <nl> <nl> + SET system_events_show_zero_values = 1 ; <nl> + SELECT value FROM system . events WHERE event = = ' PerfAlignmentFaults ' ; <nl> + SET system_events_show_zero_values = 0 ; <nl>
|
Merge pull request from dimarub2000 / system_events_show_zero_values
|
ClickHouse/ClickHouse
|
8b0a6d56094b92ae72fa8280b9557b3fc76b198b
|
2020-09-07T03:40:36Z
|
mmm a / src / flag - definitions . h <nl> ppp b / src / flag - definitions . h <nl> DEFINE_IMPLICATION ( perf_basic_prof_only_functions , perf_basic_prof ) <nl> DEFINE_BOOL ( perf_prof , false , <nl> " Enable perf linux profiler ( experimental annotate support ) . " ) <nl> DEFINE_NEG_IMPLICATION ( perf_prof , compact_code_space ) <nl> + / / TODO ( v8 : 8462 ) Remove implication once perf supports remapping . <nl> + DEFINE_NEG_IMPLICATION ( perf_prof , write_protect_code_memory ) <nl> + DEFINE_NEG_IMPLICATION ( perf_prof , wasm_write_protect_code_memory ) <nl> DEFINE_BOOL ( perf_prof_unwinding_info , false , <nl> " Enable unwinding info for perf linux profiler ( experimental ) . " ) <nl> DEFINE_IMPLICATION ( perf_prof , perf_prof_unwinding_info ) <nl> mmm a / src / wasm / wasm - code - manager . cc <nl> ppp b / src / wasm / wasm - code - manager . cc <nl> WasmCodeManager : : WasmCodeManager ( WasmMemoryTracker * memory_tracker , <nl> } <nl> <nl> bool WasmCodeManager : : Commit ( Address start , size_t size ) { <nl> + / / TODO ( v8 : 8462 ) Remove eager commit once perf supports remapping . <nl> + if ( FLAG_perf_prof ) return true ; <nl> DCHECK ( IsAligned ( start , AllocatePageSize ( ) ) ) ; <nl> DCHECK ( IsAligned ( size , AllocatePageSize ( ) ) ) ; <nl> / / Reserve the size . Use CAS loop to avoid underflow on <nl> VirtualMemory WasmCodeManager : : TryAllocate ( size_t size , void * hint ) { <nl> TRACE_HEAP ( " VMem alloc : % p : % p ( % zu ) \ n " , <nl> reinterpret_cast < void * > ( mem . address ( ) ) , <nl> reinterpret_cast < void * > ( mem . end ( ) ) , mem . size ( ) ) ; <nl> + <nl> + / / TODO ( v8 : 8462 ) Remove eager commit once perf supports remapping . <nl> + if ( FLAG_perf_prof ) { <nl> + SetPermissions ( GetPlatformPageAllocator ( ) , mem . address ( ) , mem . size ( ) , <nl> + PageAllocator : : kReadWriteExecute ) ; <nl> + } <nl> return mem ; <nl> } <nl> <nl>
|
[ wasm ] Commit code space eagerly when profiling
|
v8/v8
|
b344f31cdedd237001a750938b39ae3fde461f24
|
2018-11-16T15:38:53Z
|
mmm a / test / quantization / test_quantize . py <nl> ppp b / test / quantization / test_quantize . py <nl> <nl> float_qparams_dynamic_qconfig , <nl> PerChannelMinMaxObserver , <nl> QConfigDynamic , <nl> - default_dynamic_quant_observer , <nl> - FixedQParamsFakeQuantize , <nl> + default_dynamic_quant_observer <nl> ) <nl> <nl> from torch . testing . _internal . common_quantization import ( <nl> def forward ( self , x ) : <nl> def test_leaky_relu ( self ) : <nl> self . _test_activation_op_impl ( nn . LeakyReLU , nnq . LeakyReLU , { ' negative_slope ' : 0 . 1 , ' inplace ' : False } ) <nl> <nl> - <nl> - class TestEagerModeQATOps ( QuantizationTestCase ) : <nl> - def test_fixed_qparam_ops ( self ) : <nl> - class M ( torch . nn . Module ) : <nl> - def __init__ ( self ) : <nl> - super ( ) . __init__ ( ) <nl> - self . sigmoid = torch . nn . Sigmoid ( ) <nl> - self . hardsigmoid = torch . nn . Hardsigmoid ( ) <nl> - self . tanh = torch . nn . Tanh ( ) <nl> - self . quant = QuantStub ( ) <nl> - self . dequant = DeQuantStub ( ) <nl> - <nl> - def forward ( self , x ) : <nl> - x = self . quant ( x ) <nl> - x = self . sigmoid ( x ) <nl> - x = self . hardsigmoid ( x ) <nl> - x = self . tanh ( x ) <nl> - x = self . dequant ( x ) <nl> - return x <nl> - <nl> - m = M ( ) . train ( ) <nl> - m . qconfig = default_qat_qconfig <nl> - m = prepare_qat ( m ) <nl> - for attr in [ ' sigmoid ' , ' hardsigmoid ' , ' tanh ' ] : <nl> - self . assertEqual ( type ( getattr ( m , attr ) . activation_post_process ) , FixedQParamsFakeQuantize ) <nl> - m = convert ( m ) <nl> - # make sure activation post process is removed <nl> - for attr in [ ' sigmoid ' , ' hardsigmoid ' , ' tanh ' ] : <nl> - self . assertFalse ( hasattr ( getattr ( m , attr ) , ' activation_post_process ' ) ) <nl> - <nl> class TestFunctionalModule ( QuantizationTestCase ) : <nl> # Histogram Observers are slow , so have no - deadline to ensure test doesn ' t time out <nl> @ given ( train_mode = st . booleans ( ) ) <nl> mmm a / test / quantization / test_quantize_fx . py <nl> ppp b / test / quantization / test_quantize_fx . py <nl> <nl> convert , <nl> PerChannelMinMaxObserver , <nl> QConfigDynamic , <nl> - FixedQParamsFakeQuantize , <nl> ) <nl> <nl> # test utils <nl> def test_general_value_ops ( self ) : <nl> " " " <nl> class M ( torch . nn . Module ) : <nl> def __init__ ( self ) : <nl> - super ( ) . __init__ ( ) <nl> + super ( M , self ) . __init__ ( ) <nl> self . conv = torch . nn . Conv2d ( 3 , 3 , 3 ) <nl> self . avg_pool1d = torch . nn . AvgPool1d ( 3 ) <nl> self . avg_pool2d = torch . nn . AvgPool2d ( 3 ) <nl> def __init__ ( self ) : <nl> self . adaptive_avg_pool1d = torch . nn . AdaptiveAvgPool1d ( ( 1 ) ) <nl> self . adaptive_avg_pool2d = torch . nn . AdaptiveAvgPool2d ( ( 1 , 1 ) ) <nl> self . adaptive_avg_pool3d = torch . nn . AdaptiveAvgPool3d ( ( 1 , 1 , 1 ) ) <nl> + self . hardsigmoid = torch . nn . Hardsigmoid ( ) <nl> + self . sigmoid = torch . nn . Sigmoid ( ) <nl> + self . tanh = torch . nn . Tanh ( ) <nl> <nl> def forward ( self , x ) : <nl> x = self . conv ( x ) <nl> def forward ( self , x ) : <nl> x = x . mean ( [ 2 , 3 ] , True ) <nl> x = F . interpolate ( x , 4 , mode = ' nearest ' ) <nl> x = F . interpolate ( x , 4 , mode = ' linear ' ) <nl> + x = self . hardsigmoid ( x ) <nl> + x = F . hardsigmoid ( x ) <nl> + x = F . hardsigmoid ( x , inplace = True ) <nl> + x = x . hardsigmoid ( ) <nl> + x . hardsigmoid_ ( ) <nl> + x = self . sigmoid ( x ) <nl> + x = torch . sigmoid ( x ) <nl> + # F . sigmoid is deprecated <nl> + x = x . sigmoid ( ) <nl> + x . sigmoid_ ( ) <nl> + x = self . tanh ( x ) <nl> + # F . tanh is deprecated <nl> + x = torch . tanh ( x ) <nl> + x = x . tanh ( ) <nl> + x . tanh_ ( ) <nl> x = self . conv ( x ) <nl> return x <nl> <nl> def forward ( self , x ) : <nl> expected_node_occurrence = count_check , <nl> expected_node_list = order_check ) <nl> <nl> - @ skipIfNoFBGEMM <nl> - def test_fixed_qparams_ops ( self ) : <nl> - class M ( torch . nn . Module ) : <nl> - def __init__ ( self ) : <nl> - super ( ) . __init__ ( ) <nl> - self . conv = torch . nn . Conv2d ( 3 , 3 , 3 ) <nl> - self . sigmoid = torch . nn . Sigmoid ( ) <nl> - self . hardsigmoid = torch . nn . Hardsigmoid ( ) <nl> - self . tanh = torch . nn . Tanh ( ) <nl> - <nl> - def forward ( self , x ) : <nl> - x = self . conv ( x ) <nl> - # F . sigmoid is deprecated <nl> - x = self . sigmoid ( x ) <nl> - x = torch . sigmoid ( x ) <nl> - x = x . sigmoid ( ) <nl> - x . sigmoid_ ( ) <nl> - x = self . hardsigmoid ( x ) <nl> - x = F . hardsigmoid ( x ) <nl> - x = F . hardsigmoid ( x , inplace = True ) <nl> - x = x . hardsigmoid ( ) <nl> - x . hardsigmoid_ ( ) <nl> - x = self . tanh ( x ) <nl> - # F . tanh is deprecated <nl> - x = torch . tanh ( x ) <nl> - x = x . tanh ( ) <nl> - x . tanh_ ( ) <nl> - x = self . conv ( x ) <nl> - return x <nl> - <nl> - for eval_mode in [ True , False ] : <nl> - # This model is not executable since we just put all ops <nl> - # in the same forward <nl> - m = M ( ) <nl> - if eval_mode : <nl> - m . eval ( ) <nl> - qconfig = default_qconfig <nl> - prepare = prepare_fx <nl> - fq_count = 0 <nl> - else : <nl> - m . train ( ) <nl> - qconfig = default_qat_qconfig <nl> - prepare = prepare_qat_fx <nl> - fq_count = 13 <nl> - <nl> - # nothing to fuse so skipping the fuse step <nl> - qconfig_dict = { ' ' : qconfig } <nl> - prepared = prepare ( m , qconfig_dict ) <nl> - # check the correct number of activation_post_process is inserted <nl> - count_check = { <nl> - ns . call_module ( FixedQParamsFakeQuantize ) : fq_count , <nl> - } <nl> - self . checkGraphModuleNodes ( <nl> - prepared , <nl> - expected_node_occurrence = count_check ) <nl> - # not runnable <nl> - quantized = convert_fx ( prepared ) <nl> - <nl> - # This checks that the dequantize from the output of first conv <nl> - # is being propagated to the end , so that we don ' t insert extra <nl> - # observers <nl> - # check exact counts of quantize and dequantize <nl> - count_check = { <nl> - ns . call_function ( torch . quantize_per_tensor ) : 1 , <nl> - ns . call_method ( ' dequantize ' ) : 1 <nl> - } <nl> - order_check = [ <nl> - ns . call_function ( torch . quantize_per_tensor ) , <nl> - ns . call_module ( nnq . Conv2d ) , <nl> - ns . call_module ( nn . Sigmoid ) , <nl> - ns . call_module ( nnq . Conv2d ) , <nl> - ns . call_method ( ' dequantize ' ) , <nl> - ] <nl> - self . checkGraphModuleNodes ( <nl> - quantized , <nl> - expected_node_occurrence = count_check , <nl> - expected_node_list = order_check ) <nl> - <nl> def test_float_functional ( self ) : <nl> class TorchAdd ( nn . Module ) : <nl> " " " Wrapper around torch . add so that all ops can be found at build " " " <nl> mmm a / test / test_quantization . py <nl> ppp b / test / test_quantization . py <nl> <nl> from quantization . test_quantize import TestPostTrainingDynamic # noqa : F401 <nl> from quantization . test_quantize import TestQuantizationAwareTraining # noqa : F401 <nl> from quantization . test_quantize import TestEagerModeOps # noqa : F401 <nl> - from quantization . test_quantize import TestEagerModeQATOps # noqa : F401 <nl> <nl> # TODO : merge with other tests in test_quantize . py ? <nl> from quantization . test_quantize import TestFunctionalModule # noqa : F401 <nl> <nl> from quantization . test_quantize_fx import TestQuantizeFxOps # noqa : F401 <nl> from quantization . test_quantize_fx import TestQuantizeFxModels # noqa : F401 <nl> <nl> - # Tooling : numeric_suite <nl> + # Tooling : numric_suite <nl> from quantization . test_numeric_suite import TestEagerModeNumericSuite # noqa : F401 <nl> <nl> # Backward Compatibility <nl> mmm a / torch / quantization / fake_quantize . py <nl> ppp b / torch / quantization / fake_quantize . py <nl> def forward ( self , X ) : <nl> <nl> @ torch . jit . export <nl> def extra_repr ( self ) : <nl> - return ' fake_quant_enabled = { } , observer_enabled = { } , ' \ <nl> - ' quant_min = { } , quant_max = { } , dtype = { } , qscheme = { } , ch_axis = { } , ' \ <nl> - ' scale = { } , zero_point = { } ' . format ( <nl> - self . fake_quant_enabled , self . observer_enabled , <nl> - self . quant_min , self . quant_max , <nl> - self . dtype , self . qscheme , self . ch_axis , self . scale , self . zero_point ) <nl> + return ' fake_quant_enabled = { } , observer_enabled = { } , \ <nl> + quant_min = { } , quant_max = { } , dtype = { } , qscheme = { } , ch_axis = { } , \ <nl> + scale = { } , zero_point = { } ' . format ( <nl> + self . fake_quant_enabled , self . observer_enabled , <nl> + self . quant_min , self . quant_max , <nl> + self . dtype , self . qscheme , self . ch_axis , self . scale , self . zero_point ) <nl> <nl> def _save_to_state_dict ( self , destination , prefix , keep_vars ) : <nl> # We cannot currently register scalar values as buffers , so need to manually <nl> def forward ( self , X ) : <nl> self . quant_max ) <nl> return X <nl> <nl> - @ torch . jit . export <nl> def calculate_qparams ( self ) : <nl> return self . scale , self . zero_point <nl> <nl> - @ torch . jit . export <nl> - def extra_repr ( self ) : <nl> - return ' fake_quant_enabled = { } , observer_enabled = { } , scale = { } , zero_point = { } , ' \ <nl> - ' dtype = { } , quant_min = { } , quant_max = { } , qscheme = { } ' . format ( <nl> - self . fake_quant_enabled , self . observer_enabled , <nl> - self . scale , self . zero_point , self . dtype , <nl> - self . quant_min , self . quant_max , self . qscheme ) <nl> - <nl> - <nl> default_fake_quant = FakeQuantize . with_args ( observer = MovingAverageMinMaxObserver , quant_min = 0 , quant_max = 255 , <nl> dtype = torch . quint8 , qscheme = torch . per_tensor_affine , reduce_range = True ) <nl> default_weight_fake_quant = FakeQuantize . with_args ( observer = MovingAverageMinMaxObserver , quant_min = - 128 , quant_max = 127 , <nl> mmm a / torch / quantization / fx / pattern_utils . py <nl> ppp b / torch / quantization / fx / pattern_utils . py <nl> def get_default_fusion_patterns ( ) : <nl> return DEFAULT_FUSION_PATTERNS <nl> <nl> DEFAULT_QUANTIZATION_PATTERNS = OrderedDict ( ) <nl> - # a map from pattern to activation_post_process ( observer / fake_quant ) consstructor for output activation <nl> - # e . g . pattern : torch . sigmoid , <nl> - # output_activation_post_process : default_affine_fixed_qparam_fake_quant <nl> - DEFAULT_OUTPUT_ACTIVATION_POST_PROCESS_MAP = dict ( ) <nl> - <nl> # Register pattern for both static quantization and qat <nl> - def register_quant_pattern ( pattern , output_activation_post_process = None ) : <nl> + def register_quant_pattern ( pattern ) : <nl> def insert ( fn ) : <nl> DEFAULT_QUANTIZATION_PATTERNS [ pattern ] = fn <nl> - if output_activation_post_process is not None : <nl> - DEFAULT_OUTPUT_ACTIVATION_POST_PROCESS_MAP [ pattern ] = output_activation_post_process <nl> return fn <nl> return insert <nl> <nl> def insert ( fn ) : <nl> def get_default_quant_patterns ( ) : <nl> return DEFAULT_QUANTIZATION_PATTERNS <nl> <nl> - # a map from pattern to output activation post process constructor <nl> - # e . g . torch . sigmoid - > default_affine_fixed_qparam_fake_quant <nl> - def get_default_output_activation_post_process_map ( ) : <nl> - return DEFAULT_OUTPUT_ACTIVATION_POST_PROCESS_MAP <nl> - <nl> - <nl> # Example use of register pattern function : <nl> # @ register_fusion_pattern ( torch . nn . ReLU , ( torch . nn . BatchNorm2d , torch . nn . Conv2d ) ) ) <nl> # class ConvBNReLUFusion ( ) : <nl> def is_match ( modules , node , pattern , max_uses = sys . maxsize ) : <nl> elif node . target is getattr : <nl> if node . args [ 1 ] ! = pattern [ 1 ] : <nl> return False <nl> - elif isinstance ( self_match , str ) : <nl> - if node . op ! = ' call_method ' or node . target ! = self_match : <nl> - return False <nl> elif node . target ! = self_match : <nl> return False <nl> <nl> mmm a / torch / quantization / fx / quantization_patterns . py <nl> ppp b / torch / quantization / fx / quantization_patterns . py <nl> <nl> ) <nl> import torch . nn . quantized as nnq <nl> import torch . nn . quantized . dynamic as nnqd <nl> - from torch . quantization import ( <nl> - default_affine_fixed_qparams_fake_quant , <nl> - default_symmetric_fixed_qparams_fake_quant , <nl> - ) <nl> <nl> from . . quantization_mappings import ( <nl> get_static_quant_module_class , <nl> def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_ <nl> return quantizer . quantized_graph . create_node ( <nl> ' call_function ' , quantized_op , args , kwargs ) <nl> <nl> - @ register_quant_pattern ( torch . nn . Hardsigmoid , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( torch . nn . functional . hardsigmoid , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( ' hardsigmoid ' , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( ' hardsigmoid_ ' , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( torch . nn . Sigmoid , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( torch . sigmoid , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( ' sigmoid ' , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( ' sigmoid_ ' , default_affine_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( torch . nn . Tanh , default_symmetric_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( torch . tanh , default_symmetric_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( ' tanh ' , default_symmetric_fixed_qparams_fake_quant ) <nl> - @ register_quant_pattern ( ' tanh_ ' , default_symmetric_fixed_qparams_fake_quant ) <nl> - class FixedQParamsOpQuantizeHandler ( QuantizeHandler ) : <nl> - def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_dict = None ) : <nl> - return quantizer . quantized_graph . node_copy ( node , load_arg ( quantized = None ) ) <nl> - <nl> # these ops have quantized equivalents that do not need any extra information <nl> @ register_quant_pattern ( torch . nn . AdaptiveAvgPool1d ) <nl> @ register_quant_pattern ( torch . nn . AdaptiveAvgPool2d ) <nl> def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_ <nl> @ register_quant_pattern ( torch . nn . AvgPool2d ) <nl> @ register_quant_pattern ( torch . nn . AvgPool3d ) <nl> @ register_quant_pattern ( torch . nn . Dropout ) <nl> + @ register_quant_pattern ( torch . nn . Hardsigmoid ) <nl> @ register_quant_pattern ( torch . nn . Hardtanh ) <nl> @ register_quant_pattern ( torch . nn . MaxPool1d ) <nl> @ register_quant_pattern ( torch . nn . MaxPool2d ) <nl> @ register_quant_pattern ( torch . nn . MaxPool3d ) <nl> @ register_quant_pattern ( torch . nn . ReLU ) <nl> @ register_quant_pattern ( torch . nn . ReLU6 ) <nl> + @ register_quant_pattern ( torch . nn . Sigmoid ) <nl> + @ register_quant_pattern ( torch . nn . Tanh ) <nl> @ register_quant_pattern ( torch . adaptive_avg_pool1d ) <nl> @ register_quant_pattern ( torch . nn . functional . adaptive_avg_pool2d ) <nl> @ register_quant_pattern ( torch . nn . functional . adaptive_avg_pool3d ) <nl> @ register_quant_pattern ( torch . nn . functional . dropout ) <nl> + @ register_quant_pattern ( torch . nn . functional . hardsigmoid ) <nl> @ register_quant_pattern ( torch . nn . functional . hardtanh ) <nl> @ register_quant_pattern ( torch . nn . functional . hardtanh_ ) <nl> @ register_quant_pattern ( torch . nn . functional . interpolate ) <nl> def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_ <nl> @ register_quant_pattern ( torch . mean ) <nl> @ register_quant_pattern ( torch . min ) <nl> @ register_quant_pattern ( torch . repeat_interleave ) <nl> + @ register_quant_pattern ( torch . sigmoid ) <nl> @ register_quant_pattern ( torch . sort ) <nl> @ register_quant_pattern ( torch . squeeze ) <nl> @ register_quant_pattern ( torch . stack ) <nl> + @ register_quant_pattern ( torch . tanh ) <nl> @ register_quant_pattern ( torch . unsqueeze ) <nl> @ register_quant_pattern ( operator . getitem ) <nl> @ register_quant_pattern ( operator . floordiv ) <nl> def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_ <nl> @ register_quant_pattern ( ' contiguous ' ) <nl> @ register_quant_pattern ( ' detach ' ) <nl> @ register_quant_pattern ( ' detach_ ' ) <nl> + @ register_quant_pattern ( ' hardsigmoid ' ) <nl> + @ register_quant_pattern ( ' hardsigmoid_ ' ) <nl> @ register_quant_pattern ( ' mean ' ) <nl> @ register_quant_pattern ( ' numel ' ) <nl> @ register_quant_pattern ( ' permute ' ) <nl> def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_ <nl> @ register_quant_pattern ( ' reshape ' ) <nl> @ register_quant_pattern ( ' resize_ ' ) <nl> @ register_quant_pattern ( ' shape ' ) <nl> + @ register_quant_pattern ( ' sigmoid ' ) <nl> + @ register_quant_pattern ( ' sigmoid_ ' ) <nl> @ register_quant_pattern ( ' size ' ) <nl> @ register_quant_pattern ( ' squeeze ' ) <nl> @ register_quant_pattern ( ' squeeze_ ' ) <nl> + @ register_quant_pattern ( ' tanh ' ) <nl> + @ register_quant_pattern ( ' tanh_ ' ) <nl> @ register_quant_pattern ( ' transpose ' ) <nl> @ register_quant_pattern ( ' unsqueeze ' ) <nl> @ register_quant_pattern ( ' unsqueeze_ ' ) <nl> def convert ( self , quantizer , node , load_arg , debug = False , convert_custom_config_ <nl> <nl> # Default quantization handler , used for quantization of input and output <nl> # of quantizable objects ( e . g . modules and functionals ) <nl> - class DefaultQuantizeHandler ( QuantizeHandler ) : <nl> + class DefaultQuant ( QuantizeHandler ) : <nl> def convert ( self , quantizer , node ) : <nl> assert self . all_nodes <nl> root_module = quantizer . modules [ ' ' ] <nl> mmm a / torch / quantization / fx / quantize . py <nl> ppp b / torch / quantization / fx / quantize . py <nl> <nl> get_default_qat_module_mappings , <nl> ) <nl> <nl> - from . . quantize import ( <nl> - _remove_qconfig , <nl> - is_activation_post_process <nl> - ) <nl> + from . . quantize import _remove_qconfig <nl> <nl> from . pattern_utils import ( <nl> is_match , <nl> get_default_quant_patterns , <nl> - get_default_output_activation_post_process_map , <nl> ) <nl> <nl> from . standalone_module import ( <nl> def assert_and_get_unique_device ( module ) : <nl> device = next ( iter ( devices ) ) if len ( devices ) > 0 else None <nl> return device <nl> <nl> + def is_activation_post_process ( module ) : <nl> + return ( isinstance ( module , torch . quantization . ObserverBase ) or <nl> + isinstance ( module , torch . quantization . FakeQuantize ) or <nl> + isinstance ( module , torch . quantization . FakeQuantizeBase ) ) <nl> + <nl> def is_submodule_of_fake_quant ( name , module , named_modules ) : <nl> parent_name , _ = _parent_name ( name ) <nl> return is_activation_post_process ( named_modules [ parent_name ] ) <nl> def _prepare ( self , model , qconfig_dict , inplace , prepare_custom_config_dict , is_ <nl> <nl> # find _inputs_ to matched nodes that are not quantized , these <nl> # have to be quantized , which requires measuring stats , <nl> - # initialize an DefaultQuantizeHandler object for each <nl> + # initialize an DefaultQuant object for each <nl> quants = self . _find_quants ( model . graph , matches ) <nl> <nl> self . activation_post_process_map = dict ( ) <nl> def load_arg ( a ) : <nl> continue <nl> <nl> prefix = node . name + ' _activation_post_process_ ' <nl> - root_node , _ , pattern , obj , qconfig = matches . get ( node . name , ( None , None , None , None , None ) ) <nl> + root_node , _ , obj , qconfig = matches . get ( node . name , ( None , None , None , None ) ) <nl> if root_node is None : <nl> env [ node . name ] = observed_graph . node_copy ( node , load_arg ) <nl> elif root_node is node : <nl> def insert_observer ( node , observer , device ) : <nl> if not activation_is_statically_quantized ( qconfig ) : <nl> continue <nl> <nl> - if isinstance ( obj , FixedQParamsOpQuantizeHandler ) and model . training : <nl> - # we only insert fake quantize module in qat <nl> - activation_post_process_ctr = \ <nl> - get_default_output_activation_post_process_map ( ) . get ( pattern , None ) <nl> - assert activation_post_process_ctr is not None , \ <nl> - ' activation_post_process constructor not provided for ' + \ <nl> - ' pattern : ' + str ( pattern ) <nl> - device = assert_and_get_unique_device ( model ) <nl> - insert_observer ( node , activation_post_process_ctr ( ) , device ) <nl> - elif ( isinstance ( obj , FixedQParamsOpQuantizeHandler ) and not model . training ) \ <nl> - or isinstance ( obj , CopyNode ) : <nl> - # inserting observers for output of observed module , or mark the output <nl> - # as observed <nl> + # inserting observers for output of observed module , or mark the output <nl> + # as observed <nl> + if isinstance ( obj , CopyNode ) : <nl> assert node . op in [ <nl> ' call_module ' , <nl> ' call_function ' , <nl> def is_observed ( input_arg ) : <nl> else : <nl> env [ node . name ] = observed_graph . node_copy ( node , load_arg ) <nl> <nl> - # insert observer for output of the node <nl> if node . name not in observed_node_names_set and node . name in quants : <nl> if is_standalone_module and node . name in graph_inputs : <nl> # we ' ll insert observer for input of standalone module <nl> def is_observed ( input_arg ) : <nl> continue <nl> get_new_observer_name = get_new_attr_name_with_prefix ( prefix ) <nl> observer_name = get_new_observer_name ( model ) <nl> - _ , activation_post_process_ctr = quants [ node . name ] <nl> - if activation_post_process_ctr is not None : <nl> + _ , qconfig , is_weight = quants [ node . name ] <nl> + if qconfig is not None : <nl> # TODO : use insert_observer <nl> - new_observer = activation_post_process_ctr ( ) <nl> - <nl> + new_observer = \ <nl> + qconfig . weight ( ) if is_weight else qconfig . activation ( ) <nl> # respect device affinity when adding observers <nl> device = assert_and_get_unique_device ( model ) <nl> if device : <nl> def is_quantized ( node ) : <nl> graph_output = map_arg ( node . args [ 0 ] , load_non_quantized ) <nl> self . quantized_graph . output ( graph_output ) <nl> continue <nl> - root_node , matched , matched_pattern , obj , qconfig = matches . get ( node . name , ( None , None , None , None , None ) ) <nl> + root_node , matched , obj , qconfig = matches . get ( node . name , ( None , None , None , None ) ) <nl> if root_node is node : <nl> if qconfig is None : <nl> result = self . quantized_graph . node_copy ( node , load_non_quantized ) <nl> def is_quantized ( node ) : <nl> quantized = True <nl> <nl> # Need to get correct quantized / non - quantized state for the output of CopyNode <nl> - if type ( obj ) in [ <nl> - CopyNode , <nl> - FixedQParamsOpQuantizeHandler <nl> - ] : <nl> + if isinstance ( obj , CopyNode ) : <nl> assert node . op in [ <nl> ' call_module ' , <nl> ' call_function ' , <nl> def load_arg ( a ) : <nl> else : <nl> env [ node . name ] = act_post_process_removed_graph . node_copy ( node , load_arg ) <nl> <nl> - # removes qconfig and activation_post_process modules <nl> + module_dict = dict ( model . named_modules ( ) ) <nl> + to_be_removed = [ ] <nl> + for name , module in model . named_modules ( ) : <nl> + if is_activation_post_process ( module ) and not is_submodule_of_fake_quant ( name , module , module_dict ) : <nl> + to_be_removed . append ( name ) <nl> + for n in to_be_removed : <nl> + delattr ( model , n ) <nl> _remove_qconfig ( model ) <nl> model = GraphModule ( model , act_post_process_removed_graph ) <nl> return model <nl> def _find_matches ( <nl> <nl> Outputs a map of <nl> node_name - > <nl> - ( node , matched_values , matched_pattern , QuantizeHandler instance , qconfig ) <nl> + ( node , matched_values , QuantizeHandler instance , qconfig ) <nl> <nl> For example , { <nl> - ' relu_1 ' : ( relu_1 , [ relu_1 ] , torch . nn . functional . relu , < CopyNode instance > , QConfig ( . . . ) ) , <nl> + ' relu_1 ' : ( relu_1 , [ relu_1 ] , < CopyNode instance > , QConfig ( . . . ) ) , <nl> . . . <nl> } <nl> " " " <nl> def record_match ( pattern , node , matched ) : <nl> matched = [ ] <nl> record_match ( pattern , node , matched ) <nl> for n in matched : <nl> - match_map [ n . name ] = ( node , matched , pattern , value ( self , node ) , self . qconfig_map [ n . name ] ) <nl> + match_map [ n . name ] = ( node , matched , value ( self , node ) , self . qconfig_map [ n . name ] ) <nl> all_matched . add ( n . name ) <nl> # break after finding the first match <nl> break <nl> def record_match ( pattern , node , matched ) : <nl> type ( self . modules [ node . target ] ) in custom_module_class_mapping : <nl> custom_module_qconfig = self . qconfig_map [ node . name ] <nl> match_map [ node . name ] = ( <nl> - node , [ node ] , None , CustomModuleQuantizeHandler ( self , node ) , custom_module_qconfig ) <nl> + node , [ node ] , CustomModuleQuantizeHandler ( self , node ) , custom_module_qconfig ) <nl> <nl> def is_standalone_module ( module_path ) : <nl> if standalone_module_names is None : <nl> def is_standalone_module ( module_path ) : <nl> # add node to matched nodes <nl> custom_module_qconfig = self . qconfig_map [ node . name ] <nl> match_map [ node . name ] = ( <nl> - node , [ node ] , None , StandaloneModuleQuantizeHandler ( self , node ) , custom_module_qconfig ) <nl> + node , [ node ] , StandaloneModuleQuantizeHandler ( self , node ) , custom_module_qconfig ) <nl> <nl> return match_map <nl> <nl> def _find_quants ( self , graph , matches ) : <nl> - matches : output of self . _find_matches function <nl> <nl> Outputs a map of <nl> - node_name - > ( QuantizeHandler instance ( always DefaultQuantizeHandler ) , <nl> - activation_post_process ( observer / fake_quantize module ) constructor ) <nl> + node_name - > ( QuantizeHandler instance ( always DefaultQuant ) , qconfig ) <nl> " " " <nl> quants = { } <nl> <nl> - def visit ( node , matched_pattern , qconfig ) : <nl> + def visit ( node , qconfig ) : <nl> def visit_arg ( arg ) : <nl> + # note : we have to measure quantization information <nl> + # even for nodes where we might not use it because it is already <nl> + # quantized . This is because each match has the option to <nl> + # say NotImplemented ( if for instance , it is an __add__ and the data type is not appropriate ) <nl> is_weight = False <nl> if isinstance ( node , Node ) and node . op = = ' call_function ' and node . target in WEIGHT_INDEX_DICT : <nl> for i , node_arg in enumerate ( node . args ) : <nl> def visit_arg ( arg ) : <nl> is_weight = True <nl> if qconfig is not None and \ <nl> ( activation_is_statically_quantized ( qconfig ) or is_weight ) : <nl> - act_post_process_ctr = qconfig . weight if is_weight else qconfig . activation <nl> - quants [ arg . name ] = ( DefaultQuantizeHandler ( self , arg ) , qconfig , is_weight ) <nl> - # overwrite the constructor from qconfig <nl> - act_post_process_ctr = \ <nl> - get_default_output_activation_post_process_map ( ) . get ( <nl> - matched_pattern , <nl> - act_post_process_ctr ) <nl> - # overwrite previous activation post process constructor if necessary <nl> - quants [ arg . name ] = ( DefaultQuantizeHandler ( self , arg ) , act_post_process_ctr ) <nl> + # overwrite previous quant config <nl> + quants [ arg . name ] = ( DefaultQuant ( self , arg ) , qconfig , is_weight ) <nl> return visit_arg <nl> <nl> for node in graph . nodes : <nl> if node . name in matches : <nl> - root_node , matched_nodes , matched_pattern , quantize_handler , qconfig = matches [ node . name ] <nl> + root_node , matched , obj , qconfig = matches [ node . name ] <nl> # don ' t attach observer / fake_quant for CopyNode <nl> - if isinstance ( quantize_handler , CopyNode ) : <nl> + if isinstance ( obj , CopyNode ) : <nl> qconfig = None <nl> if root_node is node : <nl> - # matched_nodes [ - 1 ] is the first op in the sequence and <nl> - # matched_nodes [ 0 ] is the last op in the sequence <nl> + # matched [ - 1 ] is the first op in the sequence and <nl> + # matched [ 0 ] is the last op in the sequence <nl> # inputs <nl> - # matched_pattern is set to None for inputs because <nl> - # we only want to select QuantizeHandler object based <nl> - # on pattern for output , inputs will always use <nl> - # DefaultQuantizeHandler <nl> - map_arg ( matched_nodes [ - 1 ] . args , visit ( matched_nodes [ - 1 ] , None , qconfig ) ) <nl> - map_arg ( matched_nodes [ - 1 ] . kwargs , visit ( matched_nodes [ - 1 ] , None , qconfig ) ) <nl> - <nl> + map_arg ( matched [ - 1 ] . args , visit ( matched [ - 1 ] , qconfig ) ) <nl> + map_arg ( matched [ - 1 ] . kwargs , visit ( matched [ - 1 ] , qconfig ) ) <nl> # output <nl> - # we don ' t insert observer for output of standalone module <nl> - if not isinstance ( quantize_handler , StandaloneModuleQuantizeHandler ) : <nl> - # passing in matched_pattern here so that we can customize <nl> - # activation_post_process constructor for output based on the pattern , e . g . <nl> - # for sigmoid op we ' ll use default_affine_fixed_qparam_fake_quant <nl> - map_arg ( matched_nodes [ 0 ] , visit ( None , matched_pattern , qconfig ) ) <nl> + if isinstance ( obj , StandaloneModuleQuantizeHandler ) : <nl> + # we don ' t insert observer for output of custom <nl> + # module <nl> + continue <nl> + map_arg ( matched [ 0 ] , visit ( None , qconfig ) ) <nl> return quants <nl> mmm a / torch / quantization / quantization_mappings . py <nl> ppp b / torch / quantization / quantization_mappings . py <nl> <nl> import torch . nn . qat as nnqat <nl> <nl> from . stubs import QuantStub , DeQuantStub <nl> - from . fake_quantize import ( <nl> - default_affine_fixed_qparams_fake_quant , <nl> - default_symmetric_fixed_qparams_fake_quant , <nl> - ) <nl> <nl> # Default map for swapping float module to quantized ones <nl> DEFAULT_STATIC_QUANT_MODULE_MAPPINGS = { <nl> <nl> F . leaky_relu : torch . _ops . ops . quantized . leaky_relu , <nl> } <nl> <nl> - # mapping from module to output activation post process class <nl> - DEFAULT_MODULE_TO_ACT_POST_PROCESS = { <nl> - nn . Hardsigmoid : default_affine_fixed_qparams_fake_quant , <nl> - nn . Sigmoid : default_affine_fixed_qparams_fake_quant , <nl> - nn . Tanh : default_symmetric_fixed_qparams_fake_quant , <nl> - } <nl> - <nl> def get_default_static_quant_module_mappings ( ) : <nl> ' ' ' Get module mapping for post training static quantization <nl> ' ' ' <nl> def get_quantized_operator ( float_op ) : <nl> assert quantized_op is not None , \ <nl> ' Operator { } does not have corresponding quantized op ' . format ( str ( float_op ) ) <nl> return quantized_op <nl> - <nl> - def get_default_special_act_post_process ( module_cls ) : <nl> - r " " " Get the special activation post process for ` module ` , this has <nl> - higher priority than the activation post process in ` qconfig ` <nl> - e . g . <nl> - input : torch . nn . Sigmoid <nl> - output : default_affine_fixed_qparam_fake_quant <nl> - " " " <nl> - return DEFAULT_MODULE_TO_ACT_POST_PROCESS . get ( module_cls , None ) <nl> - <nl> - def has_special_act_post_process ( module_cls ) : <nl> - return module_cls in DEFAULT_MODULE_TO_ACT_POST_PROCESS <nl> mmm a / torch / quantization / quantize . py <nl> ppp b / torch / quantization / quantize . py <nl> <nl> import torch . nn . quantized as nnq <nl> import torch . nn . intrinsic . qat as nniqat <nl> <nl> - from . quantization_mappings import ( <nl> - get_default_dynamic_quant_module_mappings , <nl> - get_default_static_quant_module_mappings , <nl> - get_default_qat_module_mappings , <nl> - get_default_qconfig_propagation_list , <nl> - has_special_act_post_process , <nl> - get_default_special_act_post_process , <nl> - ) <nl> + from . quantization_mappings import ( get_default_dynamic_quant_module_mappings , <nl> + get_default_static_quant_module_mappings , <nl> + get_default_qat_module_mappings , <nl> + get_default_qconfig_propagation_list ) <nl> <nl> from . stubs import DeQuantStub , QuantWrapper <nl> from . qconfig import default_dynamic_qconfig , float16_dynamic_qconfig , float_qparams_dynamic_qconfig <nl> <nl> - def is_activation_post_process ( module ) : <nl> - return ( isinstance ( module , torch . quantization . ObserverBase ) or <nl> - isinstance ( module , torch . quantization . FakeQuantize ) or <nl> - isinstance ( module , torch . quantization . FakeQuantizeBase ) ) <nl> - <nl> def _propagate_qconfig_helper ( module , qconfig_dict , allow_list = None , <nl> qconfig_parent = None , prefix = ' ' ) : <nl> r " " " This is a helper function for ` propagate_qconfig_ ` <nl> def add_observer_ ( module , qconfig_propagation_list = None , non_leaf_module_list = No <nl> ) <nl> device = next ( iter ( devices ) ) if len ( devices ) > 0 else None <nl> <nl> - def get_activation_post_process ( qconfig , device , special_act_post_process = None ) : <nl> - activation = qconfig . activation ( ) if special_act_post_process is None else special_act_post_process ( ) <nl> + def get_activation_post_process ( qconfig , device ) : <nl> + activation = qconfig . activation ( ) <nl> if device is not None : <nl> activation . to ( device ) <nl> return activation <nl> def get_activation_post_process ( qconfig , device , special_act_post_process = None ) : <nl> def needs_observation ( m ) : <nl> return hasattr ( m , ' qconfig ' ) and m . qconfig is not None <nl> <nl> - def insert_activation_post_process ( m , special_act_post_process = None ) : <nl> + def insert_activation_post_process ( m ) : <nl> " " " Adds an activation post process module and register <nl> a post hook that calls the module <nl> " " " <nl> if needs_observation ( m ) : <nl> # observer and hook will be gone after we swap the module <nl> - m . add_module ( ' activation_post_process ' , get_activation_post_process ( m . qconfig , device , special_act_post_process ) ) <nl> + m . add_module ( ' activation_post_process ' , get_activation_post_process ( m . qconfig , device ) ) <nl> # Register observer as the first entry in the hook list <nl> # All post forward hooks are preserved and will be executed after the observer before convert <nl> handle = register_activation_post_process_hook ( m ) <nl> def insert_activation_post_process ( m , special_act_post_process = None ) : <nl> <nl> for name , child in module . named_children ( ) : <nl> if type ( child ) = = nnq . FloatFunctional or type ( child ) = = nnq . QFunctional : <nl> - if needs_observation ( child ) : <nl> + if hasattr ( child , ' qconfig ' ) and child . qconfig is not None : <nl> child . activation_post_process = get_activation_post_process ( child . qconfig , device ) <nl> - elif has_special_act_post_process ( type ( child ) ) : <nl> - special_act_post_process = get_default_special_act_post_process ( type ( child ) ) <nl> - insert_activation_post_process ( child , special_act_post_process ) <nl> elif non_leaf_module_list is not None and type ( child ) in non_leaf_module_list : <nl> insert_activation_post_process ( child ) <nl> elif needs_observation ( child ) and type ( child ) in custom_module_class_mapping : <nl> def prepare ( model , inplace = False , allow_list = None , <nl> custom_module_class_mapping = custom_module_class_mapping ) <nl> return model <nl> <nl> - def _remove_activation_post_process ( module ) : <nl> - # TODO : maybe we should change activation_post_process to _activation_post_process <nl> - # to prevent it from being used by user <nl> - if hasattr ( module , ' activation_post_process ' ) and \ <nl> - is_activation_post_process ( module . activation_post_process ) : <nl> - delattr ( module , ' activation_post_process ' ) <nl> - <nl> - # remove activation_post_proceess hook <nl> - for handle_id , hook_fn in module . _forward_hooks . items ( ) : <nl> - if hook_fn is _observer_forward_hook : <nl> - module . _forward_hooks . pop ( handle_id ) <nl> - <nl> - # TODO : rename to something more general <nl> def _remove_qconfig ( module ) : <nl> r " " " Clean up the qconfig left in the module so that new qconfig can be <nl> propagated . <nl> def _remove_qconfig ( module ) : <nl> if hasattr ( module , " qconfig " ) : <nl> del module . qconfig <nl> <nl> - _remove_activation_post_process ( module ) <nl> - <nl> def quantize ( model , run_fn , run_args , mapping = None , inplace = False ) : <nl> r " " " Quantize the input float model with post training static quantization . <nl> <nl>
|
Revert D24486972 : [ quant ] [ graphmode ] [ fx ] Support sigmoid / hardsigmoid / tanh in qat
|
pytorch/pytorch
|
25db74bf5e6ed580172d1f9aa637cc9243c6f09d
|
2020-10-26T19:47:05Z
|
mmm a / tensorflow / stream_executor / dnn . cc <nl> ppp b / tensorflow / stream_executor / dnn . cc <nl> string FilterLayoutString ( FilterLayout layout ) { <nl> switch ( layout ) { <nl> case FilterLayout : : kOutputInputYX : <nl> return " OutputInputYX " ; <nl> + case FilterLayout : : kOutputYXInput : <nl> + return " OutputYXInput " ; <nl> case FilterLayout : : kOutputInputYX4 : <nl> return " OutputInputYX4 " ; <nl> case FilterLayout : : kInputYXOutput : <nl>
|
Print kOutputYXInput .
|
tensorflow/tensorflow
|
c9fdfab3781bd55cf3d981b98982a1e8122de8d2
|
2018-07-17T21:36:36Z
|
mmm a / src / flag - definitions . h <nl> ppp b / src / flag - definitions . h <nl> DEFINE_bool ( polymorphic_inlining , true , " polymorphic inlining " ) <nl> DEFINE_bool ( use_osr , true , " use on - stack replacement " ) <nl> DEFINE_bool ( array_bounds_checks_elimination , true , <nl> " perform array bounds checks elimination " ) <nl> - DEFINE_bool ( array_index_dehoisting , true , <nl> + DEFINE_bool ( array_index_dehoisting , false , <nl> " perform array index dehoisting " ) <nl> <nl> DEFINE_bool ( trace_osr , false , " trace on - stack replacement " ) <nl>
|
Disable array index dehoisting because of performance regressions on Kraken imaging - desaturate .
|
v8/v8
|
3fad3320493fa3b5a2ecd7ab63022f2ec2381473
|
2012-05-21T16:22:54Z
|
old mode 100755 <nl> new mode 100644 <nl> index 1a80944f38 . . 95347f4fbc <nl> Binary files a / test / screenshot / image - resize - ios . png and b / test / screenshot / image - resize - ios . png differ <nl>
|
* [ ios ] update compare png for border
|
apache/incubator-weex
|
28d0475127e1b8185572e5f9afc1207d73a311e2
|
2017-11-17T06:16:52Z
|
mmm a / tensorflow / core / BUILD <nl> ppp b / tensorflow / core / BUILD <nl> tf_pyclif_proto_library ( <nl> visibility = [ " / / visibility : public " ] , <nl> ) <nl> <nl> + tf_pyclif_proto_library ( <nl> + name = " framework / cost_graph_pyclif " , <nl> + proto_lib = " : protos_all_cc " , <nl> + proto_srcfile = " framework / cost_graph . proto " , <nl> + visibility = [ " / / visibility : public " ] , <nl> + ) <nl> + <nl> tf_pyclif_proto_library ( <nl> name = " framework / tensor_pyclif " , <nl> proto_lib = " : protos_all_cc " , <nl>
|
Internal change .
|
tensorflow/tensorflow
|
adff6c44ecf25773d759b1477a0e6832bb8ee04e
|
2018-05-14T22:20:41Z
|
mmm a / third_party / protobuf <nl> ppp b / third_party / protobuf <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit d5fb408ddc281ffcadeb08699e65bb694656d0bd <nl> + Subproject commit a1938b2aa9ca86ce7ce50c27ff9737c1008d2a03 <nl> mmm a / tools / distrib / python / grpcio_tools / protoc_lib_deps . py <nl> ppp b / tools / distrib / python / grpcio_tools / protoc_lib_deps . py <nl> <nl> # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> <nl> # AUTO - GENERATED BY make_grpcio_tools . py ! <nl> - CC_FILES = [ ' google / protobuf / compiler / zip_writer . cc ' , ' google / protobuf / compiler / subprocess . cc ' , ' google / protobuf / compiler / ruby / ruby_generator . cc ' , ' google / protobuf / compiler / python / python_generator . cc ' , ' google / protobuf / compiler / plugin . pb . cc ' , ' google / protobuf / compiler / plugin . cc ' , ' google / protobuf / compiler / objectivec / objectivec_primitive_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_oneof . cc ' , ' google / protobuf / compiler / objectivec / objectivec_message_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_message . cc ' , ' google / protobuf / compiler / objectivec / objectivec_map_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_helpers . cc ' , ' google / protobuf / compiler / objectivec / objectivec_generator . cc ' , ' google / protobuf / compiler / objectivec / objectivec_file . cc ' , ' google / protobuf / compiler / objectivec / objectivec_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_extension . cc ' , ' google / protobuf / compiler / objectivec / objectivec_enum_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_enum . cc ' , ' google / protobuf / compiler / js / js_generator . cc ' , ' google / protobuf / compiler / javanano / javanano_primitive_field . cc ' , ' google / protobuf / compiler / javanano / javanano_message_field . cc ' , ' google / protobuf / compiler / javanano / javanano_message . cc ' , ' google / protobuf / compiler / javanano / javanano_map_field . cc ' , ' google / protobuf / compiler / javanano / javanano_helpers . cc ' , ' google / protobuf / compiler / javanano / javanano_generator . cc ' , ' google / protobuf / compiler / javanano / javanano_file . cc ' , ' google / protobuf / compiler / javanano / javanano_field . cc ' , ' google / protobuf / compiler / javanano / javanano_extension . cc ' , ' google / protobuf / compiler / javanano / javanano_enum_field . cc ' , ' google / protobuf / compiler / javanano / javanano_enum . cc ' , ' google / protobuf / compiler / java / java_string_field_lite . cc ' , ' google / protobuf / compiler / java / java_string_field . cc ' , ' google / protobuf / compiler / java / java_shared_code_generator . cc ' , ' google / protobuf / compiler / java / java_service . cc ' , ' google / protobuf / compiler / java / java_primitive_field_lite . cc ' , ' google / protobuf / compiler / java / java_primitive_field . cc ' , ' google / protobuf / compiler / java / java_name_resolver . cc ' , ' google / protobuf / compiler / java / java_message_lite . cc ' , ' google / protobuf / compiler / java / java_message_field_lite . cc ' , ' google / protobuf / compiler / java / java_message_field . cc ' , ' google / protobuf / compiler / java / java_message_builder_lite . cc ' , ' google / protobuf / compiler / java / java_message_builder . cc ' , ' google / protobuf / compiler / java / java_message . cc ' , ' google / protobuf / compiler / java / java_map_field_lite . cc ' , ' google / protobuf / compiler / java / java_map_field . cc ' , ' google / protobuf / compiler / java / java_lazy_message_field_lite . cc ' , ' google / protobuf / compiler / java / java_lazy_message_field . cc ' , ' google / protobuf / compiler / java / java_helpers . cc ' , ' google / protobuf / compiler / java / java_generator_factory . cc ' , ' google / protobuf / compiler / java / java_generator . cc ' , ' google / protobuf / compiler / java / java_file . cc ' , ' google / protobuf / compiler / java / java_field . cc ' , ' google / protobuf / compiler / java / java_extension . cc ' , ' google / protobuf / compiler / java / java_enum_lite . cc ' , ' google / protobuf / compiler / java / java_enum_field_lite . cc ' , ' google / protobuf / compiler / java / java_enum_field . cc ' , ' google / protobuf / compiler / java / java_enum . cc ' , ' google / protobuf / compiler / java / java_doc_comment . cc ' , ' google / protobuf / compiler / java / java_context . cc ' , ' google / protobuf / compiler / csharp / csharp_wrapper_field . cc ' , ' google / protobuf / compiler / csharp / csharp_source_generator_base . cc ' , ' google / protobuf / compiler / csharp / csharp_repeated_primitive_field . cc ' , ' google / protobuf / compiler / csharp / csharp_repeated_message_field . cc ' , ' google / protobuf / compiler / csharp / csharp_repeated_enum_field . cc ' , ' google / protobuf / compiler / csharp / csharp_reflection_class . cc ' , ' google / protobuf / compiler / csharp / csharp_primitive_field . cc ' , ' google / protobuf / compiler / csharp / csharp_message_field . cc ' , ' google / protobuf / compiler / csharp / csharp_message . cc ' , ' google / protobuf / compiler / csharp / csharp_map_field . cc ' , ' google / protobuf / compiler / csharp / csharp_helpers . cc ' , ' google / protobuf / compiler / csharp / csharp_generator . cc ' , ' google / protobuf / compiler / csharp / csharp_field_base . cc ' , ' google / protobuf / compiler / csharp / csharp_enum_field . cc ' , ' google / protobuf / compiler / csharp / csharp_enum . cc ' , ' google / protobuf / compiler / csharp / csharp_doc_comment . cc ' , ' google / protobuf / compiler / cpp / cpp_string_field . cc ' , ' google / protobuf / compiler / cpp / cpp_service . cc ' , ' google / protobuf / compiler / cpp / cpp_primitive_field . cc ' , ' google / protobuf / compiler / cpp / cpp_message_field . cc ' , ' google / protobuf / compiler / cpp / cpp_message . cc ' , ' google / protobuf / compiler / cpp / cpp_map_field . cc ' , ' google / protobuf / compiler / cpp / cpp_helpers . cc ' , ' google / protobuf / compiler / cpp / cpp_generator . cc ' , ' google / protobuf / compiler / cpp / cpp_file . cc ' , ' google / protobuf / compiler / cpp / cpp_field . cc ' , ' google / protobuf / compiler / cpp / cpp_extension . cc ' , ' google / protobuf / compiler / cpp / cpp_enum_field . cc ' , ' google / protobuf / compiler / cpp / cpp_enum . cc ' , ' google / protobuf / compiler / command_line_interface . cc ' , ' google / protobuf / compiler / code_generator . cc ' , ' google / protobuf / wrappers . pb . cc ' , ' google / protobuf / wire_format . cc ' , ' google / protobuf / util / type_resolver_util . cc ' , ' google / protobuf / util / time_util . cc ' , ' google / protobuf / util / message_differencer . cc ' , ' google / protobuf / util / json_util . cc ' , ' google / protobuf / util / internal / utility . cc ' , ' google / protobuf / util / internal / type_info_test_helper . cc ' , ' google / protobuf / util / internal / type_info . cc ' , ' google / protobuf / util / internal / protostream_objectwriter . cc ' , ' google / protobuf / util / internal / protostream_objectsource . cc ' , ' google / protobuf / util / internal / proto_writer . cc ' , ' google / protobuf / util / internal / object_writer . cc ' , ' google / protobuf / util / internal / json_stream_parser . cc ' , ' google / protobuf / util / internal / json_objectwriter . cc ' , ' google / protobuf / util / internal / json_escaping . cc ' , ' google / protobuf / util / internal / field_mask_utility . cc ' , ' google / protobuf / util / internal / error_listener . cc ' , ' google / protobuf / util / internal / default_value_objectwriter . cc ' , ' google / protobuf / util / internal / datapiece . cc ' , ' google / protobuf / util / field_mask_util . cc ' , ' google / protobuf / util / field_comparator . cc ' , ' google / protobuf / unknown_field_set . cc ' , ' google / protobuf / type . pb . cc ' , ' google / protobuf / timestamp . pb . cc ' , ' google / protobuf / text_format . cc ' , ' google / protobuf / stubs / substitute . cc ' , ' google / protobuf / stubs / mathlimits . cc ' , ' google / protobuf / struct . pb . cc ' , ' google / protobuf / source_context . pb . cc ' , ' google / protobuf / service . cc ' , ' google / protobuf / reflection_ops . cc ' , ' google / protobuf / message . cc ' , ' google / protobuf / map_field . cc ' , ' google / protobuf / io / zero_copy_stream_impl . cc ' , ' google / protobuf / io / tokenizer . cc ' , ' google / protobuf / io / strtod . cc ' , ' google / protobuf / io / printer . cc ' , ' google / protobuf / io / gzip_stream . cc ' , ' google / protobuf / generated_message_reflection . cc ' , ' google / protobuf / field_mask . pb . cc ' , ' google / protobuf / extension_set_heavy . cc ' , ' google / protobuf / empty . pb . cc ' , ' google / protobuf / dynamic_message . cc ' , ' google / protobuf / duration . pb . cc ' , ' google / protobuf / descriptor_database . cc ' , ' google / protobuf / descriptor . pb . cc ' , ' google / protobuf / descriptor . cc ' , ' google / protobuf / compiler / parser . cc ' , ' google / protobuf / compiler / importer . cc ' , ' google / protobuf / api . pb . cc ' , ' google / protobuf / any . pb . cc ' , ' google / protobuf / any . cc ' , ' google / protobuf / wire_format_lite . cc ' , ' google / protobuf / stubs / time . cc ' , ' google / protobuf / stubs / strutil . cc ' , ' google / protobuf / stubs / structurally_valid . cc ' , ' google / protobuf / stubs / stringprintf . cc ' , ' google / protobuf / stubs / stringpiece . cc ' , ' google / protobuf / stubs / statusor . cc ' , ' google / protobuf / stubs / status . cc ' , ' google / protobuf / stubs / once . cc ' , ' google / protobuf / stubs / int128 . cc ' , ' google / protobuf / stubs / common . cc ' , ' google / protobuf / stubs / bytestream . cc ' , ' google / protobuf / stubs / atomicops_internals_x86_msvc . cc ' , ' google / protobuf / stubs / atomicops_internals_x86_gcc . cc ' , ' google / protobuf / repeated_field . cc ' , ' google / protobuf / message_lite . cc ' , ' google / protobuf / io / zero_copy_stream_impl_lite . cc ' , ' google / protobuf / io / zero_copy_stream . cc ' , ' google / protobuf / io / coded_stream . cc ' , ' google / protobuf / generated_message_util . cc ' , ' google / protobuf / extension_set . cc ' , ' google / protobuf / arenastring . cc ' , ' google / protobuf / arena . cc ' ] <nl> + CC_FILES = [ ' google / protobuf / compiler / zip_writer . cc ' , ' google / protobuf / compiler / subprocess . cc ' , ' google / protobuf / compiler / ruby / ruby_generator . cc ' , ' google / protobuf / compiler / python / python_generator . cc ' , ' google / protobuf / compiler / plugin . pb . cc ' , ' google / protobuf / compiler / plugin . cc ' , ' google / protobuf / compiler / objectivec / objectivec_primitive_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_oneof . cc ' , ' google / protobuf / compiler / objectivec / objectivec_message_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_message . cc ' , ' google / protobuf / compiler / objectivec / objectivec_map_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_helpers . cc ' , ' google / protobuf / compiler / objectivec / objectivec_generator . cc ' , ' google / protobuf / compiler / objectivec / objectivec_file . cc ' , ' google / protobuf / compiler / objectivec / objectivec_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_extension . cc ' , ' google / protobuf / compiler / objectivec / objectivec_enum_field . cc ' , ' google / protobuf / compiler / objectivec / objectivec_enum . cc ' , ' google / protobuf / compiler / js / js_generator . cc ' , ' google / protobuf / compiler / javanano / javanano_primitive_field . cc ' , ' google / protobuf / compiler / javanano / javanano_message_field . cc ' , ' google / protobuf / compiler / javanano / javanano_message . cc ' , ' google / protobuf / compiler / javanano / javanano_map_field . cc ' , ' google / protobuf / compiler / javanano / javanano_helpers . cc ' , ' google / protobuf / compiler / javanano / javanano_generator . cc ' , ' google / protobuf / compiler / javanano / javanano_file . cc ' , ' google / protobuf / compiler / javanano / javanano_field . cc ' , ' google / protobuf / compiler / javanano / javanano_extension . cc ' , ' google / protobuf / compiler / javanano / javanano_enum_field . cc ' , ' google / protobuf / compiler / javanano / javanano_enum . cc ' , ' google / protobuf / compiler / java / java_string_field_lite . cc ' , ' google / protobuf / compiler / java / java_string_field . cc ' , ' google / protobuf / compiler / java / java_shared_code_generator . cc ' , ' google / protobuf / compiler / java / java_service . cc ' , ' google / protobuf / compiler / java / java_primitive_field_lite . cc ' , ' google / protobuf / compiler / java / java_primitive_field . cc ' , ' google / protobuf / compiler / java / java_name_resolver . cc ' , ' google / protobuf / compiler / java / java_message_lite . cc ' , ' google / protobuf / compiler / java / java_message_field_lite . cc ' , ' google / protobuf / compiler / java / java_message_field . cc ' , ' google / protobuf / compiler / java / java_message_builder_lite . cc ' , ' google / protobuf / compiler / java / java_message_builder . cc ' , ' google / protobuf / compiler / java / java_message . cc ' , ' google / protobuf / compiler / java / java_map_field_lite . cc ' , ' google / protobuf / compiler / java / java_map_field . cc ' , ' google / protobuf / compiler / java / java_lazy_message_field_lite . cc ' , ' google / protobuf / compiler / java / java_lazy_message_field . cc ' , ' google / protobuf / compiler / java / java_helpers . cc ' , ' google / protobuf / compiler / java / java_generator_factory . cc ' , ' google / protobuf / compiler / java / java_generator . cc ' , ' google / protobuf / compiler / java / java_file . cc ' , ' google / protobuf / compiler / java / java_field . cc ' , ' google / protobuf / compiler / java / java_extension_lite . cc ' , ' google / protobuf / compiler / java / java_extension . cc ' , ' google / protobuf / compiler / java / java_enum_lite . cc ' , ' google / protobuf / compiler / java / java_enum_field_lite . cc ' , ' google / protobuf / compiler / java / java_enum_field . cc ' , ' google / protobuf / compiler / java / java_enum . cc ' , ' google / protobuf / compiler / java / java_doc_comment . cc ' , ' google / protobuf / compiler / java / java_context . cc ' , ' google / protobuf / compiler / csharp / csharp_wrapper_field . cc ' , ' google / protobuf / compiler / csharp / csharp_source_generator_base . cc ' , ' google / protobuf / compiler / csharp / csharp_repeated_primitive_field . cc ' , ' google / protobuf / compiler / csharp / csharp_repeated_message_field . cc ' , ' google / protobuf / compiler / csharp / csharp_repeated_enum_field . cc ' , ' google / protobuf / compiler / csharp / csharp_reflection_class . cc ' , ' google / protobuf / compiler / csharp / csharp_primitive_field . cc ' , ' google / protobuf / compiler / csharp / csharp_message_field . cc ' , ' google / protobuf / compiler / csharp / csharp_message . cc ' , ' google / protobuf / compiler / csharp / csharp_map_field . cc ' , ' google / protobuf / compiler / csharp / csharp_helpers . cc ' , ' google / protobuf / compiler / csharp / csharp_generator . cc ' , ' google / protobuf / compiler / csharp / csharp_field_base . cc ' , ' google / protobuf / compiler / csharp / csharp_enum_field . cc ' , ' google / protobuf / compiler / csharp / csharp_enum . cc ' , ' google / protobuf / compiler / csharp / csharp_doc_comment . cc ' , ' google / protobuf / compiler / cpp / cpp_string_field . cc ' , ' google / protobuf / compiler / cpp / cpp_service . cc ' , ' google / protobuf / compiler / cpp / cpp_primitive_field . cc ' , ' google / protobuf / compiler / cpp / cpp_message_field . cc ' , ' google / protobuf / compiler / cpp / cpp_message . cc ' , ' google / protobuf / compiler / cpp / cpp_map_field . cc ' , ' google / protobuf / compiler / cpp / cpp_helpers . cc ' , ' google / protobuf / compiler / cpp / cpp_generator . cc ' , ' google / protobuf / compiler / cpp / cpp_file . cc ' , ' google / protobuf / compiler / cpp / cpp_field . cc ' , ' google / protobuf / compiler / cpp / cpp_extension . cc ' , ' google / protobuf / compiler / cpp / cpp_enum_field . cc ' , ' google / protobuf / compiler / cpp / cpp_enum . cc ' , ' google / protobuf / compiler / command_line_interface . cc ' , ' google / protobuf / compiler / code_generator . cc ' , ' google / protobuf / wrappers . pb . cc ' , ' google / protobuf / wire_format . cc ' , ' google / protobuf / util / type_resolver_util . cc ' , ' google / protobuf / util / time_util . cc ' , ' google / protobuf / util / message_differencer . cc ' , ' google / protobuf / util / json_util . cc ' , ' google / protobuf / util / internal / utility . cc ' , ' google / protobuf / util / internal / type_info_test_helper . cc ' , ' google / protobuf / util / internal / type_info . cc ' , ' google / protobuf / util / internal / protostream_objectwriter . cc ' , ' google / protobuf / util / internal / protostream_objectsource . cc ' , ' google / protobuf / util / internal / proto_writer . cc ' , ' google / protobuf / util / internal / object_writer . cc ' , ' google / protobuf / util / internal / json_stream_parser . cc ' , ' google / protobuf / util / internal / json_objectwriter . cc ' , ' google / protobuf / util / internal / json_escaping . cc ' , ' google / protobuf / util / internal / field_mask_utility . cc ' , ' google / protobuf / util / internal / error_listener . cc ' , ' google / protobuf / util / internal / default_value_objectwriter . cc ' , ' google / protobuf / util / internal / datapiece . cc ' , ' google / protobuf / util / field_mask_util . cc ' , ' google / protobuf / util / field_comparator . cc ' , ' google / protobuf / unknown_field_set . cc ' , ' google / protobuf / type . pb . cc ' , ' google / protobuf / timestamp . pb . cc ' , ' google / protobuf / text_format . cc ' , ' google / protobuf / stubs / substitute . cc ' , ' google / protobuf / stubs / mathlimits . cc ' , ' google / protobuf / struct . pb . cc ' , ' google / protobuf / source_context . pb . cc ' , ' google / protobuf / service . cc ' , ' google / protobuf / reflection_ops . cc ' , ' google / protobuf / message . cc ' , ' google / protobuf / map_field . cc ' , ' google / protobuf / io / zero_copy_stream_impl . cc ' , ' google / protobuf / io / tokenizer . cc ' , ' google / protobuf / io / strtod . cc ' , ' google / protobuf / io / printer . cc ' , ' google / protobuf / io / gzip_stream . cc ' , ' google / protobuf / generated_message_reflection . cc ' , ' google / protobuf / field_mask . pb . cc ' , ' google / protobuf / extension_set_heavy . cc ' , ' google / protobuf / empty . pb . cc ' , ' google / protobuf / dynamic_message . cc ' , ' google / protobuf / duration . pb . cc ' , ' google / protobuf / descriptor_database . cc ' , ' google / protobuf / descriptor . pb . cc ' , ' google / protobuf / descriptor . cc ' , ' google / protobuf / compiler / parser . cc ' , ' google / protobuf / compiler / importer . cc ' , ' google / protobuf / api . pb . cc ' , ' google / protobuf / any . pb . cc ' , ' google / protobuf / any . cc ' , ' google / protobuf / wire_format_lite . cc ' , ' google / protobuf / stubs / time . cc ' , ' google / protobuf / stubs / strutil . cc ' , ' google / protobuf / stubs / structurally_valid . cc ' , ' google / protobuf / stubs / stringprintf . cc ' , ' google / protobuf / stubs / stringpiece . cc ' , ' google / protobuf / stubs / statusor . cc ' , ' google / protobuf / stubs / status . cc ' , ' google / protobuf / stubs / once . cc ' , ' google / protobuf / stubs / int128 . cc ' , ' google / protobuf / stubs / common . cc ' , ' google / protobuf / stubs / bytestream . cc ' , ' google / protobuf / stubs / atomicops_internals_x86_msvc . cc ' , ' google / protobuf / stubs / atomicops_internals_x86_gcc . cc ' , ' google / protobuf / repeated_field . cc ' , ' google / protobuf / message_lite . cc ' , ' google / protobuf / io / zero_copy_stream_impl_lite . cc ' , ' google / protobuf / io / zero_copy_stream . cc ' , ' google / protobuf / io / coded_stream . cc ' , ' google / protobuf / generated_message_util . cc ' , ' google / protobuf / extension_set . cc ' , ' google / protobuf / arenastring . cc ' , ' google / protobuf / arena . cc ' ] <nl> mmm a / tools / run_tests / sanity / check_submodules . sh <nl> ppp b / tools / run_tests / sanity / check_submodules . sh <nl> cat < < EOF | awk ' { print $ 1 } ' | sort > $ want_submodules <nl> 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party / gflags ( v2 . 1 . 0 - 45 - g05b155f ) <nl> c99458533a9b4c743ed51537e25989ea55944908 third_party / googletest ( release - 1 . 7 . 0 ) <nl> f8ac463766281625ad710900479130c7fcb4d63b third_party / nanopb ( nanopb - 0 . 3 . 4 - 29 - gf8ac463 ) <nl> - d5fb408ddc281ffcadeb08699e65bb694656d0bd third_party / protobuf ( v3 . 0 . 0 - beta - 2 ) <nl> + a1938b2aa9ca86ce7ce50c27ff9737c1008d2a03 third_party / protobuf ( v3 . 0 . 0 - beta - 3 - pre1 ) <nl> 50893291621658f355bc5b4d450a8d06a563053d third_party / zlib ( v1 . 2 . 8 ) <nl> EOF <nl> <nl>
|
Bumping protobuf submodule to beta - 3 - pre1 .
|
grpc/grpc
|
c810a3817014044926545f9c65e4c45ccb25ef9f
|
2016-05-10T22:57:55Z
|
mmm a / modules / ml / src / svm . cpp <nl> ppp b / modules / ml / src / svm . cpp <nl> class SVMImpl : public SVM <nl> if ( ! do_train ( temp_train_samples , temp_train_responses ) ) <nl> continue ; <nl> <nl> - for ( i = 0 ; i < test_sample_count ; i + + ) <nl> + for ( i = 0 ; i < train_sample_count ; i + + ) <nl> { <nl> j = sidx [ ( i + start + train_sample_count ) % sample_count ] ; <nl> memcpy ( temp_train_samples . ptr ( i ) , samples . ptr ( j ) , sample_size ) ; <nl>
|
Fix bug in SVM : : trainAuto
|
opencv/opencv
|
225da0226e4e9d54e97aee488ac2b5ed4e813443
|
2015-04-07T12:09:47Z
|
mmm a / Makefile . am <nl> ppp b / Makefile . am <nl> baseline . info : <nl> $ ( LCOV ) - c - i - d $ ( abs_builddir ) / src - o $ @ <nl> <nl> baseline_filtered . info : baseline . info <nl> - $ ( LCOV ) - r $ < " / usr / include / * " - o $ @ <nl> + $ ( LCOV ) - r $ < " / usr / include / * " $ ( LCOV_OPTS ) - o $ @ <nl> <nl> leveldb_baseline . info : baseline_filtered . info <nl> $ ( LCOV ) - c - i - d $ ( abs_builddir ) / src / leveldb - b $ ( abs_builddir ) / src / leveldb - o $ @ <nl> <nl> leveldb_baseline_filtered . info : leveldb_baseline . info <nl> - $ ( LCOV ) - r $ < " / usr / include / * " - o $ @ <nl> + $ ( LCOV ) - r $ < " / usr / include / * " $ ( LCOV_OPTS ) - o $ @ <nl> <nl> baseline_filtered_combined . info : leveldb_baseline_filtered . info baseline_filtered . info <nl> - $ ( LCOV ) - a leveldb_baseline_filtered . info - a baseline_filtered . info - o $ @ <nl> + $ ( LCOV ) - a $ ( LCOV_OPTS ) leveldb_baseline_filtered . info - a baseline_filtered . info - o $ @ <nl> <nl> test_bitcoin . info : baseline_filtered_combined . info <nl> $ ( MAKE ) - C src / check <nl> - $ ( LCOV ) - c - d $ ( abs_builddir ) / src - t test_bitcoin - o $ @ <nl> - $ ( LCOV ) - z - d $ ( abs_builddir ) / src <nl> - $ ( LCOV ) - z - d $ ( abs_builddir ) / src / leveldb <nl> + $ ( LCOV ) - c $ ( LCOV_OPTS ) - d $ ( abs_builddir ) / src - t test_bitcoin - o $ @ <nl> + $ ( LCOV ) - z $ ( LCOV_OPTS ) - d $ ( abs_builddir ) / src <nl> + $ ( LCOV ) - z $ ( LCOV_OPTS ) - d $ ( abs_builddir ) / src / leveldb <nl> <nl> test_bitcoin_filtered . info : test_bitcoin . info <nl> - $ ( LCOV ) - r $ < " / usr / include / * " - o $ @ <nl> + $ ( LCOV ) - r $ < " / usr / include / * " $ ( LCOV_OPTS ) - o $ @ <nl> <nl> functional_test . info : test_bitcoin_filtered . info <nl> - - @ TIMEOUT = 15 python test / functional / test_runner . py $ ( EXTENDED_FUNCTIONAL_TESTS ) <nl> - $ ( LCOV ) - c - d $ ( abs_builddir ) / src - - t functional - tests - o $ @ <nl> - $ ( LCOV ) - z - d $ ( abs_builddir ) / src <nl> - $ ( LCOV ) - z - d $ ( abs_builddir ) / src / leveldb <nl> + - @ TIMEOUT = 15 test / functional / test_runner . py $ ( EXTENDED_FUNCTIONAL_TESTS ) <nl> + $ ( LCOV ) - c $ ( LCOV_OPTS ) - d $ ( abs_builddir ) / src - - t functional - tests - o $ @ <nl> + $ ( LCOV ) - z $ ( LCOV_OPTS ) - d $ ( abs_builddir ) / src <nl> + $ ( LCOV ) - z $ ( LCOV_OPTS ) - d $ ( abs_builddir ) / src / leveldb <nl> <nl> functional_test_filtered . info : functional_test . info <nl> - $ ( LCOV ) - r $ < " / usr / include / * " - o $ @ <nl> + $ ( LCOV ) - r $ < " / usr / include / * " $ ( LCOV_OPTS ) - o $ @ <nl> <nl> test_bitcoin_coverage . info : baseline_filtered_combined . info test_bitcoin_filtered . info <nl> - $ ( LCOV ) - a baseline_filtered . info - a leveldb_baseline_filtered . info - a test_bitcoin_filtered . info - o $ @ <nl> + $ ( LCOV ) - a $ ( LCOV_OPTS ) baseline_filtered . info - a leveldb_baseline_filtered . info - a test_bitcoin_filtered . info - o $ @ <nl> <nl> total_coverage . info : baseline_filtered_combined . info test_bitcoin_filtered . info functional_test_filtered . info <nl> - $ ( LCOV ) - a baseline_filtered . info - a leveldb_baseline_filtered . info - a test_bitcoin_filtered . info - a functional_test_filtered . info - o $ @ | $ ( GREP ) " \ % " | $ ( AWK ) ' { print substr ( $ $ 3 , 2 , 50 ) " / " $ $ 5 } ' > coverage_percent . txt <nl> + $ ( LCOV ) - a $ ( LCOV_OPTS ) baseline_filtered . info - a leveldb_baseline_filtered . info - a test_bitcoin_filtered . info - a functional_test_filtered . info - o $ @ | $ ( GREP ) " \ % " | $ ( AWK ) ' { print substr ( $ $ 3 , 2 , 50 ) " / " $ $ 5 } ' > coverage_percent . txt <nl> <nl> test_bitcoin . coverage / . dirstamp : test_bitcoin_coverage . info <nl> - $ ( GENHTML ) - s $ < - o $ ( @ D ) <nl> + $ ( GENHTML ) - s $ ( LCOV_OPTS ) $ < - o $ ( @ D ) <nl> @ touch $ @ <nl> <nl> total . coverage / . dirstamp : total_coverage . info <nl> - $ ( GENHTML ) - s $ < - o $ ( @ D ) <nl> + $ ( GENHTML ) - s $ ( LCOV_OPTS ) $ < - o $ ( @ D ) <nl> @ touch $ @ <nl> <nl> cov : test_bitcoin . coverage / . dirstamp total . coverage / . dirstamp <nl> mmm a / configure . ac <nl> ppp b / configure . ac <nl> AC_ARG_ENABLE ( [ lcov ] , <nl> [ enable lcov testing ( default is no ) ] ) ] , <nl> [ use_lcov = yes ] , <nl> [ use_lcov = no ] ) <nl> + <nl> + AC_ARG_ENABLE ( [ lcov - branch - coverage ] , <nl> + [ AS_HELP_STRING ( [ - - enable - lcov - branch - coverage ] , <nl> + [ enable lcov testing branch coverage ( default is no ) ] ) ] , <nl> + [ use_lcov_branch = yes ] , <nl> + [ use_lcov_branch = no ] ) <nl> <nl> AC_ARG_ENABLE ( [ glibc - back - compat ] , <nl> [ AS_HELP_STRING ( [ - - enable - glibc - back - compat ] , <nl> if test x $ use_lcov = xyes ; then <nl> [ AC_MSG_ERROR ( " lcov testing requested but - - coverage linker flag does not work " ) ] ) <nl> AX_CHECK_COMPILE_FLAG ( [ - - coverage ] , [ CXXFLAGS = " $ CXXFLAGS - - coverage " ] , <nl> [ AC_MSG_ERROR ( " lcov testing requested but - - coverage flag does not work " ) ] ) <nl> + AC_DEFINE ( USE_COVERAGE , 1 , [ Define this symbol if coverage is enabled ] ) <nl> + CXXFLAGS = " $ CXXFLAGS - Og " <nl> + fi <nl> + <nl> + if test x $ use_lcov_branch ! = xno ; then <nl> + AC_SUBST ( LCOV_OPTS , " $ LCOV_OPTS - - rc lcov_branch_coverage = 1 " ) <nl> fi <nl> <nl> dnl Check for endianness <nl> mmm a / src / util . h <nl> ppp b / src / util . h <nl> int LogPrintStr ( const std : : string & str ) ; <nl> / * * Get format string from VA_ARGS for error reporting * / <nl> template < typename . . . Args > std : : string FormatStringFromLogArgs ( const char * fmt , const Args & . . . args ) { return fmt ; } <nl> <nl> + static inline void MarkUsed ( ) { } <nl> + template < typename T , typename . . . Args > static inline void MarkUsed ( const T & t , const Args & . . . args ) <nl> + { <nl> + ( void ) t ; <nl> + MarkUsed ( args . . . ) ; <nl> + } <nl> + <nl> + # ifdef USE_COVERAGE <nl> + # define LogPrintf ( . . . ) do { MarkUsed ( __VA_ARGS__ ) ; } while ( 0 ) <nl> + # define LogPrint ( category , . . . ) do { MarkUsed ( __VA_ARGS__ ) ; } while ( 0 ) <nl> + # else <nl> # define LogPrintf ( . . . ) do { \ <nl> std : : string _log_msg_ ; / * Unlikely name to avoid shadowing variables * / \ <nl> try { \ <nl> template < typename . . . Args > std : : string FormatStringFromLogArgs ( const char * fmt , <nl> LogPrintf ( __VA_ARGS__ ) ; \ <nl> } \ <nl> } while ( 0 ) <nl> + # endif <nl> <nl> template < typename . . . Args > <nl> bool error ( const char * fmt , const Args & . . . args ) <nl>
|
Have ` make cov ` optionally include branch coverage statistics
|
bitcoin/bitcoin
|
c8914b9dbbf6106dac3c62769f7ce3bacd8fbf9b
|
2017-06-07T21:19:01Z
|
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> set ( CXX_STANDARD_REQUIRED ON ) <nl> <nl> set ( VERSION_MAJOR 1 ) <nl> set ( VERSION_MINOR 4 ) <nl> - set ( VERSION_PATCH 2 ) <nl> + set ( VERSION_PATCH 3 ) <nl> <nl> set ( CLI_CLIENT_EXECUTABLE_NAME cleos ) <nl> set ( NODE_EXECUTABLE_NAME nodeos ) <nl> mmm a / Docker / README . md <nl> ppp b / Docker / README . md <nl> cd eos / Docker <nl> docker build . - t eosio / eos <nl> ` ` ` <nl> <nl> - The above will build off the most recent commit to the master branch by default . If you would like to target a specific branch / tag , you may use a build argument . For example , if you wished to generate a docker image based off of the v1 . 4 . 2 tag , you could do the following : <nl> + The above will build off the most recent commit to the master branch by default . If you would like to target a specific branch / tag , you may use a build argument . For example , if you wished to generate a docker image based off of the v1 . 4 . 3 tag , you could do the following : <nl> <nl> ` ` ` bash <nl> - docker build - t eosio / eos : v1 . 4 . 2 - - build - arg branch = v1 . 4 . 2 . <nl> + docker build - t eosio / eos : v1 . 4 . 3 - - build - arg branch = v1 . 4 . 3 . <nl> ` ` ` <nl> <nl> By default , the symbol in eosio . system is set to SYS . You can override this using the symbol argument while building the docker image . <nl> mmm a / README . md <nl> ppp b / README . md <nl> <nl> + <nl> # EOSIO - The Most Powerful Infrastructure for Decentralized Applications <nl> <nl> [ ! [ Build status ] ( https : / / badge . buildkite . com / 370fe5c79410f7d695e4e34c500b4e86e3ac021c6b1f739e20 . svg ? branch = master ) ] ( https : / / buildkite . com / EOSIO / eosio ) <nl> $ brew remove eosio <nl> ` ` ` <nl> # # # # Ubuntu 18 . 04 Debian Package Install <nl> ` ` ` sh <nl> - $ wget https : / / github . com / eosio / eos / releases / download / v1 . 4 . 2 / eosio - 1 . 4 . 2 . ubuntu - 18 . 04 - x86_64 . deb <nl> - $ sudo apt install . / eosio - 1 . 4 . 2 . ubuntu - 18 . 04 - x86_64 . deb <nl> + $ wget https : / / github . com / eosio / eos / releases / download / v1 . 4 . 3 / eosio - 1 . 4 . 3 . ubuntu - 18 . 04 - x86_64 . deb <nl> + $ sudo apt install . / eosio - 1 . 4 . 3 . ubuntu - 18 . 04 - x86_64 . deb <nl> ` ` ` <nl> # # # # Ubuntu 16 . 04 Debian Package Install <nl> ` ` ` sh <nl> - $ wget https : / / github . com / eosio / eos / releases / download / v1 . 4 . 2 / eosio - 1 . 4 . 2 . ubuntu - 16 . 04 - x86_64 . deb <nl> - $ sudo apt install . / eosio - 1 . 4 . 2 . ubuntu - 16 . 04 - x86_64 . deb <nl> + $ wget https : / / github . com / eosio / eos / releases / download / v1 . 4 . 3 / eosio - 1 . 4 . 3 . ubuntu - 16 . 04 - x86_64 . deb <nl> + $ sudo apt install . / eosio - 1 . 4 . 3 . ubuntu - 16 . 04 - x86_64 . deb <nl> ` ` ` <nl> # # # # Debian Package Uninstall <nl> ` ` ` sh <nl> $ sudo apt remove eosio <nl> ` ` ` <nl> # # # # RPM Package Install <nl> ` ` ` sh <nl> - $ wget https : / / github . com / eosio / eos / releases / download / v1 . 4 . 2 / eosio - 1 . 4 . 2 . x86_64 - 0 . x86_64 . rpm <nl> - $ sudo yum install . / eosio - 1 . 4 . 2 . x86_64 - 0 . x86_64 . rpm <nl> + $ wget https : / / github . com / eosio / eos / releases / download / v1 . 4 . 3 / eosio - 1 . 4 . 3 . x86_64 - 0 . x86_64 . rpm <nl> + $ sudo yum install . / eosio - 1 . 4 . 3 . x86_64 - 0 . x86_64 . rpm <nl> ` ` ` <nl> # # # # RPM Package Uninstall <nl> ` ` ` sh <nl> mmm a / libraries / appbase <nl> ppp b / libraries / appbase <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 6e440a7f3c51f3b8226860663b5eb6446087fed9 <nl> + Subproject commit f3a63c1c04df957c0675b51d298851c71d6ccbe7 <nl> mmm a / libraries / chain / wasm_interface . cpp <nl> ppp b / libraries / chain / wasm_interface . cpp <nl> class transaction_api : public context_aware_api { <nl> } <nl> <nl> void send_deferred ( const uint128_t & sender_id , account_name payer , array_ptr < char > data , size_t data_len , uint32_t replace_existing ) { <nl> - try { <nl> - transaction trx ; <nl> - fc : : raw : : unpack < transaction > ( data , data_len , trx ) ; <nl> - context . schedule_deferred_transaction ( sender_id , payer , std : : move ( trx ) , replace_existing ) ; <nl> - } FC_RETHROW_EXCEPTIONS ( warn , " data as hex : $ { data } " , ( " data " , fc : : to_hex ( data , data_len ) ) ) <nl> + transaction trx ; <nl> + fc : : raw : : unpack < transaction > ( data , data_len , trx ) ; <nl> + context . schedule_deferred_transaction ( sender_id , payer , std : : move ( trx ) , replace_existing ) ; <nl> } <nl> <nl> bool cancel_deferred ( const unsigned __int128 & val ) { <nl> mmm a / plugins / chain_plugin / chain_plugin . cpp <nl> ppp b / plugins / chain_plugin / chain_plugin . cpp <nl> void chain_plugin : : set_program_options ( options_description & cli , options_descrip <nl> " In \ " light \ " mode all incoming blocks headers will be fully validated ; transactions in those validated blocks will be trusted \ n " ) <nl> ( " disable - ram - billing - notify - checks " , bpo : : bool_switch ( ) - > default_value ( false ) , <nl> " Disable the check which subjectively fails a transaction if a contract bills more RAM to another account within the context of a notification handler ( i . e . when the receiver is not the code of the action ) . " ) <nl> + ( " trusted - producer " , bpo : : value < vector < string > > ( ) - > composing ( ) , " Indicate a producer whose blocks headers signed by it will be fully validated , but transactions in those validated blocks will be trusted . " ) <nl> ; <nl> <nl> / / TODO : rate limiting <nl> void chain_plugin : : set_program_options ( options_description & cli , options_descrip <nl> " replace reversible block database with blocks imported from specified file and then exit " ) <nl> ( " export - reversible - blocks " , bpo : : value < bfs : : path > ( ) , <nl> " export reversible block database in portable format into specified file and then exit " ) <nl> - ( " trusted - producer " , bpo : : value < vector < string > > ( ) - > composing ( ) , " Indicate a producer whose blocks headers signed by it will be fully validated , but transactions in those validated blocks will be trusted . " ) <nl> ( " snapshot " , bpo : : value < bfs : : path > ( ) , " File to read Snapshot State from " ) <nl> ; <nl> <nl> mmm a / plugins / history_plugin / history_plugin . cpp <nl> ppp b / plugins / history_plugin / history_plugin . cpp <nl> namespace eosio { <nl> } <nl> <nl> void on_applied_transaction ( const transaction_trace_ptr & trace ) { <nl> + if ( ! trace - > receipt | | ( trace - > receipt - > status ! = transaction_receipt_header : : executed & & <nl> + trace - > receipt - > status ! = transaction_receipt_header : : soft_fail ) ) <nl> + return ; <nl> for ( const auto & atrace : trace - > action_traces ) { <nl> on_action_trace ( atrace ) ; <nl> } <nl> mmm a / programs / nodeos / main . cpp <nl> ppp b / programs / nodeos / main . cpp <nl> int main ( int argc , char * * argv ) <nl> initialize_logging ( ) ; <nl> ilog ( " nodeos version $ { ver } " , ( " ver " , app ( ) . version_string ( ) ) ) ; <nl> ilog ( " eosio root is $ { root } " , ( " root " , root . string ( ) ) ) ; <nl> + ilog ( " nodeos using configuration file $ { c } " , ( " c " , app ( ) . full_config_file_path ( ) . string ( ) ) ) ; <nl> + ilog ( " nodeos data directory is $ { d } " , ( " d " , app ( ) . data_dir ( ) . string ( ) ) ) ; <nl> app ( ) . startup ( ) ; <nl> app ( ) . exec ( ) ; <nl> } catch ( const extract_genesis_state_exception & e ) { <nl>
|
Merge pull request from EOSIO / release / 1 . 4 . x
|
EOSIO/eos
|
11c25394b6dd05cc3c97f0b7471a84f3d7cfbca3
|
2018-11-06T23:45:01Z
|
similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / client_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / client . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / listener_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / listener . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / parameter_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / parameter . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / record_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / record . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / record_channel_info_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / record_channel_info . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / record_trans_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / record_trans . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / service_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / service . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / talker_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / talker . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / time_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / time . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / examples / timer_py3 . py <nl> rename to cyber / python / cyber_py3 / examples / timer . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / test / test_cyber_py3 . py <nl> rename to cyber / python / cyber_py3 / test / test_cyber . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / test / test_cyber_time_py3 . py <nl> rename to cyber / python / cyber_py3 / test / test_cyber_time . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / test / test_cyber_timer_py3 . py <nl> rename to cyber / python / cyber_py3 / test / test_cyber_timer . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / test / test_init_py3 . py <nl> rename to cyber / python / cyber_py3 / test / test_init . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / test / test_parameter_py3 . py <nl> rename to cyber / python / cyber_py3 / test / test_parameter . py <nl> similarity index 100 % <nl> rename from cyber / python / cyber_py3 / test / test_record_py3 . py <nl> rename to cyber / python / cyber_py3 / test / test_record . py <nl>
|
Cyber : Remove _py3 suffix .
|
ApolloAuto/apollo
|
56afbe2a3be2078e05ae0b91a93fa6d1b6b51619
|
2019-11-12T06:00:28Z
|
mmm a / lib / GeneralServer / GeneralServer . h <nl> ppp b / lib / GeneralServer / GeneralServer . h <nl> namespace triagens { <nl> LOG_DEBUG ( " bound to endpoint ' % s ' " , ( * i ) . first . c_str ( ) ) ; <nl> } <nl> else { <nl> - LOG_FATAL_AND_EXIT ( " failed to bind to endpoint ' % s ' . Please review your endpoints configuration . " , ( * i ) . first . c_str ( ) ) ; <nl> + LOG_FATAL_AND_EXIT ( " failed to bind to endpoint ' % s ' . Please check whether another instance is already running or review your endpoints configuration . " , ( * i ) . first . c_str ( ) ) ; <nl> } <nl> } <nl> } <nl>
|
improve error message
|
arangodb/arangodb
|
0014777746c485041c0eb601794c009123d4bccf
|
2013-10-30T13:38:20Z
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.