diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
mmm a / dbms / programs / client / TestHint . h <nl> ppp b / dbms / programs / client / TestHint . h <nl> class TestHint <nl> if ( ! enabled_ ) <nl> return ; <nl> <nl> - String full_comment ; <nl> Lexer lexer ( query . data ( ) , query . data ( ) + query . size ( ) ) ; <nl> <nl> for ( Token token = lexer . nextToken ( ) ; ! token . isEnd ( ) ; token = lexer . nextToken ( ) ) <nl> { <nl> if ( token . type = = TokenType : : Comment ) <nl> - full_comment + = String ( token . begin , token . begin + token . size ( ) ) + ' ' ; <nl> - } <nl> - <nl> - if ( ! full_comment . empty ( ) ) <nl> - { <nl> - size_t pos_start = full_comment . find ( ' { ' , 0 ) ; <nl> - if ( pos_start ! = String : : npos ) <nl> { <nl> - size_t pos_end = full_comment . find ( ' } ' , pos_start ) ; <nl> - if ( pos_end ! = String : : npos ) <nl> + String comment ( token . begin , token . begin + token . size ( ) ) ; <nl> + <nl> + if ( ! comment . empty ( ) ) <nl> { <nl> - String hint ( full_comment . begin ( ) + pos_start + 1 , full_comment . begin ( ) + pos_end ) ; <nl> - parse ( hint ) ; <nl> + size_t pos_start = comment . find ( ' { ' , 0 ) ; <nl> + if ( pos_start ! = String : : npos ) <nl> + { <nl> + size_t pos_end = comment . find ( ' } ' , pos_start ) ; <nl> + if ( pos_end ! = String : : npos ) <nl> + { <nl> + String hint ( comment . begin ( ) + pos_start + 1 , comment . begin ( ) + pos_end ) ; <nl> + parse ( hint ) ; <nl> + } <nl> + } <nl> } <nl> } <nl> } <nl>
Slightly better code
ClickHouse/ClickHouse
06095340c7ea89e87cc2cb5b2ef8fc25173814c8
2018-12-28T16:45:45Z
mmm a / src / share / file_monitor . hpp <nl> ppp b / src / share / file_monitor . hpp <nl> class file_monitor final { <nl> / / Signals <nl> <nl> boost : : signals2 : : signal < void ( void ) > register_stream_finished ; <nl> - boost : : signals2 : : signal < void ( const std : : string & changed_file_path , std : : shared_ptr < std : : vector < uint8_t > > file_body ) > file_changed ; <nl> + boost : : signals2 : : signal < void ( const std : : string & changed_file_path , std : : weak_ptr < std : : vector < uint8_t > > weak_changed_file_body ) > file_changed ; <nl> <nl> / / Methods <nl> <nl> mmm a / tests / src / file_monitor / test . cpp <nl> ppp b / tests / src / file_monitor / test . cpp <nl> class test_file_monitor final { <nl> register_stream_finished_ = true ; <nl> } ) ; <nl> <nl> - file_monitor_ - > file_changed . connect ( [ & ] ( auto & & file_path , auto & & file_body ) { <nl> + file_monitor_ - > file_changed . connect ( [ & ] ( auto & & changed_file_path , auto & & weak_changed_file_body ) { <nl> if ( ! file_monitor_thread_id_ ) { <nl> file_monitor_thread_id_ = std : : this_thread : : get_id ( ) ; <nl> } <nl> class test_file_monitor final { <nl> } <nl> <nl> + + count_ ; <nl> - last_file_path_ = file_path ; <nl> + last_file_path_ = changed_file_path ; <nl> <nl> - if ( file_path = = file_path_1_1 ) { <nl> - if ( file_body ) { <nl> + if ( changed_file_path = = file_path_1_1 ) { <nl> + if ( auto file_body = weak_changed_file_body . lock ( ) ) { <nl> last_file_body1_1_ = std : : string ( std : : begin ( * file_body ) , <nl> std : : end ( * file_body ) ) ; <nl> } else { <nl> last_file_body1_1_ = boost : : none ; <nl> } <nl> } <nl> - if ( file_path = = file_path_1_2 ) { <nl> - if ( file_body ) { <nl> + if ( changed_file_path = = file_path_1_2 ) { <nl> + if ( auto file_body = weak_changed_file_body . lock ( ) ) { <nl> last_file_body1_2_ = std : : string ( std : : begin ( * file_body ) , <nl> std : : end ( * file_body ) ) ; <nl> } else { <nl> last_file_body1_2_ = boost : : none ; <nl> } <nl> } <nl> - if ( file_path = = file_path_2_1 ) { <nl> - if ( file_body ) { <nl> + if ( changed_file_path = = file_path_2_1 ) { <nl> + if ( auto file_body = weak_changed_file_body . lock ( ) ) { <nl> last_file_body2_1_ = std : : string ( std : : begin ( * file_body ) , <nl> std : : end ( * file_body ) ) ; <nl> } else { <nl>
change file_changed interface
pqrs-org/Karabiner-Elements
60f45b12d5f38bdbee91d884abf6657b173b6d93
2018-08-22T17:43:25Z
mmm a / cocos / scripting / lua - bindings / auto / api / Timer . lua <nl> ppp b / cocos / scripting / lua - bindings / auto / api / Timer . lua <nl> <nl> - - @ param # float dt <nl> - - @ return Timer # Timer self ( return value : cc . Timer ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - <nl> + - - @ function [ parent = # Timer ] isAborted <nl> + - - @ param self <nl> + - - @ return bool # bool ret ( return value : bool ) <nl> + <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - <nl> - - @ function [ parent = # Timer ] trigger <nl> <nl> - - @ param self <nl> - - @ return Timer # Timer self ( return value : cc . Timer ) <nl> <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + - - <nl> + - - @ function [ parent = # Timer ] setAborted <nl> + - - @ param self <nl> + - - @ return Timer # Timer self ( return value : cc . Timer ) <nl> + <nl> return nil <nl> mmm a / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . cpp <nl> ppp b / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . cpp <nl> int lua_cocos2dx_Timer_update ( lua_State * tolua_S ) <nl> <nl> return 0 ; <nl> } <nl> + int lua_cocos2dx_Timer_isAborted ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Timer * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Timer " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : Timer * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Timer_isAborted ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid arguments in function ' lua_cocos2dx_Timer_isAborted ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + bool ret = cobj - > isAborted ( ) ; <nl> + tolua_pushboolean ( tolua_S , ( bool ) ret ) ; <nl> + return 1 ; <nl> + } <nl> + luaL_error ( tolua_S , " % s has wrong number of arguments : % d , was expecting % d \ n " , " cc . Timer : isAborted " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Timer_isAborted ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> int lua_cocos2dx_Timer_trigger ( lua_State * tolua_S ) <nl> { <nl> int argc = 0 ; <nl> int lua_cocos2dx_Timer_cancel ( lua_State * tolua_S ) <nl> <nl> return 0 ; <nl> } <nl> + int lua_cocos2dx_Timer_setAborted ( lua_State * tolua_S ) <nl> + { <nl> + int argc = 0 ; <nl> + cocos2d : : Timer * cobj = nullptr ; <nl> + bool ok = true ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_Error tolua_err ; <nl> + # endif <nl> + <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! tolua_isusertype ( tolua_S , 1 , " cc . Timer " , 0 , & tolua_err ) ) goto tolua_lerror ; <nl> + # endif <nl> + <nl> + cobj = ( cocos2d : : Timer * ) tolua_tousertype ( tolua_S , 1 , 0 ) ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + if ( ! cobj ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid ' cobj ' in function ' lua_cocos2dx_Timer_setAborted ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + # endif <nl> + <nl> + argc = lua_gettop ( tolua_S ) - 1 ; <nl> + if ( argc = = 0 ) <nl> + { <nl> + if ( ! ok ) <nl> + { <nl> + tolua_error ( tolua_S , " invalid arguments in function ' lua_cocos2dx_Timer_setAborted ' " , nullptr ) ; <nl> + return 0 ; <nl> + } <nl> + cobj - > setAborted ( ) ; <nl> + lua_settop ( tolua_S , 1 ) ; <nl> + return 1 ; <nl> + } <nl> + luaL_error ( tolua_S , " % s has wrong number of arguments : % d , was expecting % d \ n " , " cc . Timer : setAborted " , argc , 0 ) ; <nl> + return 0 ; <nl> + <nl> + # if COCOS2D_DEBUG > = 1 <nl> + tolua_lerror : <nl> + tolua_error ( tolua_S , " # ferror in function ' lua_cocos2dx_Timer_setAborted ' . " , & tolua_err ) ; <nl> + # endif <nl> + <nl> + return 0 ; <nl> + } <nl> static int lua_cocos2dx_Timer_finalize ( lua_State * tolua_S ) <nl> { <nl> printf ( " luabindings : finalizing LUA object ( Timer ) " ) ; <nl> int lua_register_cocos2dx_Timer ( lua_State * tolua_S ) <nl> tolua_function ( tolua_S , " setupTimerWithInterval " , lua_cocos2dx_Timer_setupTimerWithInterval ) ; <nl> tolua_function ( tolua_S , " setInterval " , lua_cocos2dx_Timer_setInterval ) ; <nl> tolua_function ( tolua_S , " update " , lua_cocos2dx_Timer_update ) ; <nl> + tolua_function ( tolua_S , " isAborted " , lua_cocos2dx_Timer_isAborted ) ; <nl> tolua_function ( tolua_S , " trigger " , lua_cocos2dx_Timer_trigger ) ; <nl> tolua_function ( tolua_S , " cancel " , lua_cocos2dx_Timer_cancel ) ; <nl> + tolua_function ( tolua_S , " setAborted " , lua_cocos2dx_Timer_setAborted ) ; <nl> tolua_endmodule ( tolua_S ) ; <nl> std : : string typeName = typeid ( cocos2d : : Timer ) . name ( ) ; <nl> g_luaType [ typeName ] = " cc . Timer " ; <nl> mmm a / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . hpp <nl> ppp b / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . hpp <nl> int register_all_cocos2dx ( lua_State * tolua_S ) ; <nl> <nl> <nl> <nl> + <nl> + <nl> <nl> <nl> <nl>
[ ci skip ] [ AUTO ] : updating luabinding & jsbinding & cocos_file . json automatically ( )
cocos2d/cocos2d-x
fb730b539595770d6f7d5683774ac80c79d76de6
2017-03-07T03:29:17Z
mmm a / todo_dbg . txt <nl> ppp b / todo_dbg . txt <nl> <nl> - getremotestring <nl> - function parameter <nl> - help file updates <nl> - - thread support <nl> - tls callbacks <nl> - inject dll <nl> - dump memory <nl> <nl> - float calculations <nl> - command help <nl> - inject asm code <nl> - - and or xor commands <nl> - - getlasterror <nl> - display open handles <nl> - step to user code <nl> - tracing ( ? ) <nl> <nl> - patching ( + save ) <nl> - handle view <nl> - window view <nl> - - debug strings <nl> - process privileges <nl> - loaded modules window <nl> - strings <nl> <nl> - heap <nl> - TEB / TBI <nl> - PEB / PBI <nl> - - cpu thread id <nl> - log breakpoints <nl> - - fix memory breakpoints <nl> - membp in memmap <nl> - command va2offset ( and the other way around ) <nl> - various different float calculations <nl> - - and / or / xor / cmp with internal flags ( script ) <nl> - restore window position ( BridgeSetting ) <nl> - follow in dump <nl> - opcode byte split <nl> - tabbed GUI ( workspace + dragable windows ) <nl> - LUA / Python support <nl> - - ep break options <nl> - custom colours <nl> - find all intermodular calls <nl> - highlight register changes ( only when CIP changed also ) <nl> mmm a / x64_dbg_dbg / _exports . cpp <nl> ppp b / x64_dbg_dbg / _exports . cpp <nl> extern " C " DLL_EXPORT bool _dbg_addrinfoget ( duint addr , SEGMENTREG segment , ADDR <nl> retval = true ; <nl> else / / no user labels <nl> { <nl> - / / TODO : auto - labels <nl> DWORD64 displacement = 0 ; <nl> char buffer [ sizeof ( SYMBOL_INFO ) + MAX_LABEL_SIZE * sizeof ( char ) ] ; <nl> PSYMBOL_INFO pSymbol = ( PSYMBOL_INFO ) buffer ; <nl> extern " C " DLL_EXPORT bool _dbg_addrinfoget ( duint addr , SEGMENTREG segment , ADDR <nl> * addrinfo - > comment = 0 ; <nl> if ( commentget ( addr , addrinfo - > comment ) ) <nl> retval = true ; <nl> - else / / TODO : auto - comments <nl> + else <nl> { <nl> DWORD dwDisplacement ; <nl> IMAGEHLP_LINE64 line ; <nl> mmm a / x64_dbg_dbg / debugger . cpp <nl> ppp b / x64_dbg_dbg / debugger . cpp <nl> static void cbLoadDll ( LOAD_DLL_DEBUG_INFO * LoadDll ) <nl> <nl> static void cbUnloadDll ( UNLOAD_DLL_DEBUG_INFO * UnloadDll ) <nl> { <nl> - / / TODO : plugin callback <nl> PLUG_CB_UNLOADDLL callbackInfo ; <nl> callbackInfo . UnloadDll = UnloadDll ; <nl> plugincbcall ( CB_UNLOADDLL , & callbackInfo ) ; <nl> static void cbOutputDebugString ( OUTPUT_DEBUG_STRING_INFO * DebugString ) <nl> <nl> static void cbException ( EXCEPTION_DEBUG_INFO * ExceptionData ) <nl> { <nl> - / / TODO : plugin callback <nl> PLUG_CB_EXCEPTION callbackInfo ; <nl> callbackInfo . Exception = ExceptionData ; <nl> <nl> mmm a / x64_dbg_dbg / variable . h <nl> ppp b / x64_dbg_dbg / variable . h <nl> <nl> <nl> # include " _global . h " <nl> <nl> - / / TODO : VAR_VALUE struct usage <nl> - <nl> / / enums <nl> enum VAR_TYPE <nl> { <nl> mmm a / x64_dbg_dbg / x64_dbg . cpp <nl> ppp b / x64_dbg_dbg / x64_dbg . cpp <nl> extern " C " DLL_EXPORT const char * _dbg_dbginit ( ) <nl> <nl> extern " C " DLL_EXPORT void _dbg_dbgexitsignal ( ) <nl> { <nl> - / / TODO : handle exit signal <nl> cbStopDebug ( 0 , 0 ) ; <nl> wait ( WAITID_STOP ) ; / / after this , debugging stopped <nl> pluginunload ( ) ; <nl>
PROJECT : updated todo list
x64dbg/x64dbg
7abe2e19b20bb12811c339ab53f80d5411f832b0
2014-03-26T22:52:38Z
mmm a / src / extproc / http_runner . hpp <nl> ppp b / src / extproc / http_runner . hpp <nl> RDB_SERIALIZE_OUTSIDE ( http_opts_t ) ; <nl> RDB_DECLARE_SERIALIZABLE ( http_opts_t : : http_auth_t ) ; <nl> <nl> <nl> - / / A handle to a running " javascript evaluator " job . <nl> + / / A handle to a running " HTTP fetcher " job . <nl> class http_runner_t : public home_thread_mixin_t { <nl> public : <nl> explicit http_runner_t ( extproc_pool_t * _pool ) ; <nl>
Update stale comment
rethinkdb/rethinkdb
8ec8c87ac8ff119f9119e7fbb901de95350a20a9
2014-07-25T03:42:04Z
mmm a / test / test262 / testcfg . py <nl> ppp b / test / test262 / testcfg . py <nl> def DownloadData ( self ) : <nl> archive_name = os . path . join ( self . root , " tc39 - test262 - % s . tar . gz " % revision ) <nl> directory_name = os . path . join ( self . root , " data " ) <nl> directory_old_name = os . path . join ( self . root , " data . old " ) <nl> + <nl> + # Clobber if the test is in an outdated state , i . e . if there are any other <nl> + # archive files present . <nl> + archive_files = [ f for f in os . listdir ( self . root ) <nl> + if f . startswith ( " tc39 - test262 - " ) ] <nl> + if ( len ( archive_files ) > 1 or <nl> + os . path . basename ( archive_name ) not in archive_files ) : <nl> + print " Clobber outdated test archives . . . " <nl> + for f in archive_files : <nl> + os . remove ( os . path . join ( self . root , f ) ) <nl> + <nl> if not os . path . exists ( archive_name ) : <nl> print " Downloading test data from % s . . . " % archive_url <nl> utils . URLRetrieve ( archive_url , archive_name ) <nl> def DownloadData ( self ) : <nl> with open ( archive_name , " rb " ) as f : <nl> for chunk in iter ( lambda : f . read ( 8192 ) , " " ) : <nl> md5 . update ( chunk ) <nl> + print " MD5 hash is % s " % md5 . hexdigest ( ) <nl> if md5 . hexdigest ( ) ! = TEST_262_ARCHIVE_MD5 : <nl> os . remove ( archive_name ) <nl> + print " MD5 expected % s " % TEST_262_ARCHIVE_MD5 <nl> raise Exception ( " Hash mismatch of test data file " ) <nl> archive = tarfile . open ( archive_name , " r : gz " ) <nl> if sys . platform in ( " win32 " , " cygwin " ) : <nl>
[ test ] Port clobber of old test262 archive files .
v8/v8
e595f33f5c1413007d9fb895bc187ad2fd6ddc50
2015-07-06T12:09:46Z
mmm a / src / api . cc <nl> ppp b / src / api . cc <nl> StartupData SnapshotCreator : : CreateBlob ( <nl> i : : HeapIterator heap_iterator ( isolate - > heap ( ) ) ; <nl> while ( i : : HeapObject * current_obj = heap_iterator . next ( ) ) { <nl> if ( current_obj - > IsSharedFunctionInfo ( ) ) { <nl> - i : : SharedFunctionInfo * shared = <nl> - i : : SharedFunctionInfo : : cast ( current_obj ) ; <nl> + i : : SharedFunctionInfo shared = i : : SharedFunctionInfo : : cast ( current_obj ) ; <nl> if ( shared - > CanDiscardCompiled ( ) ) { <nl> sfis_to_clear . emplace_back ( shared , isolate ) ; <nl> } <nl> Local < PrimitiveArray > ScriptOrModule : : GetHostDefinedOptions ( ) { <nl> <nl> Local < UnboundScript > Script : : GetUnboundScript ( ) { <nl> i : : Handle < i : : Object > obj = Utils : : OpenHandle ( this ) ; <nl> - i : : SharedFunctionInfo * sfi = i : : JSFunction : : cast ( * obj ) - > shared ( ) ; <nl> + i : : SharedFunctionInfo sfi = i : : JSFunction : : cast ( * obj ) - > shared ( ) ; <nl> i : : Isolate * isolate = sfi - > GetIsolate ( ) ; <nl> return ToApiHandle < UnboundScript > ( i : : handle ( sfi , isolate ) ) ; <nl> } <nl> void debug : : ResetBlackboxedStateCache ( Isolate * v8_isolate , <nl> i : : DisallowHeapAllocation no_gc ; <nl> i : : SharedFunctionInfo : : ScriptIterator iter ( isolate , <nl> * Utils : : OpenHandle ( * script ) ) ; <nl> - while ( i : : SharedFunctionInfo * info = iter . Next ( ) ) { <nl> + for ( i : : SharedFunctionInfo info = iter . Next ( ) ; ! info . is_null ( ) ; <nl> + info = iter . Next ( ) ) { <nl> if ( info - > HasDebugInfo ( ) ) { <nl> info - > GetDebugInfo ( ) - > set_computed_debug_is_blackboxed ( false ) ; <nl> } <nl> mmm a / src / asmjs / asm - js . cc <nl> ppp b / src / asmjs / asm - js . cc <nl> bool AreStdlibMembersValid ( Isolate * isolate , Handle < JSReceiver > stdlib , <nl> Handle < Object > value = JSReceiver : : GetDataProperty ( stdlib , name ) ; <nl> if ( ! value - > IsNaN ( ) ) return false ; <nl> } <nl> - # define STDLIB_MATH_FUNC ( fname , FName , ignore1 , ignore2 ) \ <nl> - if ( members . Contains ( wasm : : AsmJsParser : : StandardMember : : kMath # # FName ) ) { \ <nl> - members . Remove ( wasm : : AsmJsParser : : StandardMember : : kMath # # FName ) ; \ <nl> - Handle < Name > name ( isolate - > factory ( ) - > InternalizeOneByteString ( \ <nl> - STATIC_CHAR_VECTOR ( # fname ) ) ) ; \ <nl> - Handle < Object > value = StdlibMathMember ( isolate , stdlib , name ) ; \ <nl> - if ( ! value - > IsJSFunction ( ) ) return false ; \ <nl> - SharedFunctionInfo * shared = Handle < JSFunction > : : cast ( value ) - > shared ( ) ; \ <nl> - if ( ! shared - > HasBuiltinId ( ) | | \ <nl> - shared - > builtin_id ( ) ! = Builtins : : kMath # # FName ) { \ <nl> - return false ; \ <nl> - } \ <nl> - DCHECK_EQ ( shared - > GetCode ( ) , \ <nl> - isolate - > builtins ( ) - > builtin ( Builtins : : kMath # # FName ) ) ; \ <nl> + # define STDLIB_MATH_FUNC ( fname , FName , ignore1 , ignore2 ) \ <nl> + if ( members . Contains ( wasm : : AsmJsParser : : StandardMember : : kMath # # FName ) ) { \ <nl> + members . Remove ( wasm : : AsmJsParser : : StandardMember : : kMath # # FName ) ; \ <nl> + Handle < Name > name ( isolate - > factory ( ) - > InternalizeOneByteString ( \ <nl> + STATIC_CHAR_VECTOR ( # fname ) ) ) ; \ <nl> + Handle < Object > value = StdlibMathMember ( isolate , stdlib , name ) ; \ <nl> + if ( ! value - > IsJSFunction ( ) ) return false ; \ <nl> + SharedFunctionInfo shared = Handle < JSFunction > : : cast ( value ) - > shared ( ) ; \ <nl> + if ( ! shared - > HasBuiltinId ( ) | | \ <nl> + shared - > builtin_id ( ) ! = Builtins : : kMath # # FName ) { \ <nl> + return false ; \ <nl> + } \ <nl> + DCHECK_EQ ( shared - > GetCode ( ) , \ <nl> + isolate - > builtins ( ) - > builtin ( Builtins : : kMath # # FName ) ) ; \ <nl> } <nl> STDLIB_MATH_FUNCTION_LIST ( STDLIB_MATH_FUNC ) <nl> # undef STDLIB_MATH_FUNC <nl> mmm a / src / code - events . h <nl> ppp b / src / code - events . h <nl> <nl> # include " src / globals . h " <nl> # include " src / objects / code . h " <nl> # include " src / objects / name . h " <nl> + # include " src / objects / shared - function - info . h " <nl> # include " src / objects / string . h " <nl> # include " src / vector . h " <nl> <nl> class CodeEventListener { <nl> virtual void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> Name name ) = 0 ; <nl> virtual void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source ) = 0 ; <nl> + SharedFunctionInfo shared , Name source ) = 0 ; <nl> virtual void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source , <nl> - int line , int column ) = 0 ; <nl> + SharedFunctionInfo shared , Name source , int line , <nl> + int column ) = 0 ; <nl> virtual void CodeCreateEvent ( LogEventsAndTags tag , const wasm : : WasmCode * code , <nl> wasm : : WasmName name ) = 0 ; <nl> virtual void CallbackEvent ( Name name , Address entry_point ) = 0 ; <nl> class CodeEventListener { <nl> virtual void SharedFunctionInfoMoveEvent ( Address from , Address to ) = 0 ; <nl> virtual void CodeMovingGCEvent ( ) = 0 ; <nl> virtual void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) = 0 ; <nl> + SharedFunctionInfo shared ) = 0 ; <nl> virtual void CodeDeoptEvent ( Code code , DeoptimizeKind kind , Address pc , <nl> int fp_to_sp_delta ) = 0 ; <nl> <nl> class CodeEventDispatcher { <nl> CODE_EVENT_DISPATCH ( CodeCreateEvent ( tag , code , name ) ) ; <nl> } <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name name ) { <nl> + SharedFunctionInfo shared , Name name ) { <nl> CODE_EVENT_DISPATCH ( CodeCreateEvent ( tag , code , shared , name ) ) ; <nl> } <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source , int line , <nl> + SharedFunctionInfo shared , Name source , int line , <nl> int column ) { <nl> CODE_EVENT_DISPATCH ( <nl> CodeCreateEvent ( tag , code , shared , source , line , column ) ) ; <nl> class CodeEventDispatcher { <nl> CODE_EVENT_DISPATCH ( SharedFunctionInfoMoveEvent ( from , to ) ) ; <nl> } <nl> void CodeMovingGCEvent ( ) { CODE_EVENT_DISPATCH ( CodeMovingGCEvent ( ) ) ; } <nl> - void CodeDisableOptEvent ( AbstractCode code , SharedFunctionInfo * shared ) { <nl> + void CodeDisableOptEvent ( AbstractCode code , SharedFunctionInfo shared ) { <nl> CODE_EVENT_DISPATCH ( CodeDisableOptEvent ( code , shared ) ) ; <nl> } <nl> void CodeDeoptEvent ( Code code , DeoptimizeKind kind , Address pc , <nl> mmm a / src / compiler - dispatcher / compiler - dispatcher . cc <nl> ppp b / src / compiler - dispatcher / compiler - dispatcher . cc <nl> bool CompilerDispatcher : : IsEnqueued ( JobId job_id ) const { <nl> } <nl> <nl> void CompilerDispatcher : : RegisterSharedFunctionInfo ( <nl> - JobId job_id , SharedFunctionInfo * function ) { <nl> + JobId job_id , SharedFunctionInfo function ) { <nl> DCHECK_NE ( jobs_ . find ( job_id ) , jobs_ . end ( ) ) ; <nl> <nl> if ( trace_compiler_dispatcher_ ) { <nl> void CompilerDispatcher : : RegisterSharedFunctionInfo ( <nl> } <nl> <nl> / / Make a global handle to the function . <nl> - Handle < SharedFunctionInfo > function_handle = <nl> - isolate_ - > global_handles ( ) - > Create ( function ) ; <nl> + Handle < SharedFunctionInfo > function_handle = Handle < SharedFunctionInfo > : : cast ( <nl> + isolate_ - > global_handles ( ) - > Create ( function ) ) ; <nl> <nl> / / Register mapping . <nl> auto job_it = jobs_ . find ( job_id ) ; <nl> mmm a / src / compiler - dispatcher / compiler - dispatcher . h <nl> ppp b / src / compiler - dispatcher / compiler - dispatcher . h <nl> class V8_EXPORT_PRIVATE CompilerDispatcher { <nl> const FunctionLiteral * function_literal ) ; <nl> <nl> / / Registers the given | function | with the compilation job | job_id | . <nl> - void RegisterSharedFunctionInfo ( JobId job_id , SharedFunctionInfo * function ) ; <nl> + void RegisterSharedFunctionInfo ( JobId job_id , SharedFunctionInfo function ) ; <nl> <nl> / / Returns true if there is a pending job with the given id . <nl> bool IsEnqueued ( JobId job_id ) const ; <nl> mmm a / src / compiler . cc <nl> ppp b / src / compiler . cc <nl> MaybeHandle < JSFunction > Compiler : : GetWrappedFunction ( <nl> ASSIGN_RETURN_ON_EXCEPTION ( isolate , top_level , maybe_result , JSFunction ) ; <nl> <nl> SharedFunctionInfo : : ScriptIterator infos ( isolate , * script ) ; <nl> - while ( SharedFunctionInfo * info = infos . Next ( ) ) { <nl> + for ( SharedFunctionInfo info = infos . Next ( ) ; ! info . is_null ( ) ; <nl> + info = infos . Next ( ) ) { <nl> if ( info - > is_wrapped ( ) ) { <nl> wrapped = Handle < SharedFunctionInfo > ( info , isolate ) ; <nl> break ; <nl> mmm a / src / compiler / linkage . cc <nl> ppp b / src / compiler / linkage . cc <nl> CallDescriptor * Linkage : : ComputeIncoming ( Zone * zone , <nl> if ( ! info - > closure ( ) . is_null ( ) ) { <nl> / / If we are compiling a JS function , use a JS call descriptor , <nl> / / plus the receiver . <nl> - SharedFunctionInfo * shared = info - > closure ( ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = info - > closure ( ) - > shared ( ) ; <nl> return GetJSCallDescriptor ( zone , info - > is_osr ( ) , <nl> 1 + shared - > internal_formal_parameter_count ( ) , <nl> CallDescriptor : : kCanUseRoots ) ; <nl> mmm a / src / compiler / wasm - compiler . cc <nl> ppp b / src / compiler / wasm - compiler . cc <nl> WasmImportCallKind GetWasmImportCallKind ( Handle < JSReceiver > target , <nl> / / and whether it has a sloppy receiver . <nl> if ( target - > IsJSFunction ( ) ) { <nl> Handle < JSFunction > function = Handle < JSFunction > : : cast ( target ) ; <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> <nl> / / Check for math intrinsics . <nl> # define COMPARE_SIG_FOR_BUILTIN ( name ) \ <nl> mmm a / src / debug / debug - coverage . cc <nl> ppp b / src / debug / debug - coverage . cc <nl> namespace v8 { <nl> namespace internal { <nl> <nl> class SharedToCounterMap <nl> - : public base : : TemplateHashMapImpl < SharedFunctionInfo * , uint32_t , <nl> + : public base : : TemplateHashMapImpl < SharedFunctionInfo , uint32_t , <nl> base : : KeyEqualityMatcher < void * > , <nl> base : : DefaultAllocationPolicy > { <nl> public : <nl> - typedef base : : TemplateHashMapEntry < SharedFunctionInfo * , uint32_t > Entry ; <nl> - inline void Add ( SharedFunctionInfo * key , uint32_t count ) { <nl> + typedef base : : TemplateHashMapEntry < SharedFunctionInfo , uint32_t > Entry ; <nl> + inline void Add ( SharedFunctionInfo key , uint32_t count ) { <nl> Entry * entry = LookupOrInsert ( key , Hash ( key ) , [ ] ( ) { return 0 ; } ) ; <nl> uint32_t old_count = entry - > value ; <nl> if ( UINT32_MAX - count < old_count ) { <nl> class SharedToCounterMap <nl> } <nl> } <nl> <nl> - inline uint32_t Get ( SharedFunctionInfo * key ) { <nl> + inline uint32_t Get ( SharedFunctionInfo key ) { <nl> Entry * entry = Lookup ( key , Hash ( key ) ) ; <nl> if ( entry = = nullptr ) return 0 ; <nl> return entry - > value ; <nl> } <nl> <nl> private : <nl> - static uint32_t Hash ( SharedFunctionInfo * key ) { <nl> - return static_cast < uint32_t > ( reinterpret_cast < intptr_t > ( key ) ) ; <nl> + static uint32_t Hash ( SharedFunctionInfo key ) { <nl> + return static_cast < uint32_t > ( key . ptr ( ) ) ; <nl> } <nl> <nl> DisallowHeapAllocation no_gc ; <nl> } ; <nl> <nl> namespace { <nl> - int StartPosition ( SharedFunctionInfo * info ) { <nl> + int StartPosition ( SharedFunctionInfo info ) { <nl> int start = info - > function_token_position ( ) ; <nl> if ( start = = kNoSourcePosition ) start = info - > StartPosition ( ) ; <nl> return start ; <nl> } <nl> <nl> - bool CompareSharedFunctionInfo ( SharedFunctionInfo * a , SharedFunctionInfo * b ) { <nl> + bool CompareSharedFunctionInfo ( SharedFunctionInfo a , SharedFunctionInfo b ) { <nl> int a_start = StartPosition ( a ) ; <nl> int b_start = StartPosition ( b ) ; <nl> if ( a_start = = b_start ) return a - > EndPosition ( ) > b - > EndPosition ( ) ; <nl> void SortBlockData ( std : : vector < CoverageBlock > & v ) { <nl> std : : sort ( v . begin ( ) , v . end ( ) , CompareCoverageBlock ) ; <nl> } <nl> <nl> - std : : vector < CoverageBlock > GetSortedBlockData ( SharedFunctionInfo * shared ) { <nl> + std : : vector < CoverageBlock > GetSortedBlockData ( SharedFunctionInfo shared ) { <nl> DCHECK ( shared - > HasCoverageInfo ( ) ) ; <nl> <nl> CoverageInfo coverage_info = <nl> void ClampToBinary ( CoverageFunction * function ) { <nl> } <nl> } <nl> <nl> - void ResetAllBlockCounts ( SharedFunctionInfo * shared ) { <nl> + void ResetAllBlockCounts ( SharedFunctionInfo shared ) { <nl> DCHECK ( shared - > HasCoverageInfo ( ) ) ; <nl> <nl> CoverageInfo coverage_info = <nl> bool IsBinaryMode ( debug : : Coverage : : Mode mode ) { <nl> } <nl> } <nl> <nl> - void CollectBlockCoverage ( CoverageFunction * function , SharedFunctionInfo * info , <nl> + void CollectBlockCoverage ( CoverageFunction * function , SharedFunctionInfo info , <nl> debug : : Coverage : : Mode mode ) { <nl> DCHECK ( IsBlockMode ( mode ) ) ; <nl> <nl> std : : unique_ptr < Coverage > Coverage : : Collect ( <nl> isolate - > factory ( ) - > feedback_vectors_for_profiling_tools ( ) ) ; <nl> for ( int i = 0 ; i < list - > Length ( ) ; i + + ) { <nl> FeedbackVector * vector = FeedbackVector : : cast ( list - > Get ( i ) ) ; <nl> - SharedFunctionInfo * shared = vector - > shared_function_info ( ) ; <nl> + SharedFunctionInfo shared = vector - > shared_function_info ( ) ; <nl> DCHECK ( shared - > IsSubjectToDebugging ( ) ) ; <nl> uint32_t count = static_cast < uint32_t > ( vector - > invocation_count ( ) ) ; <nl> if ( reset_count ) vector - > clear_invocation_count ( ) ; <nl> std : : unique_ptr < Coverage > Coverage : : Collect ( <nl> while ( HeapObject * current_obj = heap_iterator . next ( ) ) { <nl> if ( ! current_obj - > IsFeedbackVector ( ) ) continue ; <nl> FeedbackVector * vector = FeedbackVector : : cast ( current_obj ) ; <nl> - SharedFunctionInfo * shared = vector - > shared_function_info ( ) ; <nl> + SharedFunctionInfo shared = vector - > shared_function_info ( ) ; <nl> if ( ! shared - > IsSubjectToDebugging ( ) ) continue ; <nl> uint32_t count = static_cast < uint32_t > ( vector - > invocation_count ( ) ) ; <nl> counter_map . Add ( shared , count ) ; <nl> std : : unique_ptr < Coverage > Coverage : : Collect ( <nl> result - > emplace_back ( script_handle ) ; <nl> std : : vector < CoverageFunction > * functions = & result - > back ( ) . functions ; <nl> <nl> - std : : vector < SharedFunctionInfo * > sorted ; <nl> + std : : vector < SharedFunctionInfo > sorted ; <nl> <nl> { <nl> / / Sort functions by start position , from outer to inner functions . <nl> SharedFunctionInfo : : ScriptIterator infos ( isolate , * script_handle ) ; <nl> - while ( SharedFunctionInfo * info = infos . Next ( ) ) { <nl> + for ( SharedFunctionInfo info = infos . Next ( ) ; ! info . is_null ( ) ; <nl> + info = infos . Next ( ) ) { <nl> sorted . push_back ( info ) ; <nl> } <nl> std : : sort ( sorted . begin ( ) , sorted . end ( ) , CompareSharedFunctionInfo ) ; <nl> std : : unique_ptr < Coverage > Coverage : : Collect ( <nl> std : : vector < size_t > nesting ; <nl> <nl> / / Use sorted list to reconstruct function nesting . <nl> - for ( SharedFunctionInfo * info : sorted ) { <nl> + for ( SharedFunctionInfo info : sorted ) { <nl> int start = StartPosition ( info ) ; <nl> int end = info - > EndPosition ( ) ; <nl> uint32_t count = counter_map . Get ( info ) ; <nl> void Coverage : : SelectMode ( Isolate * isolate , debug : : Coverage : : Mode mode ) { <nl> / / If collecting binary coverage , reset <nl> / / SFI : : has_reported_binary_coverage to avoid optimizing / inlining <nl> / / functions before they have reported coverage . <nl> - SharedFunctionInfo * shared = SharedFunctionInfo : : cast ( o ) ; <nl> + SharedFunctionInfo shared = SharedFunctionInfo : : cast ( o ) ; <nl> shared - > set_has_reported_binary_coverage ( false ) ; <nl> } else if ( o - > IsFeedbackVector ( ) ) { <nl> / / In any case , clear any collected invocation counts . <nl> mmm a / src / debug / debug - type - profile . cc <nl> ppp b / src / debug / debug - type - profile . cc <nl> std : : unique_ptr < TypeProfile > TypeProfile : : Collect ( Isolate * isolate ) { <nl> / / the list multiple times . <nl> for ( int i = 0 ; i < list - > Length ( ) ; i + + ) { <nl> FeedbackVector * vector = FeedbackVector : : cast ( list - > Get ( i ) ) ; <nl> - SharedFunctionInfo * info = vector - > shared_function_info ( ) ; <nl> + SharedFunctionInfo info = vector - > shared_function_info ( ) ; <nl> DCHECK ( info - > IsSubjectToDebugging ( ) ) ; <nl> <nl> / / Match vectors with script . <nl> void TypeProfile : : SelectMode ( Isolate * isolate , debug : : TypeProfile : : Mode mode ) { <nl> <nl> for ( int i = 0 ; i < list - > Length ( ) ; i + + ) { <nl> FeedbackVector * vector = FeedbackVector : : cast ( list - > Get ( i ) ) ; <nl> - SharedFunctionInfo * info = vector - > shared_function_info ( ) ; <nl> + SharedFunctionInfo info = vector - > shared_function_info ( ) ; <nl> DCHECK ( info - > IsSubjectToDebugging ( ) ) ; <nl> if ( info - > feedback_metadata ( ) - > HasTypeProfileSlot ( ) ) { <nl> FeedbackSlot slot = vector - > GetTypeProfileSlot ( ) ; <nl> mmm a / src / debug / debug . cc <nl> ppp b / src / debug / debug . cc <nl> void Debug : : PrepareStepOnThrow ( ) { <nl> while ( ! it . done ( ) ) { <nl> JavaScriptFrame * frame = it . frame ( ) ; <nl> if ( frame - > LookupExceptionHandlerInTable ( nullptr , nullptr ) > 0 ) break ; <nl> - std : : vector < SharedFunctionInfo * > infos ; <nl> + std : : vector < SharedFunctionInfo > infos ; <nl> frame - > GetFunctions ( & infos ) ; <nl> current_frame_count - = infos . size ( ) ; <nl> it . Advance ( ) ; <nl> void Debug : : ClearOneShot ( ) { <nl> <nl> class RedirectActiveFunctions : public ThreadVisitor { <nl> public : <nl> - explicit RedirectActiveFunctions ( SharedFunctionInfo * shared ) <nl> + explicit RedirectActiveFunctions ( SharedFunctionInfo shared ) <nl> : shared_ ( shared ) { <nl> DCHECK ( shared - > HasBytecodeArray ( ) ) ; <nl> } <nl> class RedirectActiveFunctions : public ThreadVisitor { <nl> } <nl> <nl> private : <nl> - SharedFunctionInfo * shared_ ; <nl> + SharedFunctionInfo shared_ ; <nl> DisallowHeapAllocation no_gc_ ; <nl> } ; <nl> <nl> void Debug : : InstallDebugBreakTrampoline ( ) { <nl> continue ; <nl> } else if ( obj - > IsJSFunction ( ) ) { <nl> JSFunction * fun = JSFunction : : cast ( obj ) ; <nl> - SharedFunctionInfo * shared = fun - > shared ( ) ; <nl> + SharedFunctionInfo shared = fun - > shared ( ) ; <nl> if ( ! shared - > HasDebugInfo ( ) ) continue ; <nl> if ( ! shared - > GetDebugInfo ( ) - > CanBreakAtEntry ( ) ) continue ; <nl> if ( ! fun - > is_compiled ( ) ) { <nl> bool Debug : : GetPossibleBreakpoints ( Handle < Script > script , int start_position , <nl> HandleScope scope ( isolate_ ) ; <nl> std : : vector < Handle < SharedFunctionInfo > > candidates ; <nl> SharedFunctionInfo : : ScriptIterator iterator ( isolate_ , * script ) ; <nl> - for ( SharedFunctionInfo * info = iterator . Next ( ) ; info ! = nullptr ; <nl> + for ( SharedFunctionInfo info = iterator . Next ( ) ; ! info . is_null ( ) ; <nl> info = iterator . Next ( ) ) { <nl> if ( info - > EndPosition ( ) < start_position | | <nl> info - > StartPosition ( ) > = end_position ) { <nl> bool Debug : : GetPossibleBreakpoints ( Handle < Script > script , int start_position , <nl> class SharedFunctionInfoFinder { <nl> public : <nl> explicit SharedFunctionInfoFinder ( int target_position ) <nl> - : current_candidate_ ( nullptr ) , <nl> - current_candidate_closure_ ( nullptr ) , <nl> + : current_candidate_closure_ ( nullptr ) , <nl> current_start_position_ ( kNoSourcePosition ) , <nl> target_position_ ( target_position ) { } <nl> <nl> - void NewCandidate ( SharedFunctionInfo * shared , JSFunction * closure = nullptr ) { <nl> + void NewCandidate ( SharedFunctionInfo shared , JSFunction * closure = nullptr ) { <nl> if ( ! shared - > IsSubjectToDebugging ( ) ) return ; <nl> int start_position = shared - > function_token_position ( ) ; <nl> if ( start_position = = kNoSourcePosition ) { <nl> class SharedFunctionInfoFinder { <nl> if ( start_position > target_position_ ) return ; <nl> if ( target_position_ > shared - > EndPosition ( ) ) return ; <nl> <nl> - if ( current_candidate_ ! = nullptr ) { <nl> + if ( ! current_candidate_ . is_null ( ) ) { <nl> if ( current_start_position_ = = start_position & & <nl> shared - > EndPosition ( ) = = current_candidate_ - > EndPosition ( ) ) { <nl> / / If we already have a matching closure , do not throw it away . <nl> class SharedFunctionInfoFinder { <nl> current_candidate_closure_ = closure ; <nl> } <nl> <nl> - SharedFunctionInfo * Result ( ) { return current_candidate_ ; } <nl> + SharedFunctionInfo Result ( ) { return current_candidate_ ; } <nl> <nl> JSFunction * ResultClosure ( ) { return current_candidate_closure_ ; } <nl> <nl> private : <nl> - SharedFunctionInfo * current_candidate_ ; <nl> + SharedFunctionInfo current_candidate_ ; <nl> JSFunction * current_candidate_closure_ ; <nl> int current_start_position_ ; <nl> int target_position_ ; <nl> Handle < Object > Debug : : FindSharedFunctionInfoInScript ( Handle < Script > script , <nl> / / If there is no shared function info for this script at all , there is <nl> / / no point in looking for it by walking the heap . <nl> <nl> - SharedFunctionInfo * shared ; <nl> + SharedFunctionInfo shared ; <nl> { <nl> SharedFunctionInfoFinder finder ( position ) ; <nl> SharedFunctionInfo : : ScriptIterator iterator ( isolate_ , * script ) ; <nl> - for ( SharedFunctionInfo * info = iterator . Next ( ) ; info ! = nullptr ; <nl> + for ( SharedFunctionInfo info = iterator . Next ( ) ; ! info . is_null ( ) ; <nl> info = iterator . Next ( ) ) { <nl> finder . NewCandidate ( info ) ; <nl> } <nl> shared = finder . Result ( ) ; <nl> - if ( shared = = nullptr ) break ; <nl> + if ( shared . is_null ( ) ) break ; <nl> / / We found it if it ' s already compiled . <nl> if ( shared - > is_compiled ( ) ) { <nl> Handle < SharedFunctionInfo > shared_handle ( shared , isolate_ ) ; <nl> int Debug : : CurrentFrameCount ( ) { <nl> int counter = 0 ; <nl> while ( ! it . done ( ) ) { <nl> if ( it . frame ( ) - > is_optimized ( ) ) { <nl> - std : : vector < SharedFunctionInfo * > infos ; <nl> + std : : vector < SharedFunctionInfo > infos ; <nl> OptimizedFrame : : cast ( it . frame ( ) ) - > GetFunctions ( & infos ) ; <nl> counter + = infos . size ( ) ; <nl> } else { <nl> bool Debug : : PerformSideEffectCheckAtBytecode ( InterpretedFrame * frame ) { <nl> using interpreter : : Bytecode ; <nl> <nl> DCHECK_EQ ( isolate_ - > debug_execution_mode ( ) , DebugInfo : : kSideEffects ) ; <nl> - SharedFunctionInfo * shared = frame - > function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = frame - > function ( ) - > shared ( ) ; <nl> BytecodeArray bytecode_array = shared - > GetBytecodeArray ( ) ; <nl> int offset = frame - > GetBytecodeOffset ( ) ; <nl> interpreter : : BytecodeArrayAccessor bytecode_accessor ( <nl> mmm a / src / debug / liveedit . cc <nl> ppp b / src / debug / liveedit . cc <nl> class FunctionDataMap : public ThreadVisitor { <nl> FunctionData { literal , should_restart } ) ; <nl> } <nl> <nl> - bool Lookup ( SharedFunctionInfo * sfi , FunctionData * * data ) { <nl> + bool Lookup ( SharedFunctionInfo sfi , FunctionData * * data ) { <nl> int start_position = sfi - > StartPosition ( ) ; <nl> if ( ! sfi - > script ( ) - > IsScript ( ) | | start_position = = - 1 ) { <nl> return false ; <nl> class FunctionDataMap : public ThreadVisitor { <nl> HeapIterator iterator ( isolate - > heap ( ) , HeapIterator : : kFilterUnreachable ) ; <nl> while ( HeapObject * obj = iterator . next ( ) ) { <nl> if ( obj - > IsSharedFunctionInfo ( ) ) { <nl> - SharedFunctionInfo * sfi = SharedFunctionInfo : : cast ( obj ) ; <nl> + SharedFunctionInfo sfi = SharedFunctionInfo : : cast ( obj ) ; <nl> FunctionData * data = nullptr ; <nl> if ( ! Lookup ( sfi , & data ) ) continue ; <nl> data - > shared = handle ( sfi , isolate ) ; <nl> } else if ( obj - > IsJSFunction ( ) ) { <nl> JSFunction * js_function = JSFunction : : cast ( obj ) ; <nl> - SharedFunctionInfo * sfi = js_function - > shared ( ) ; <nl> + SharedFunctionInfo sfi = js_function - > shared ( ) ; <nl> FunctionData * data = nullptr ; <nl> if ( ! Lookup ( sfi , & data ) ) continue ; <nl> data - > js_functions . emplace_back ( js_function , isolate ) ; <nl> } else if ( obj - > IsJSGeneratorObject ( ) ) { <nl> JSGeneratorObject * gen = JSGeneratorObject : : cast ( obj ) ; <nl> if ( gen - > is_closed ( ) ) continue ; <nl> - SharedFunctionInfo * sfi = gen - > function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo sfi = gen - > function ( ) - > shared ( ) ; <nl> FunctionData * data = nullptr ; <nl> if ( ! Lookup ( sfi , & data ) ) continue ; <nl> data - > running_generators . emplace_back ( gen , isolate ) ; <nl> class FunctionDataMap : public ThreadVisitor { <nl> return FuncId ( script_id , start_position ) ; <nl> } <nl> <nl> - FuncId GetFuncId ( int script_id , SharedFunctionInfo * sfi ) { <nl> + FuncId GetFuncId ( int script_id , SharedFunctionInfo sfi ) { <nl> DCHECK_EQ ( script_id , Script : : cast ( sfi - > script ( ) ) - > id ( ) ) ; <nl> int start_position = sfi - > StartPosition ( ) ; <nl> DCHECK_NE ( start_position , - 1 ) ; <nl> void LiveEdit : : PatchScript ( Isolate * isolate , Handle < Script > script , <nl> } <nl> } <nl> SharedFunctionInfo : : ScriptIterator it ( isolate , * new_script ) ; <nl> - while ( SharedFunctionInfo * sfi = it . Next ( ) ) { <nl> + for ( SharedFunctionInfo sfi = it . Next ( ) ; ! sfi . is_null ( ) ; sfi = it . Next ( ) ) { <nl> if ( ! sfi - > HasBytecodeArray ( ) ) continue ; <nl> FixedArray constants = sfi - > GetBytecodeArray ( ) - > constant_pool ( ) ; <nl> for ( int i = 0 ; i < constants - > length ( ) ; + + i ) { <nl> if ( ! constants - > get ( i ) - > IsSharedFunctionInfo ( ) ) continue ; <nl> - SharedFunctionInfo * inner_sfi = <nl> + SharedFunctionInfo inner_sfi = <nl> SharedFunctionInfo : : cast ( constants - > get ( i ) ) ; <nl> / / See if there is a mapping from this function ' s start position to a <nl> / / unchanged function ' s id . <nl> void LiveEdit : : PatchScript ( Isolate * isolate , Handle < Script > script , <nl> <nl> / / Grab that function id from the new script ' s SFI list , which should have <nl> / / already been updated in in the unchanged pass . <nl> - SharedFunctionInfo * old_unchanged_inner_sfi = <nl> + SharedFunctionInfo old_unchanged_inner_sfi = <nl> SharedFunctionInfo : : cast ( new_script - > shared_function_infos ( ) <nl> - > Get ( unchanged_it - > second ) <nl> - > GetHeapObject ( ) ) ; <nl> void LiveEdit : : PatchScript ( Isolate * isolate , Handle < Script > script , <nl> <nl> SharedFunctionInfo : : ScriptIterator it ( isolate , * new_script ) ; <nl> std : : set < int > start_positions ; <nl> - while ( SharedFunctionInfo * sfi = it . Next ( ) ) { <nl> + for ( SharedFunctionInfo sfi = it . Next ( ) ; ! sfi . is_null ( ) ; sfi = it . Next ( ) ) { <nl> DCHECK_EQ ( sfi - > script ( ) , * new_script ) ; <nl> DCHECK_EQ ( sfi - > FunctionLiteralId ( isolate ) , it . CurrentIndex ( ) ) ; <nl> / / Don ' t check the start position of the top - level function , as it can <nl> void LiveEdit : : PatchScript ( Isolate * isolate , Handle < Script > script , <nl> FixedArray constants = sfi - > GetBytecodeArray ( ) - > constant_pool ( ) ; <nl> for ( int i = 0 ; i < constants - > length ( ) ; + + i ) { <nl> if ( ! constants - > get ( i ) - > IsSharedFunctionInfo ( ) ) continue ; <nl> - SharedFunctionInfo * inner_sfi = <nl> + SharedFunctionInfo inner_sfi = <nl> SharedFunctionInfo : : cast ( constants - > get ( i ) ) ; <nl> DCHECK_EQ ( inner_sfi - > script ( ) , * new_script ) ; <nl> DCHECK_EQ ( inner_sfi , new_script - > shared_function_infos ( ) <nl> mmm a / src / deoptimizer . cc <nl> ppp b / src / deoptimizer . cc <nl> void Deoptimizer : : DoComputeOutputFrames ( ) { <nl> void Deoptimizer : : DoComputeInterpretedFrame ( TranslatedFrame * translated_frame , <nl> int frame_index , <nl> bool goto_catch_handler ) { <nl> - SharedFunctionInfo * shared = translated_frame - > raw_shared_info ( ) ; <nl> + SharedFunctionInfo shared = translated_frame - > raw_shared_info ( ) ; <nl> <nl> TranslatedFrame : : iterator value_iterator = translated_frame - > begin ( ) ; <nl> bool is_bottommost = ( 0 = = frame_index ) ; <nl> unsigned Deoptimizer : : ComputeInputFrameSize ( ) const { <nl> } <nl> <nl> / / static <nl> - unsigned Deoptimizer : : ComputeInterpretedFixedSize ( SharedFunctionInfo * shared ) { <nl> + unsigned Deoptimizer : : ComputeInterpretedFixedSize ( SharedFunctionInfo shared ) { <nl> / / The fixed part of the frame consists of the return address , frame <nl> / / pointer , function , context , bytecode offset and all the incoming arguments . <nl> return ComputeIncomingArgumentSize ( shared ) + <nl> unsigned Deoptimizer : : ComputeInterpretedFixedSize ( SharedFunctionInfo * shared ) { <nl> } <nl> <nl> / / static <nl> - unsigned Deoptimizer : : ComputeIncomingArgumentSize ( SharedFunctionInfo * shared ) { <nl> + unsigned Deoptimizer : : ComputeIncomingArgumentSize ( SharedFunctionInfo shared ) { <nl> int parameter_slots = shared - > internal_formal_parameter_count ( ) + 1 ; <nl> if ( kPadArguments ) parameter_slots = RoundUp ( parameter_slots , 2 ) ; <nl> return parameter_slots * kPointerSize ; <nl> Deoptimizer : : DeoptInfo Deoptimizer : : GetDeoptInfo ( Code code , Address pc ) { <nl> <nl> / / static <nl> int Deoptimizer : : ComputeSourcePositionFromBytecodeArray ( <nl> - SharedFunctionInfo * shared , BailoutId node_id ) { <nl> + SharedFunctionInfo shared , BailoutId node_id ) { <nl> DCHECK ( shared - > HasBytecodeArray ( ) ) ; <nl> return AbstractCode : : cast ( shared - > GetBytecodeArray ( ) ) <nl> - > SourcePosition ( node_id . ToInt ( ) ) ; <nl> void TranslatedValue : : Handlify ( ) { <nl> } <nl> <nl> TranslatedFrame TranslatedFrame : : InterpretedFrame ( <nl> - BailoutId bytecode_offset , SharedFunctionInfo * shared_info , int height , <nl> + BailoutId bytecode_offset , SharedFunctionInfo shared_info , int height , <nl> int return_value_offset , int return_value_count ) { <nl> TranslatedFrame frame ( kInterpretedFunction , shared_info , height , <nl> return_value_offset , return_value_count ) ; <nl> TranslatedFrame TranslatedFrame : : InterpretedFrame ( <nl> return frame ; <nl> } <nl> <nl> - <nl> TranslatedFrame TranslatedFrame : : ArgumentsAdaptorFrame ( <nl> - SharedFunctionInfo * shared_info , int height ) { <nl> + SharedFunctionInfo shared_info , int height ) { <nl> return TranslatedFrame ( kArgumentsAdaptor , shared_info , height ) ; <nl> } <nl> <nl> TranslatedFrame TranslatedFrame : : ConstructStubFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) { <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) { <nl> TranslatedFrame frame ( kConstructStub , shared_info , height ) ; <nl> frame . node_id_ = bailout_id ; <nl> return frame ; <nl> } <nl> <nl> TranslatedFrame TranslatedFrame : : BuiltinContinuationFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) { <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) { <nl> TranslatedFrame frame ( kBuiltinContinuation , shared_info , height ) ; <nl> frame . node_id_ = bailout_id ; <nl> return frame ; <nl> } <nl> <nl> TranslatedFrame TranslatedFrame : : JavaScriptBuiltinContinuationFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) { <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) { <nl> TranslatedFrame frame ( kJavaScriptBuiltinContinuation , shared_info , height ) ; <nl> frame . node_id_ = bailout_id ; <nl> return frame ; <nl> } <nl> <nl> TranslatedFrame TranslatedFrame : : JavaScriptBuiltinContinuationWithCatchFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) { <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) { <nl> TranslatedFrame frame ( kJavaScriptBuiltinContinuationWithCatch , shared_info , <nl> height ) ; <nl> frame . node_id_ = bailout_id ; <nl> int TranslatedFrame : : GetValueCount ( ) { <nl> <nl> <nl> void TranslatedFrame : : Handlify ( ) { <nl> - if ( raw_shared_info_ ! = nullptr ) { <nl> + if ( ! raw_shared_info_ . is_null ( ) ) { <nl> shared_info_ = Handle < SharedFunctionInfo > ( raw_shared_info_ , <nl> raw_shared_info_ - > GetIsolate ( ) ) ; <nl> - raw_shared_info_ = nullptr ; <nl> + raw_shared_info_ = SharedFunctionInfo ( ) ; <nl> } <nl> for ( auto & value : values_ ) { <nl> value . Handlify ( ) ; <nl> TranslatedFrame TranslatedState : : CreateNextTranslatedFrame ( <nl> switch ( opcode ) { <nl> case Translation : : INTERPRETED_FRAME : { <nl> BailoutId bytecode_offset = BailoutId ( iterator - > Next ( ) ) ; <nl> - SharedFunctionInfo * shared_info = <nl> + SharedFunctionInfo shared_info = <nl> SharedFunctionInfo : : cast ( literal_array - > get ( iterator - > Next ( ) ) ) ; <nl> int height = iterator - > Next ( ) ; <nl> int return_value_offset = iterator - > Next ( ) ; <nl> TranslatedFrame TranslatedState : : CreateNextTranslatedFrame ( <nl> } <nl> <nl> case Translation : : ARGUMENTS_ADAPTOR_FRAME : { <nl> - SharedFunctionInfo * shared_info = <nl> + SharedFunctionInfo shared_info = <nl> SharedFunctionInfo : : cast ( literal_array - > get ( iterator - > Next ( ) ) ) ; <nl> int height = iterator - > Next ( ) ; <nl> if ( trace_file ! = nullptr ) { <nl> TranslatedFrame TranslatedState : : CreateNextTranslatedFrame ( <nl> <nl> case Translation : : CONSTRUCT_STUB_FRAME : { <nl> BailoutId bailout_id = BailoutId ( iterator - > Next ( ) ) ; <nl> - SharedFunctionInfo * shared_info = <nl> + SharedFunctionInfo shared_info = <nl> SharedFunctionInfo : : cast ( literal_array - > get ( iterator - > Next ( ) ) ) ; <nl> int height = iterator - > Next ( ) ; <nl> if ( trace_file ! = nullptr ) { <nl> TranslatedFrame TranslatedState : : CreateNextTranslatedFrame ( <nl> <nl> case Translation : : BUILTIN_CONTINUATION_FRAME : { <nl> BailoutId bailout_id = BailoutId ( iterator - > Next ( ) ) ; <nl> - SharedFunctionInfo * shared_info = <nl> + SharedFunctionInfo shared_info = <nl> SharedFunctionInfo : : cast ( literal_array - > get ( iterator - > Next ( ) ) ) ; <nl> int height = iterator - > Next ( ) ; <nl> if ( trace_file ! = nullptr ) { <nl> TranslatedFrame TranslatedState : : CreateNextTranslatedFrame ( <nl> <nl> case Translation : : JAVA_SCRIPT_BUILTIN_CONTINUATION_FRAME : { <nl> BailoutId bailout_id = BailoutId ( iterator - > Next ( ) ) ; <nl> - SharedFunctionInfo * shared_info = <nl> + SharedFunctionInfo shared_info = <nl> SharedFunctionInfo : : cast ( literal_array - > get ( iterator - > Next ( ) ) ) ; <nl> int height = iterator - > Next ( ) ; <nl> if ( trace_file ! = nullptr ) { <nl> TranslatedFrame TranslatedState : : CreateNextTranslatedFrame ( <nl> } <nl> case Translation : : JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH_FRAME : { <nl> BailoutId bailout_id = BailoutId ( iterator - > Next ( ) ) ; <nl> - SharedFunctionInfo * shared_info = <nl> + SharedFunctionInfo shared_info = <nl> SharedFunctionInfo : : cast ( literal_array - > get ( iterator - > Next ( ) ) ) ; <nl> int height = iterator - > Next ( ) ; <nl> if ( trace_file ! = nullptr ) { <nl> mmm a / src / deoptimizer . h <nl> ppp b / src / deoptimizer . h <nl> class TranslatedFrame { <nl> int return_value_offset ( ) const { return return_value_offset_ ; } <nl> int return_value_count ( ) const { return return_value_count_ ; } <nl> <nl> - SharedFunctionInfo * raw_shared_info ( ) const { <nl> - CHECK_NOT_NULL ( raw_shared_info_ ) ; <nl> + SharedFunctionInfo raw_shared_info ( ) const { <nl> + CHECK ( ! raw_shared_info_ . is_null ( ) ) ; <nl> return raw_shared_info_ ; <nl> } <nl> <nl> class TranslatedFrame { <nl> <nl> / / Constructor static methods . <nl> static TranslatedFrame InterpretedFrame ( BailoutId bytecode_offset , <nl> - SharedFunctionInfo * shared_info , <nl> + SharedFunctionInfo shared_info , <nl> int height , int return_value_offset , <nl> int return_value_count ) ; <nl> static TranslatedFrame AccessorFrame ( Kind kind , <nl> - SharedFunctionInfo * shared_info ) ; <nl> - static TranslatedFrame ArgumentsAdaptorFrame ( SharedFunctionInfo * shared_info , <nl> + SharedFunctionInfo shared_info ) ; <nl> + static TranslatedFrame ArgumentsAdaptorFrame ( SharedFunctionInfo shared_info , <nl> int height ) ; <nl> static TranslatedFrame ConstructStubFrame ( BailoutId bailout_id , <nl> - SharedFunctionInfo * shared_info , <nl> + SharedFunctionInfo shared_info , <nl> int height ) ; <nl> static TranslatedFrame BuiltinContinuationFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) ; <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) ; <nl> static TranslatedFrame JavaScriptBuiltinContinuationFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) ; <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) ; <nl> static TranslatedFrame JavaScriptBuiltinContinuationWithCatchFrame ( <nl> - BailoutId bailout_id , SharedFunctionInfo * shared_info , int height ) ; <nl> + BailoutId bailout_id , SharedFunctionInfo shared_info , int height ) ; <nl> static TranslatedFrame InvalidFrame ( ) { <nl> - return TranslatedFrame ( kInvalid , nullptr ) ; <nl> + return TranslatedFrame ( kInvalid , SharedFunctionInfo ( ) ) ; <nl> } <nl> <nl> static void AdvanceIterator ( std : : deque < TranslatedValue > : : iterator * iter ) ; <nl> <nl> - TranslatedFrame ( Kind kind , SharedFunctionInfo * shared_info = nullptr , <nl> + TranslatedFrame ( Kind kind , <nl> + SharedFunctionInfo shared_info = SharedFunctionInfo ( ) , <nl> int height = 0 , int return_value_offset = 0 , <nl> int return_value_count = 0 ) <nl> : kind_ ( kind ) , <nl> class TranslatedFrame { <nl> <nl> Kind kind_ ; <nl> BailoutId node_id_ ; <nl> - SharedFunctionInfo * raw_shared_info_ ; <nl> + SharedFunctionInfo raw_shared_info_ ; <nl> Handle < SharedFunctionInfo > shared_info_ ; <nl> int height_ ; <nl> int return_value_offset_ ; <nl> class Deoptimizer : public Malloced { <nl> <nl> static DeoptInfo GetDeoptInfo ( Code code , Address from ) ; <nl> <nl> - static int ComputeSourcePositionFromBytecodeArray ( SharedFunctionInfo * shared , <nl> + static int ComputeSourcePositionFromBytecodeArray ( SharedFunctionInfo shared , <nl> BailoutId node_id ) ; <nl> <nl> struct JumpTableEntry : public ZoneObject { <nl> class Deoptimizer : public Malloced { <nl> <nl> unsigned ComputeInputFrameAboveFpFixedSize ( ) const ; <nl> unsigned ComputeInputFrameSize ( ) const ; <nl> - static unsigned ComputeInterpretedFixedSize ( SharedFunctionInfo * shared ) ; <nl> + static unsigned ComputeInterpretedFixedSize ( SharedFunctionInfo shared ) ; <nl> <nl> - static unsigned ComputeIncomingArgumentSize ( SharedFunctionInfo * shared ) ; <nl> + static unsigned ComputeIncomingArgumentSize ( SharedFunctionInfo shared ) ; <nl> static unsigned ComputeOutgoingArgumentSize ( Code code , unsigned bailout_id ) ; <nl> <nl> static void GenerateDeoptimizationEntries ( MacroAssembler * masm , int count , <nl> mmm a / src / feedback - vector - inl . h <nl> ppp b / src / feedback - vector - inl . h <nl> int FeedbackMetadata : : GetSlotSize ( FeedbackSlotKind kind ) { <nl> return 1 ; <nl> } <nl> <nl> - ACCESSORS ( FeedbackVector , shared_function_info , SharedFunctionInfo , <nl> - kSharedFunctionInfoOffset ) <nl> + ACCESSORS2 ( FeedbackVector , shared_function_info , SharedFunctionInfo , <nl> + kSharedFunctionInfoOffset ) <nl> WEAK_ACCESSORS ( FeedbackVector , optimized_code_weak_or_smi , kOptimizedCodeOffset ) <nl> INT32_ACCESSORS ( FeedbackVector , length , kLengthOffset ) <nl> INT32_ACCESSORS ( FeedbackVector , invocation_count , kInvocationCountOffset ) <nl> mmm a / src / feedback - vector . cc <nl> ppp b / src / feedback - vector . cc <nl> void FeedbackVector : : SetOptimizationMarker ( OptimizationMarker marker ) { <nl> } <nl> <nl> void FeedbackVector : : EvictOptimizedCodeMarkedForDeoptimization ( <nl> - SharedFunctionInfo * shared , const char * reason ) { <nl> + SharedFunctionInfo shared , const char * reason ) { <nl> MaybeObject slot = optimized_code_weak_or_smi ( ) ; <nl> if ( slot - > IsSmi ( ) ) { <nl> return ; <nl> mmm a / src / feedback - vector . h <nl> ppp b / src / feedback - vector . h <nl> class FeedbackVector : public HeapObject , public NeverReadOnlySpaceObject { <nl> <nl> / / [ shared_function_info ] : The shared function info for the function with this <nl> / / feedback vector . <nl> - DECL_ACCESSORS ( shared_function_info , SharedFunctionInfo ) <nl> + DECL_ACCESSORS2 ( shared_function_info , SharedFunctionInfo ) <nl> <nl> / / [ optimized_code_weak_or_smi ] : weak reference to optimized code or a Smi <nl> / / marker defining optimization behaviour . <nl> class FeedbackVector : public HeapObject , public NeverReadOnlySpaceObject { <nl> inline bool has_optimized_code ( ) const ; <nl> inline bool has_optimization_marker ( ) const ; <nl> void ClearOptimizedCode ( ) ; <nl> - void EvictOptimizedCodeMarkedForDeoptimization ( SharedFunctionInfo * shared , <nl> + void EvictOptimizedCodeMarkedForDeoptimization ( SharedFunctionInfo shared , <nl> const char * reason ) ; <nl> static void SetOptimizedCode ( Handle < FeedbackVector > vector , <nl> Handle < Code > code ) ; <nl> mmm a / src / frames . cc <nl> ppp b / src / frames . cc <nl> bool JavaScriptFrame : : IsConstructor ( ) const { <nl> <nl> <nl> bool JavaScriptFrame : : HasInlinedFrames ( ) const { <nl> - std : : vector < SharedFunctionInfo * > functions ; <nl> + std : : vector < SharedFunctionInfo > functions ; <nl> GetFunctions ( & functions ) ; <nl> return functions . size ( ) > 1 ; <nl> } <nl> Address JavaScriptFrame : : GetCallerStackPointer ( ) const { <nl> } <nl> <nl> void JavaScriptFrame : : GetFunctions ( <nl> - std : : vector < SharedFunctionInfo * > * functions ) const { <nl> + std : : vector < SharedFunctionInfo > * functions ) const { <nl> DCHECK ( functions - > empty ( ) ) ; <nl> functions - > push_back ( function ( ) - > shared ( ) ) ; <nl> } <nl> void JavaScriptFrame : : GetFunctions ( <nl> void JavaScriptFrame : : GetFunctions ( <nl> std : : vector < Handle < SharedFunctionInfo > > * functions ) const { <nl> DCHECK ( functions - > empty ( ) ) ; <nl> - std : : vector < SharedFunctionInfo * > raw_functions ; <nl> + std : : vector < SharedFunctionInfo > raw_functions ; <nl> GetFunctions ( & raw_functions ) ; <nl> for ( const auto & raw_function : raw_functions ) { <nl> functions - > push_back ( <nl> void JavaScriptFrame : : PrintFunctionAndOffset ( JSFunction * function , <nl> function - > PrintName ( file ) ; <nl> PrintF ( file , " + % d " , code_offset ) ; <nl> if ( print_line_number ) { <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> int source_pos = code - > SourcePosition ( code_offset ) ; <nl> Object * maybe_script = shared - > script ( ) ; <nl> if ( maybe_script - > IsScript ( ) ) { <nl> void JavaScriptFrame : : CollectFunctionAndOffsetForICStats ( JSFunction * function , <nl> int code_offset ) { <nl> auto ic_stats = ICStats : : instance ( ) ; <nl> ICInfo & ic_info = ic_stats - > Current ( ) ; <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> <nl> ic_info . function_name = ic_stats - > GetOrCacheFunctionName ( function ) ; <nl> ic_info . script_offset = code_offset ; <nl> Object * OptimizedFrame : : receiver ( ) const { <nl> } <nl> <nl> void OptimizedFrame : : GetFunctions ( <nl> - std : : vector < SharedFunctionInfo * > * functions ) const { <nl> + std : : vector < SharedFunctionInfo > * functions ) const { <nl> DCHECK ( functions - > empty ( ) ) ; <nl> DCHECK ( is_optimized ( ) ) ; <nl> <nl> void OptimizedFrame : : GetFunctions ( <nl> } <nl> } <nl> <nl> - <nl> int OptimizedFrame : : StackSlotOffsetRelativeToFp ( int slot_index ) { <nl> return StandardFrameConstants : : kCallerSPOffset - <nl> ( ( slot_index + 1 ) * kPointerSize ) ; <nl> Address WasmCompileLazyFrame : : GetCallerStackPointer ( ) const { <nl> <nl> namespace { <nl> <nl> - void PrintFunctionSource ( StringStream * accumulator , SharedFunctionInfo * shared , <nl> + void PrintFunctionSource ( StringStream * accumulator , SharedFunctionInfo shared , <nl> Code code ) { <nl> if ( FLAG_max_stack_trace_source_length ! = 0 & & ! code . is_null ( ) ) { <nl> std : : ostringstream os ; <nl> void PrintFunctionSource ( StringStream * accumulator , SharedFunctionInfo * shared , <nl> } <nl> } <nl> <nl> - <nl> } / / namespace <nl> <nl> <nl> void JavaScriptFrame : : Print ( StringStream * accumulator , <nl> / / doesn ' t contain scope info , scope_info will return 0 for the number of <nl> / / parameters , stack local variables , context local variables , stack slots , <nl> / / or context slots . <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> ScopeInfo scope_info = shared - > scope_info ( ) ; <nl> Object * script_obj = shared - > script ( ) ; <nl> if ( script_obj - > IsScript ( ) ) { <nl> mmm a / src / frames . h <nl> ppp b / src / frames . h <nl> class JavaScriptFrame : public StandardFrame { <nl> Code unchecked_code ( ) const override ; <nl> <nl> / / Return a list with { SharedFunctionInfo } objects of this frame . <nl> - virtual void GetFunctions ( std : : vector < SharedFunctionInfo * > * functions ) const ; <nl> + virtual void GetFunctions ( std : : vector < SharedFunctionInfo > * functions ) const ; <nl> <nl> void GetFunctions ( std : : vector < Handle < SharedFunctionInfo > > * functions ) const ; <nl> <nl> class OptimizedFrame : public JavaScriptFrame { <nl> / / Return a list with { SharedFunctionInfo } objects of this frame . <nl> / / The functions are ordered bottom - to - top ( i . e . functions . last ( ) <nl> / / is the top - most activation ) <nl> - void GetFunctions ( std : : vector < SharedFunctionInfo * > * functions ) const override ; <nl> + void GetFunctions ( std : : vector < SharedFunctionInfo > * functions ) const override ; <nl> <nl> void Summarize ( std : : vector < FrameSummary > * frames ) const override ; <nl> <nl> mmm a / src / gdb - jit . cc <nl> ppp b / src / gdb - jit . cc <nl> class CodeDescription { <nl> } ; <nl> # endif <nl> <nl> - CodeDescription ( const char * name , Code code , SharedFunctionInfo * shared , <nl> + CodeDescription ( const char * name , Code code , SharedFunctionInfo shared , <nl> LineInfo * lineinfo ) <nl> : name_ ( name ) , code_ ( code ) , shared_info_ ( shared ) , lineinfo_ ( lineinfo ) { } <nl> <nl> class CodeDescription { <nl> return kind = = Code : : OPTIMIZED_FUNCTION ; <nl> } <nl> <nl> - bool has_scope_info ( ) const { return shared_info_ ! = nullptr ; } <nl> + bool has_scope_info ( ) const { return ! shared_info_ . is_null ( ) ; } <nl> <nl> ScopeInfo scope_info ( ) const { <nl> DCHECK ( has_scope_info ( ) ) ; <nl> class CodeDescription { <nl> } <nl> <nl> bool has_script ( ) { <nl> - return shared_info_ ! = nullptr & & shared_info_ - > script ( ) - > IsScript ( ) ; <nl> + return ! shared_info_ . is_null ( ) & & shared_info_ - > script ( ) - > IsScript ( ) ; <nl> } <nl> <nl> Script * script ( ) { return Script : : cast ( shared_info_ - > script ( ) ) ; } <nl> class CodeDescription { <nl> # endif <nl> <nl> std : : unique_ptr < char [ ] > GetFilename ( ) { <nl> - if ( shared_info_ ! = nullptr ) { <nl> + if ( ! shared_info_ . is_null ( ) ) { <nl> return String : : cast ( script ( ) - > name ( ) ) - > ToCString ( ) ; <nl> } else { <nl> std : : unique_ptr < char [ ] > result ( new char [ 1 ] ) ; <nl> class CodeDescription { <nl> } <nl> <nl> int GetScriptLineNumber ( int pos ) { <nl> - if ( shared_info_ ! = nullptr ) { <nl> + if ( ! shared_info_ . is_null ( ) ) { <nl> return script ( ) - > GetLineNumber ( pos ) + 1 ; <nl> } else { <nl> return 0 ; <nl> class CodeDescription { <nl> private : <nl> const char * name_ ; <nl> Code code_ ; <nl> - SharedFunctionInfo * shared_info_ ; <nl> + SharedFunctionInfo shared_info_ ; <nl> LineInfo * lineinfo_ ; <nl> # if V8_TARGET_ARCH_X64 <nl> uintptr_t stack_state_start_addresses_ [ STACK_STATE_MAX ] ; <nl> static void AddJITCodeEntry ( CodeMap * map , const AddressRange & range , <nl> RegisterCodeEntry ( entry ) ; <nl> } <nl> <nl> - static void AddCode ( const char * name , Code code , SharedFunctionInfo * shared , <nl> + static void AddCode ( const char * name , Code code , SharedFunctionInfo shared , <nl> LineInfo * lineinfo ) { <nl> DisallowHeapAllocation no_gc ; <nl> <nl> static void AddCode ( const char * name , Code code , SharedFunctionInfo * shared , <nl> AddJITCodeEntry ( code_map , range , entry , should_dump , name_hint ) ; <nl> } <nl> <nl> - <nl> void EventHandler ( const v8 : : JitCodeEvent * event ) { <nl> if ( ! FLAG_gdbjit ) return ; <nl> if ( event - > code_type ! = v8 : : JitCodeEvent : : JIT_CODE ) return ; <nl> void EventHandler ( const v8 : : JitCodeEvent * event ) { <nl> StringBuilder builder ( buffer . start ( ) , buffer . length ( ) ) ; <nl> builder . AddSubstring ( event - > name . str , static_cast < int > ( event - > name . len ) ) ; <nl> / / It ' s called UnboundScript in the API but it ' s a SharedFunctionInfo . <nl> - SharedFunctionInfo * shared = event - > script . IsEmpty ( ) <nl> - ? nullptr <nl> - : * Utils : : OpenHandle ( * event - > script ) ; <nl> + SharedFunctionInfo shared = event - > script . IsEmpty ( ) <nl> + ? SharedFunctionInfo ( ) <nl> + : * Utils : : OpenHandle ( * event - > script ) ; <nl> AddCode ( builder . Finalize ( ) , code , shared , lineinfo ) ; <nl> break ; <nl> } <nl> mmm a / src / handles . h <nl> ppp b / src / handles . h <nl> class Handle final : public HandleBase { <nl> std : : is_same < S , OrderedNameDictionary > : : value | | <nl> std : : is_same < S , ScriptContextTable > : : value | | <nl> std : : is_same < S , ScopeInfo > : : value | | <nl> + std : : is_same < S , SharedFunctionInfo > : : value | | <nl> std : : is_same < S , SmallOrderedHashMap > : : value | | <nl> std : : is_same < S , SmallOrderedHashSet > : : value | | <nl> std : : is_same < S , SmallOrderedNameDictionary > : : value | | <nl> mmm a / src / heap / object - stats . cc <nl> ppp b / src / heap / object - stats . cc <nl> class ObjectStatsCollectorImpl { <nl> void RecordVirtualMapDetails ( Map map ) ; <nl> void RecordVirtualScriptDetails ( Script * script ) ; <nl> void RecordVirtualExternalStringDetails ( ExternalString script ) ; <nl> - void RecordVirtualSharedFunctionInfoDetails ( SharedFunctionInfo * info ) ; <nl> + void RecordVirtualSharedFunctionInfoDetails ( SharedFunctionInfo info ) ; <nl> void RecordVirtualJSFunctionDetails ( JSFunction * function ) ; <nl> <nl> void RecordVirtualArrayBoilerplateDescription ( <nl> void ObjectStatsCollectorImpl : : RecordVirtualExternalStringDetails ( <nl> } <nl> <nl> void ObjectStatsCollectorImpl : : RecordVirtualSharedFunctionInfoDetails ( <nl> - SharedFunctionInfo * info ) { <nl> + SharedFunctionInfo info ) { <nl> / / Uncompiled SharedFunctionInfo gets its own category . <nl> if ( ! info - > is_compiled ( ) ) { <nl> RecordSimpleVirtualObjectStats ( <nl> mmm a / src / heap / objects - visiting - inl . h <nl> ppp b / src / heap / objects - visiting - inl . h <nl> int NewSpaceVisitor < ConcreteVisitor > : : VisitJSApiObject ( Map map , <nl> return visitor - > VisitJSObject ( map , object ) ; <nl> } <nl> <nl> + template < typename ConcreteVisitor > <nl> + int NewSpaceVisitor < ConcreteVisitor > : : VisitSharedFunctionInfo ( <nl> + Map map , SharedFunctionInfo object ) { <nl> + UNREACHABLE ( ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> template < typename ResultType , typename ConcreteVisitor > <nl> ResultType HeapVisitor < ResultType , ConcreteVisitor > : : VisitWeakArray ( <nl> Map map , HeapObject * object ) { <nl> mmm a / src / heap / objects - visiting . h <nl> ppp b / src / heap / objects - visiting . h <nl> class WasmInstanceObject ; <nl> V ( PrototypeInfo , PrototypeInfo * ) \ <nl> V ( SeqOneByteString , SeqOneByteString ) \ <nl> V ( SeqTwoByteString , SeqTwoByteString ) \ <nl> - V ( SharedFunctionInfo , SharedFunctionInfo * ) \ <nl> + V ( SharedFunctionInfo , SharedFunctionInfo ) \ <nl> V ( SlicedString , SlicedString ) \ <nl> V ( SmallOrderedHashMap , SmallOrderedHashMap ) \ <nl> V ( SmallOrderedHashSet , SmallOrderedHashSet ) \ <nl> class NewSpaceVisitor : public HeapVisitor < int , ConcreteVisitor > { <nl> return 0 ; <nl> } <nl> <nl> - int VisitSharedFunctionInfo ( Map map , SharedFunctionInfo * object ) { <nl> - UNREACHABLE ( ) ; <nl> - return 0 ; <nl> - } <nl> + int VisitSharedFunctionInfo ( Map map , SharedFunctionInfo object ) ; <nl> <nl> int VisitJSWeakCell ( Map map , JSWeakCell * js_weak_cell ) { <nl> UNREACHABLE ( ) ; <nl> mmm a / src / ic / ic - stats . cc <nl> ppp b / src / ic / ic - stats . cc <nl> const char * ICStats : : GetOrCacheFunctionName ( JSFunction * function ) { <nl> if ( function_name_map_ . find ( function ) ! = function_name_map_ . end ( ) ) { <nl> return function_name_map_ [ function ] . get ( ) ; <nl> } <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> ic_infos_ [ pos_ ] . is_optimized = function - > IsOptimized ( ) ; <nl> char * function_name = shared - > DebugName ( ) - > ToCString ( ) . release ( ) ; <nl> function_name_map_ . insert ( <nl> mmm a / src / isolate . cc <nl> ppp b / src / isolate . cc <nl> void Isolate : : MaybeInitializeVectorListFromHeap ( ) { <nl> if ( ! current_obj - > IsFeedbackVector ( ) ) continue ; <nl> <nl> FeedbackVector * vector = FeedbackVector : : cast ( current_obj ) ; <nl> - SharedFunctionInfo * shared = vector - > shared_function_info ( ) ; <nl> + SharedFunctionInfo shared = vector - > shared_function_info ( ) ; <nl> <nl> / / No need to preserve the feedback vector for non - user - visible functions . <nl> if ( ! shared - > IsSubjectToDebugging ( ) ) continue ; <nl> mmm a / src / log . cc <nl> ppp b / src / log . cc <nl> static v8 : : CodeEventType GetCodeEventTypeForTag ( <nl> PROFILE ( isolate_ , Call ) ; \ <nl> } <nl> <nl> - static const char * ComputeMarker ( SharedFunctionInfo * shared , <nl> - AbstractCode code ) { <nl> + static const char * ComputeMarker ( SharedFunctionInfo shared , AbstractCode code ) { <nl> switch ( code - > kind ( ) ) { <nl> case AbstractCode : : INTERPRETED_FUNCTION : <nl> return shared - > optimization_disabled ( ) ? " " : " ~ " ; <nl> void CodeEventLogger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , const char * comment ) { <nl> name_buffer_ - > Init ( tag ) ; <nl> name_buffer_ - > AppendBytes ( comment ) ; <nl> - LogRecordedBuffer ( code , nullptr , name_buffer_ - > get ( ) , name_buffer_ - > size ( ) ) ; <nl> + LogRecordedBuffer ( code , SharedFunctionInfo ( ) , name_buffer_ - > get ( ) , <nl> + name_buffer_ - > size ( ) ) ; <nl> } <nl> <nl> void CodeEventLogger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , Name name ) { <nl> name_buffer_ - > Init ( tag ) ; <nl> name_buffer_ - > AppendName ( name ) ; <nl> - LogRecordedBuffer ( code , nullptr , name_buffer_ - > get ( ) , name_buffer_ - > size ( ) ) ; <nl> + LogRecordedBuffer ( code , SharedFunctionInfo ( ) , name_buffer_ - > get ( ) , <nl> + name_buffer_ - > size ( ) ) ; <nl> } <nl> <nl> void CodeEventLogger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , <nl> - SharedFunctionInfo * shared , Name name ) { <nl> + SharedFunctionInfo shared , Name name ) { <nl> name_buffer_ - > Init ( tag ) ; <nl> name_buffer_ - > AppendBytes ( ComputeMarker ( shared , code ) ) ; <nl> name_buffer_ - > AppendName ( name ) ; <nl> void CodeEventLogger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> <nl> void CodeEventLogger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source , <nl> + SharedFunctionInfo shared , Name source , <nl> int line , int column ) { <nl> name_buffer_ - > Init ( tag ) ; <nl> name_buffer_ - > AppendBytes ( ComputeMarker ( shared , code ) ) ; <nl> void CodeEventLogger : : CodeCreateEvent ( LogEventsAndTags tag , <nl> void CodeEventLogger : : RegExpCodeCreateEvent ( AbstractCode code , String source ) { <nl> name_buffer_ - > Init ( CodeEventListener : : REG_EXP_TAG ) ; <nl> name_buffer_ - > AppendString ( source ) ; <nl> - LogRecordedBuffer ( code , nullptr , name_buffer_ - > get ( ) , name_buffer_ - > size ( ) ) ; <nl> + LogRecordedBuffer ( code , SharedFunctionInfo ( ) , name_buffer_ - > get ( ) , <nl> + name_buffer_ - > size ( ) ) ; <nl> } <nl> <nl> / / Linux perf tool logging support <nl> class PerfBasicLogger : public CodeEventLogger { <nl> <nl> void CodeMoveEvent ( AbstractCode from , AbstractCode to ) override { } <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { } <nl> + SharedFunctionInfo shared ) override { } <nl> <nl> private : <nl> - void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) override ; <nl> void LogRecordedBuffer ( const wasm : : WasmCode * code , const char * name , <nl> int length ) override ; <nl> void PerfBasicLogger : : WriteLogRecordedBuffer ( uintptr_t address , int size , <nl> size , name_length , name ) ; <nl> } <nl> <nl> - void PerfBasicLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * , <nl> + void PerfBasicLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo , <nl> const char * name , int length ) { <nl> if ( FLAG_perf_basic_prof_only_functions & & <nl> ( code - > kind ( ) ! = AbstractCode : : INTERPRETED_FUNCTION & & <nl> void ExternalCodeEventListener : : CodeCreateEvent ( <nl> <nl> void ExternalCodeEventListener : : CodeCreateEvent ( <nl> CodeEventListener : : LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name name ) { <nl> + SharedFunctionInfo shared , Name name ) { <nl> Handle < String > name_string = <nl> Name : : ToFunctionName ( isolate_ , Handle < Name > ( name , isolate_ ) ) <nl> . ToHandleChecked ( ) ; <nl> void ExternalCodeEventListener : : CodeCreateEvent ( <nl> <nl> void ExternalCodeEventListener : : CodeCreateEvent ( <nl> CodeEventListener : : LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source , int line , int column ) { <nl> + SharedFunctionInfo shared , Name source , int line , int column ) { <nl> Handle < String > name_string = <nl> Name : : ToFunctionName ( isolate_ , Handle < Name > ( shared - > Name ( ) , isolate_ ) ) <nl> . ToHandleChecked ( ) ; <nl> class LowLevelLogger : public CodeEventLogger { <nl> <nl> void CodeMoveEvent ( AbstractCode from , AbstractCode to ) override ; <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { } <nl> + SharedFunctionInfo shared ) override { } <nl> void SnapshotPositionEvent ( HeapObject * obj , int pos ) ; <nl> void CodeMovingGCEvent ( ) override ; <nl> <nl> private : <nl> - void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) override ; <nl> void LogRecordedBuffer ( const wasm : : WasmCode * code , const char * name , <nl> int length ) override ; <nl> void LowLevelLogger : : LogCodeInfo ( ) { <nl> LogWriteBytes ( arch , sizeof ( arch ) ) ; <nl> } <nl> <nl> - void LowLevelLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * , <nl> + void LowLevelLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo , <nl> const char * name , int length ) { <nl> CodeCreateStruct event ; <nl> event . name_size = length ; <nl> class JitLogger : public CodeEventLogger { <nl> <nl> void CodeMoveEvent ( AbstractCode from , AbstractCode to ) override ; <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { } <nl> + SharedFunctionInfo shared ) override { } <nl> void AddCodeLinePosInfoEvent ( void * jit_handler_data , int pc_offset , <nl> int position , <nl> JitCodeEvent : : PositionType position_type ) ; <nl> class JitLogger : public CodeEventLogger { <nl> void EndCodePosInfoEvent ( Address start_address , void * jit_handler_data ) ; <nl> <nl> private : <nl> - void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) override ; <nl> void LogRecordedBuffer ( const wasm : : WasmCode * code , const char * name , <nl> int length ) override ; <nl> class JitLogger : public CodeEventLogger { <nl> JitLogger : : JitLogger ( Isolate * isolate , JitCodeEventHandler code_event_handler ) <nl> : CodeEventLogger ( isolate ) , code_event_handler_ ( code_event_handler ) { } <nl> <nl> - void JitLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + void JitLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) { <nl> JitCodeEvent event ; <nl> memset ( static_cast < void * > ( & event ) , 0 , sizeof ( event ) ) ; <nl> void JitLogger : : LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> code - > IsCode ( ) ? JitCodeEvent : : JIT_CODE : JitCodeEvent : : BYTE_CODE ; <nl> event . code_len = code - > InstructionSize ( ) ; <nl> Handle < SharedFunctionInfo > shared_function_handle ; <nl> - if ( shared & & shared - > script ( ) - > IsScript ( ) ) { <nl> + if ( ! shared . is_null ( ) & & shared - > script ( ) - > IsScript ( ) ) { <nl> shared_function_handle = <nl> Handle < SharedFunctionInfo > ( shared , shared - > GetIsolate ( ) ) ; <nl> } <nl> void Logger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> } <nl> <nl> void Logger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> - AbstractCode code , SharedFunctionInfo * shared , <nl> + AbstractCode code , SharedFunctionInfo shared , <nl> Name name ) { <nl> if ( ! is_listening_to_code_events ( ) ) return ; <nl> if ( ! FLAG_log_code | | ! log_ - > IsEnabled ( ) ) return ; <nl> void Logger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> / / the SharedFunctionInfo object , we left it to caller <nl> / / to leave logging functions free from heap allocations . <nl> void Logger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> - AbstractCode code , SharedFunctionInfo * shared , <nl> + AbstractCode code , SharedFunctionInfo shared , <nl> Name source , int line , int column ) { <nl> if ( ! is_listening_to_code_events ( ) ) return ; <nl> if ( ! FLAG_log_code | | ! log_ - > IsEnabled ( ) ) return ; <nl> void Logger : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> msg . WriteToLogFile ( ) ; <nl> } <nl> <nl> - void Logger : : CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) { <nl> + void Logger : : CodeDisableOptEvent ( AbstractCode code , SharedFunctionInfo shared ) { <nl> if ( ! is_listening_to_code_events ( ) ) return ; <nl> if ( ! FLAG_log_code | | ! log_ - > IsEnabled ( ) ) return ; <nl> Log : : MessageBuilder msg ( log_ ) ; <nl> void Logger : : FunctionEvent ( const char * reason , int script_id , double time_delta , <nl> } <nl> <nl> void Logger : : CompilationCacheEvent ( const char * action , const char * cache_type , <nl> - SharedFunctionInfo * sfi ) { <nl> + SharedFunctionInfo sfi ) { <nl> if ( ! log_ - > IsEnabled ( ) | | ! FLAG_log_function_events ) return ; <nl> Log : : MessageBuilder msg ( log_ ) ; <nl> int script_id = - 1 ; <nl> void Logger : : MapEvent ( const char * type , Map from , Map to , const char * reason , <nl> if ( name_or_sfi - > IsName ( ) ) { <nl> msg < < Name : : cast ( name_or_sfi ) ; <nl> } else if ( name_or_sfi - > IsSharedFunctionInfo ( ) ) { <nl> - SharedFunctionInfo * sfi = SharedFunctionInfo : : cast ( name_or_sfi ) ; <nl> + SharedFunctionInfo sfi = SharedFunctionInfo : : cast ( name_or_sfi ) ; <nl> msg < < sfi - > DebugName ( ) ; <nl> # if V8_SFI_HAS_UNIQUE_ID <nl> msg < < " " < < sfi - > unique_id ( ) ; <nl> void Logger : : LogFailure ( ) { <nl> StopProfiler ( ) ; <nl> } <nl> <nl> - static void AddFunctionAndCode ( SharedFunctionInfo * sfi , <nl> - AbstractCode code_object , <nl> + static void AddFunctionAndCode ( SharedFunctionInfo sfi , AbstractCode code_object , <nl> Handle < SharedFunctionInfo > * sfis , <nl> Handle < AbstractCode > * code_objects , int offset ) { <nl> if ( sfis ! = nullptr ) { <nl> static int EnumerateCompiledFunctions ( Heap * heap , <nl> for ( HeapObject * obj = iterator . next ( ) ; obj ! = nullptr ; <nl> obj = iterator . next ( ) ) { <nl> if ( obj - > IsSharedFunctionInfo ( ) ) { <nl> - SharedFunctionInfo * sfi = SharedFunctionInfo : : cast ( obj ) ; <nl> + SharedFunctionInfo sfi = SharedFunctionInfo : : cast ( obj ) ; <nl> if ( sfi - > is_compiled ( ) & & <nl> ( ! sfi - > script ( ) - > IsScript ( ) | | <nl> Script : : cast ( sfi - > script ( ) ) - > HasValidSource ( ) ) ) { <nl> static int EnumerateCompiledFunctions ( Heap * heap , <nl> / / Given that we no longer iterate over all optimized JSFunctions , we need <nl> / / to take care of this here . <nl> JSFunction * function = JSFunction : : cast ( obj ) ; <nl> - SharedFunctionInfo * sfi = SharedFunctionInfo : : cast ( function - > shared ( ) ) ; <nl> + SharedFunctionInfo sfi = SharedFunctionInfo : : cast ( function - > shared ( ) ) ; <nl> Object * maybe_script = sfi - > script ( ) ; <nl> if ( maybe_script - > IsScript ( ) & & <nl> ! Script : : cast ( maybe_script ) - > HasValidSource ( ) ) { <nl> mmm a / src / log . h <nl> ppp b / src / log . h <nl> class Logger : public CodeEventListener { <nl> size_t function_name_length = 0 ) ; <nl> <nl> void CompilationCacheEvent ( const char * action , const char * cache_type , <nl> - SharedFunctionInfo * sfi ) ; <nl> + SharedFunctionInfo sfi ) ; <nl> void ScriptEvent ( ScriptEventType type , int script_id ) ; <nl> void ScriptDetails ( Script * script ) ; <nl> <nl> class Logger : public CodeEventListener { <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , Name name ) override ; <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> - AbstractCode code , SharedFunctionInfo * shared , <nl> + AbstractCode code , SharedFunctionInfo shared , <nl> Name name ) override ; <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> - AbstractCode code , SharedFunctionInfo * shared , <nl> + AbstractCode code , SharedFunctionInfo shared , <nl> Name source , int line , int column ) override ; <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> const wasm : : WasmCode * code , <nl> wasm : : WasmName name ) override ; <nl> / / Emits a code deoptimization event . <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override ; <nl> + SharedFunctionInfo shared ) override ; <nl> void CodeMovingGCEvent ( ) override ; <nl> / / Emits a code create event for a RegExp . <nl> void RegExpCodeCreateEvent ( AbstractCode code , String source ) override ; <nl> class CodeEventLogger : public CodeEventListener { <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> Name name ) override ; <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name name ) override ; <nl> + SharedFunctionInfo shared , Name name ) override ; <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source , int line , <nl> + SharedFunctionInfo shared , Name source , int line , <nl> int column ) override ; <nl> void CodeCreateEvent ( LogEventsAndTags tag , const wasm : : WasmCode * code , <nl> wasm : : WasmName name ) override ; <nl> class CodeEventLogger : public CodeEventListener { <nl> private : <nl> class NameBuffer ; <nl> <nl> - virtual void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + virtual void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) = 0 ; <nl> virtual void LogRecordedBuffer ( const wasm : : WasmCode * code , const char * name , <nl> int length ) = 0 ; <nl> class ExternalCodeEventListener : public CodeEventListener { <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> Name name ) override ; <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name name ) override ; <nl> + SharedFunctionInfo shared , Name name ) override ; <nl> void CodeCreateEvent ( LogEventsAndTags tag , AbstractCode code , <nl> - SharedFunctionInfo * shared , Name source , int line , <nl> + SharedFunctionInfo shared , Name source , int line , <nl> int column ) override ; <nl> void CodeCreateEvent ( LogEventsAndTags tag , const wasm : : WasmCode * code , <nl> wasm : : WasmName name ) override ; <nl> class ExternalCodeEventListener : public CodeEventListener { <nl> void SharedFunctionInfoMoveEvent ( Address from , Address to ) override { } <nl> void CodeMoveEvent ( AbstractCode from , AbstractCode to ) override { } <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { } <nl> + SharedFunctionInfo shared ) override { } <nl> void CodeMovingGCEvent ( ) override { } <nl> void CodeDeoptEvent ( Code code , DeoptimizeKind kind , Address pc , <nl> int fp_to_sp_delta ) override { } <nl> mmm a / src / objects - inl . h <nl> ppp b / src / objects - inl . h <nl> void HeapObject : : VerifySmiField ( int offset ) { <nl> CHECK ( READ_FIELD ( this , offset ) - > IsSmi ( ) ) ; <nl> } <nl> <nl> - void HeapObjectPtr : : VerifyObjectField ( Isolate * isolate , int offset ) { <nl> - Object : : VerifyPointer ( isolate , READ_FIELD ( this , offset ) ) ; <nl> - } <nl> - <nl> - void HeapObjectPtr : : VerifyMaybeObjectField ( Isolate * isolate , int offset ) { <nl> - MaybeObject : : VerifyMaybeObjectPointer ( isolate , READ_WEAK_FIELD ( this , offset ) ) ; <nl> - } <nl> - <nl> - void HeapObjectPtr : : VerifySmiField ( int offset ) { <nl> - CHECK ( READ_FIELD ( this , offset ) - > IsSmi ( ) ) ; <nl> - } <nl> - <nl> # endif <nl> <nl> ReadOnlyRoots HeapObject : : GetReadOnlyRoots ( ) const { <nl> mmm a / src / objects - printer . cc <nl> ppp b / src / objects - printer . cc <nl> void JSGeneratorObject : : JSGeneratorObjectPrint ( std : : ostream & os ) { / / NOLINT <nl> if ( is_suspended ( ) ) os < < " ( suspended ) " ; <nl> if ( is_suspended ( ) ) { <nl> DisallowHeapAllocation no_gc ; <nl> - SharedFunctionInfo * fun_info = function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo fun_info = function ( ) - > shared ( ) ; <nl> if ( fun_info - > HasSourceCode ( ) ) { <nl> Script * script = Script : : cast ( fun_info - > script ( ) ) ; <nl> int lin = script - > GetLineNumber ( source_position ( ) ) + 1 ; <nl> void SharedFunctionInfo : : PrintSourceCode ( std : : ostream & os ) { <nl> } <nl> <nl> void SharedFunctionInfo : : SharedFunctionInfoPrint ( std : : ostream & os ) { / / NOLINT <nl> - HeapObject : : PrintHeader ( os , " SharedFunctionInfo " ) ; <nl> + PrintHeader ( os , " SharedFunctionInfo " ) ; <nl> os < < " \ n - name : " ; <nl> if ( HasSharedName ( ) ) { <nl> os < < Brief ( Name ( ) ) ; <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> void JSObject : : JSObjectShortPrint ( StringStream * accumulator ) { <nl> } <nl> } <nl> accumulator - > Add ( " ( sfi = % p ) " , <nl> - reinterpret_cast < void * > ( function - > shared ( ) ) ) ; <nl> + reinterpret_cast < void * > ( function - > shared ( ) . ptr ( ) ) ) ; <nl> accumulator - > Put ( ' > ' ) ; <nl> break ; <nl> } <nl> void HeapObject : : HeapObjectShortPrint ( std : : ostream & os ) { / / NOLINT <nl> } <nl> <nl> case SHARED_FUNCTION_INFO_TYPE : { <nl> - SharedFunctionInfo * shared = SharedFunctionInfo : : cast ( this ) ; <nl> + SharedFunctionInfo shared = SharedFunctionInfo : : cast ( this ) ; <nl> std : : unique_ptr < char [ ] > debug_name = shared - > DebugName ( ) - > ToCString ( ) ; <nl> if ( debug_name [ 0 ] ! = 0 ) { <nl> os < < " < SharedFunctionInfo " < < debug_name . get ( ) < < " > " ; <nl> Handle < DeoptimizationData > DeoptimizationData : : Empty ( Isolate * isolate ) { <nl> isolate - > factory ( ) - > empty_fixed_array ( ) ) ; <nl> } <nl> <nl> - SharedFunctionInfo * DeoptimizationData : : GetInlinedFunction ( int index ) { <nl> + SharedFunctionInfo DeoptimizationData : : GetInlinedFunction ( int index ) { <nl> if ( index = = - 1 ) { <nl> return SharedFunctionInfo : : cast ( SharedFunctionInfo ( ) ) ; <nl> } else { <nl> int Script : : GetEvalPosition ( ) { <nl> if ( ! has_eval_from_shared ( ) ) { <nl> position = 0 ; <nl> } else { <nl> - SharedFunctionInfo * shared = eval_from_shared ( ) ; <nl> + SharedFunctionInfo shared = eval_from_shared ( ) ; <nl> position = shared - > abstract_code ( ) - > SourcePosition ( - position ) ; <nl> } <nl> DCHECK_GE ( position , 0 ) ; <nl> bool Script : : IsUserJavaScript ( ) { return type ( ) = = Script : : TYPE_NORMAL ; } <nl> bool Script : : ContainsAsmModule ( ) { <nl> DisallowHeapAllocation no_gc ; <nl> SharedFunctionInfo : : ScriptIterator iter ( this - > GetIsolate ( ) , this ) ; <nl> - while ( SharedFunctionInfo * info = iter . Next ( ) ) { <nl> + for ( SharedFunctionInfo info = iter . Next ( ) ; ! info . is_null ( ) ; <nl> + info = iter . Next ( ) ) { <nl> if ( info - > HasAsmWasmData ( ) ) return true ; <nl> } <nl> return false ; <nl> SharedFunctionInfo : : ScriptIterator : : ScriptIterator ( <nl> shared_function_infos_ ( shared_function_infos ) , <nl> index_ ( 0 ) { } <nl> <nl> - SharedFunctionInfo * SharedFunctionInfo : : ScriptIterator : : Next ( ) { <nl> + SharedFunctionInfo SharedFunctionInfo : : ScriptIterator : : Next ( ) { <nl> while ( index_ < shared_function_infos_ - > length ( ) ) { <nl> MaybeObject raw = shared_function_infos_ - > Get ( index_ + + ) ; <nl> HeapObject * heap_object ; <nl> SharedFunctionInfo * SharedFunctionInfo : : ScriptIterator : : Next ( ) { <nl> } <nl> return SharedFunctionInfo : : cast ( heap_object ) ; <nl> } <nl> - return nullptr ; <nl> + return SharedFunctionInfo ( ) ; <nl> } <nl> <nl> void SharedFunctionInfo : : ScriptIterator : : Reset ( Script * script ) { <nl> SharedFunctionInfo : : GlobalIterator : : GlobalIterator ( Isolate * isolate ) <nl> noscript_sfi_iterator_ ( isolate - > heap ( ) - > noscript_shared_function_infos ( ) ) , <nl> sfi_iterator_ ( isolate , script_iterator_ . Next ( ) ) { } <nl> <nl> - SharedFunctionInfo * SharedFunctionInfo : : GlobalIterator : : Next ( ) { <nl> + SharedFunctionInfo SharedFunctionInfo : : GlobalIterator : : Next ( ) { <nl> HeapObject * next = noscript_sfi_iterator_ . Next ( ) ; <nl> if ( next ! = nullptr ) return SharedFunctionInfo : : cast ( next ) ; <nl> for ( ; ; ) { <nl> next = sfi_iterator_ . Next ( ) ; <nl> if ( next ! = nullptr ) return SharedFunctionInfo : : cast ( next ) ; <nl> Script * next_script = script_iterator_ . Next ( ) ; <nl> - if ( next_script = = nullptr ) return nullptr ; <nl> + if ( next_script = = nullptr ) return SharedFunctionInfo ( ) ; <nl> sfi_iterator_ . Reset ( next_script ) ; <nl> } <nl> } <nl> int SharedFunctionInfo : : FindIndexInScript ( Isolate * isolate ) const { <nl> SharedFunctionInfo : : ScriptIterator iterator ( <nl> isolate , Handle < WeakFixedArray > ( & shared_info_list ) ) ; <nl> <nl> - for ( SharedFunctionInfo * shared = iterator . Next ( ) ; shared ! = nullptr ; <nl> + for ( SharedFunctionInfo shared = iterator . Next ( ) ; ! shared . is_null ( ) ; <nl> shared = iterator . Next ( ) ) { <nl> - if ( shared = = this ) { <nl> + if ( shared = = * this ) { <nl> return iterator . CurrentIndex ( ) ; <nl> } <nl> } <nl> bool JSFunction : : CalculateInstanceSizeForDerivedClass ( <nl> <nl> / / Output the source code without any allocation in the heap . <nl> std : : ostream & operator < < ( std : : ostream & os , const SourceCodeOf & v ) { <nl> - const SharedFunctionInfo * s = v . value ; <nl> + const SharedFunctionInfo s = v . value ; <nl> / / For some native functions there is no source . <nl> if ( ! s - > HasSourceCode ( ) ) return os < < " < No Source > " ; <nl> <nl> void SharedFunctionInfo : : DisableOptimization ( BailoutReason reason ) { <nl> / / Code should be the lazy compilation stub or else interpreted . <nl> DCHECK ( abstract_code ( ) - > kind ( ) = = AbstractCode : : INTERPRETED_FUNCTION | | <nl> abstract_code ( ) - > kind ( ) = = AbstractCode : : BUILTIN ) ; <nl> - PROFILE ( GetIsolate ( ) , CodeDisableOptEvent ( abstract_code ( ) , this ) ) ; <nl> + PROFILE ( GetIsolate ( ) , CodeDisableOptEvent ( abstract_code ( ) , * this ) ) ; <nl> if ( FLAG_trace_opt ) { <nl> PrintF ( " [ disabled optimization for " ) ; <nl> ShortPrint ( ) ; <nl> bool Code : : IsIsolateIndependent ( Isolate * isolate ) { <nl> return is_process_independent ; <nl> } <nl> <nl> - bool Code : : Inlines ( SharedFunctionInfo * sfi ) { <nl> + bool Code : : Inlines ( SharedFunctionInfo sfi ) { <nl> / / We can only check for inlining for optimized code . <nl> DCHECK ( is_optimized_code ( ) ) ; <nl> DisallowHeapAllocation no_gc ; <nl> class StringSharedKey : public HashTableKey { <nl> return Hash ( ) = = other_hash ; <nl> } <nl> FixedArray other_array = FixedArray : : cast ( other ) ; <nl> - SharedFunctionInfo * shared = SharedFunctionInfo : : cast ( other_array - > get ( 0 ) ) ; <nl> + SharedFunctionInfo shared = SharedFunctionInfo : : cast ( other_array - > get ( 0 ) ) ; <nl> if ( shared ! = * shared_ ) return false ; <nl> int language_unchecked = Smi : : ToInt ( other_array - > get ( 2 ) ) ; <nl> DCHECK ( is_valid_language_mode ( language_unchecked ) ) ; <nl> void CompilationCacheTable : : Age ( ) { <nl> NoWriteBarrierSet ( * this , value_index , count ) ; <nl> } <nl> } else if ( get ( entry_index ) - > IsFixedArray ( ) ) { <nl> - SharedFunctionInfo * info = SharedFunctionInfo : : cast ( get ( value_index ) ) ; <nl> + SharedFunctionInfo info = SharedFunctionInfo : : cast ( get ( value_index ) ) ; <nl> if ( info - > IsInterpreted ( ) & & info - > GetBytecodeArray ( ) - > IsOld ( ) ) { <nl> for ( int i = 0 ; i < kEntrySize ; i + + ) { <nl> NoWriteBarrierSet ( * this , entry_index + i , the_hole_value ) ; <nl> mmm a / src / objects . h <nl> ppp b / src / objects . h <nl> typedef Map MapArgType ; <nl> typedef Object * ObjectArgType ; <nl> typedef RegExpMatchInfo RegExpMatchInfoArgType ; <nl> typedef ScriptContextTable ScriptContextTableArgType ; <nl> - typedef SharedFunctionInfo * SharedFunctionInfoArgType ; <nl> + typedef SharedFunctionInfo SharedFunctionInfoArgType ; <nl> typedef SimpleNumberDictionary SimpleNumberDictionaryArgType ; <nl> typedef Smi SmiArgType ; <nl> typedef String StringArgType ; <nl> mmm a / src / objects / code . h <nl> ppp b / src / objects / code . h <nl> class Code : public HeapObjectPtr { <nl> static inline bool IsWeakObjectInOptimizedCode ( HeapObject * object ) ; <nl> <nl> / / Return true if the function is inlined in the code . <nl> - bool Inlines ( SharedFunctionInfo * sfi ) ; <nl> + bool Inlines ( SharedFunctionInfo sfi ) ; <nl> <nl> class OptimizedCodeIterator ; <nl> <nl> class DeoptimizationData : public FixedArray { <nl> <nl> / / Returns the inlined function at the given position in LiteralArray , or the <nl> / / outer function if index = = kNotInlinedIndex . <nl> - class SharedFunctionInfo * GetInlinedFunction ( int index ) ; <nl> + class SharedFunctionInfo GetInlinedFunction ( int index ) ; <nl> <nl> / / Allocates a DeoptimizationData . <nl> static Handle < DeoptimizationData > New ( Isolate * isolate , int deopt_entry_count , <nl> mmm a / src / objects / compilation - cache - inl . h <nl> ppp b / src / objects / compilation - cache - inl . h <nl> uint32_t CompilationCacheShape : : RegExpHash ( String string , Smi flags ) { <nl> } <nl> <nl> uint32_t CompilationCacheShape : : StringSharedHash ( String source , <nl> - SharedFunctionInfo * shared , <nl> + SharedFunctionInfo shared , <nl> LanguageMode language_mode , <nl> int position ) { <nl> uint32_t hash = source - > Hash ( ) ; <nl> uint32_t CompilationCacheShape : : HashForObject ( Isolate * isolate , <nl> FixedArray val = FixedArray : : cast ( object ) ; <nl> if ( val - > map ( ) = = val - > GetReadOnlyRoots ( ) . fixed_cow_array_map ( ) ) { <nl> DCHECK_EQ ( 4 , val - > length ( ) ) ; <nl> - SharedFunctionInfo * shared = SharedFunctionInfo : : cast ( val - > get ( 0 ) ) ; <nl> + SharedFunctionInfo shared = SharedFunctionInfo : : cast ( val - > get ( 0 ) ) ; <nl> String source = String : : cast ( val - > get ( 1 ) ) ; <nl> int language_unchecked = Smi : : ToInt ( val - > get ( 2 ) ) ; <nl> DCHECK ( is_valid_language_mode ( language_unchecked ) ) ; <nl> mmm a / src / objects / compilation - cache . h <nl> ppp b / src / objects / compilation - cache . h <nl> <nl> <nl> # include " src / objects / hash - table . h " <nl> # include " src / objects / js - regexp . h " <nl> + # include " src / objects / shared - function - info . h " <nl> <nl> / / Has to be the last include ( doesn ' t have include guards ) : <nl> # include " src / objects / object - macros . h " <nl> class CompilationCacheShape : public BaseShape < HashTableKey * > { <nl> static inline uint32_t RegExpHash ( String string , Smi flags ) ; <nl> <nl> static inline uint32_t StringSharedHash ( String source , <nl> - SharedFunctionInfo * shared , <nl> + SharedFunctionInfo shared , <nl> LanguageMode language_mode , <nl> int position ) ; <nl> <nl> class CompilationCacheShape : public BaseShape < HashTableKey * > { <nl> <nl> class InfoCellPair { <nl> public : <nl> - InfoCellPair ( ) : shared_ ( nullptr ) , feedback_cell_ ( nullptr ) { } <nl> - InfoCellPair ( SharedFunctionInfo * shared , FeedbackCell * feedback_cell ) <nl> + InfoCellPair ( ) : feedback_cell_ ( nullptr ) { } <nl> + InfoCellPair ( SharedFunctionInfo shared , FeedbackCell * feedback_cell ) <nl> : shared_ ( shared ) , feedback_cell_ ( feedback_cell ) { } <nl> <nl> FeedbackCell * feedback_cell ( ) const { return feedback_cell_ ; } <nl> - SharedFunctionInfo * shared ( ) const { return shared_ ; } <nl> + SharedFunctionInfo shared ( ) const { return shared_ ; } <nl> <nl> bool has_feedback_cell ( ) const { return feedback_cell_ ! = nullptr ; } <nl> - bool has_shared ( ) const { return shared_ ! = nullptr ; } <nl> + bool has_shared ( ) const { return ! shared_ . is_null ( ) ; } <nl> <nl> private : <nl> - SharedFunctionInfo * shared_ ; <nl> + SharedFunctionInfo shared_ ; <nl> FeedbackCell * feedback_cell_ ; <nl> } ; <nl> <nl> mmm a / src / objects / debug - objects - inl . h <nl> ppp b / src / objects / debug - objects - inl . h <nl> CAST_ACCESSOR2 ( CoverageInfo ) <nl> CAST_ACCESSOR ( BreakPoint ) <nl> <nl> SMI_ACCESSORS ( DebugInfo , flags , kFlagsOffset ) <nl> - ACCESSORS ( DebugInfo , shared , SharedFunctionInfo , kSharedFunctionInfoOffset ) <nl> + ACCESSORS2 ( DebugInfo , shared , SharedFunctionInfo , kSharedFunctionInfoOffset ) <nl> SMI_ACCESSORS ( DebugInfo , debugger_hints , kDebuggerHintsOffset ) <nl> ACCESSORS ( DebugInfo , script , Object , kScriptOffset ) <nl> ACCESSORS ( DebugInfo , original_bytecode_array , Object , <nl> mmm a / src / objects / debug - objects . h <nl> ppp b / src / objects / debug - objects . h <nl> class DebugInfo : public Struct , public NeverReadOnlySpaceObject { <nl> DECL_INT_ACCESSORS ( flags ) <nl> <nl> / / The shared function info for the source being debugged . <nl> - DECL_ACCESSORS ( shared , SharedFunctionInfo ) <nl> + DECL_ACCESSORS2 ( shared , SharedFunctionInfo ) <nl> <nl> / / Bit field containing various information collected for debugging . <nl> DECL_INT_ACCESSORS ( debugger_hints ) <nl> mmm a / src / objects / heap - object - inl . h <nl> ppp b / src / objects / heap - object - inl . h <nl> MaybeObjectSlot HeapObjectPtr : : RawMaybeWeakField ( int byte_offset ) const { <nl> return MaybeObjectSlot ( FIELD_ADDR ( this , byte_offset ) ) ; <nl> } <nl> <nl> + # ifdef VERIFY_HEAP <nl> + void HeapObjectPtr : : VerifyObjectField ( Isolate * isolate , int offset ) { <nl> + HeapObject : : VerifyPointer ( isolate , READ_FIELD ( this , offset ) ) ; <nl> + } <nl> + <nl> + void HeapObjectPtr : : VerifyMaybeObjectField ( Isolate * isolate , int offset ) { <nl> + MaybeObject : : VerifyMaybeObjectPointer ( isolate , READ_WEAK_FIELD ( this , offset ) ) ; <nl> + } <nl> + <nl> + void HeapObjectPtr : : VerifySmiField ( int offset ) { <nl> + CHECK ( READ_FIELD ( this , offset ) - > IsSmi ( ) ) ; <nl> + } <nl> + <nl> + # endif <nl> + <nl> Address HeapObjectPtr : : GetFieldAddress ( int field_offset ) const { <nl> return FIELD_ADDR ( this , field_offset ) ; <nl> } <nl> mmm a / src / objects / heap - object . h <nl> ppp b / src / objects / heap - object . h <nl> class HeapObjectPtr : public ObjectPtr { <nl> void PrintHeader ( std : : ostream & os , const char * id ) ; / / NOLINT <nl> # endif <nl> void HeapObjectVerify ( Isolate * isolate ) ; <nl> - # ifdef VERIFY_HEAP <nl> - static void VerifyHeapPointer ( Isolate * isolate , Object * p ) ; <nl> - # endif <nl> - <nl> # ifdef VERIFY_HEAP <nl> inline void VerifyObjectField ( Isolate * isolate , int offset ) ; <nl> inline void VerifySmiField ( int offset ) ; <nl> inline void VerifyMaybeObjectField ( Isolate * isolate , int offset ) ; <nl> + static void VerifyHeapPointer ( Isolate * isolate , Object * p ) ; <nl> # endif <nl> <nl> static const int kMapOffset = HeapObject : : kMapOffset ; <nl> mmm a / src / objects / js - objects - inl . h <nl> ppp b / src / objects / js - objects - inl . h <nl> ACCESSORS ( JSBoundFunction , bound_target_function , JSReceiver , <nl> ACCESSORS ( JSBoundFunction , bound_this , Object , kBoundThisOffset ) <nl> ACCESSORS2 ( JSBoundFunction , bound_arguments , FixedArray , kBoundArgumentsOffset ) <nl> <nl> - ACCESSORS ( JSFunction , shared , SharedFunctionInfo , kSharedFunctionInfoOffset ) <nl> + ACCESSORS2 ( JSFunction , shared , SharedFunctionInfo , kSharedFunctionInfoOffset ) <nl> ACCESSORS ( JSFunction , feedback_cell , FeedbackCell , kFeedbackCellOffset ) <nl> <nl> ACCESSORS2 ( JSGlobalObject , native_context , Context , kNativeContextOffset ) <nl> mmm a / src / objects / js - objects . h <nl> ppp b / src / objects / js - objects . h <nl> class JSFunction : public JSObject { <nl> <nl> / / [ shared ] : The information about the function that <nl> / / can be shared by instances . <nl> - DECL_ACCESSORS ( shared , SharedFunctionInfo ) <nl> + DECL_ACCESSORS2 ( shared , SharedFunctionInfo ) <nl> <nl> static const int kLengthDescriptorIndex = 0 ; <nl> static const int kNameDescriptorIndex = 1 ; <nl> mmm a / src / objects / module . cc <nl> ppp b / src / objects / module . cc <nl> Object * Module : : GetException ( ) { <nl> return exception ( ) ; <nl> } <nl> <nl> - SharedFunctionInfo * Module : : GetSharedFunctionInfo ( ) const { <nl> + SharedFunctionInfo Module : : GetSharedFunctionInfo ( ) const { <nl> DisallowHeapAllocation no_alloc ; <nl> DCHECK_NE ( status ( ) , Module : : kEvaluating ) ; <nl> DCHECK_NE ( status ( ) , Module : : kEvaluated ) ; <nl> mmm a / src / objects / module . h <nl> ppp b / src / objects / module . h <nl> class Module : public Struct , public NeverReadOnlySpaceObject { <nl> <nl> / / The shared function info in case { status } is not kEvaluating , kEvaluated or <nl> / / kErrored . <nl> - SharedFunctionInfo * GetSharedFunctionInfo ( ) const ; <nl> + SharedFunctionInfo GetSharedFunctionInfo ( ) const ; <nl> <nl> / / The namespace object ( or undefined ) . <nl> DECL_ACCESSORS ( module_namespace , HeapObject ) <nl> mmm a / src / objects / script - inl . h <nl> ppp b / src / objects / script - inl . h <nl> bool Script : : has_eval_from_shared ( ) const { <nl> return eval_from_shared_or_wrapped_arguments ( ) - > IsSharedFunctionInfo ( ) ; <nl> } <nl> <nl> - void Script : : set_eval_from_shared ( SharedFunctionInfo * shared , <nl> + void Script : : set_eval_from_shared ( SharedFunctionInfo shared , <nl> WriteBarrierMode mode ) { <nl> DCHECK ( ! is_wrapped ( ) ) ; <nl> set_eval_from_shared_or_wrapped_arguments ( shared , mode ) ; <nl> } <nl> <nl> - SharedFunctionInfo * Script : : eval_from_shared ( ) const { <nl> + SharedFunctionInfo Script : : eval_from_shared ( ) const { <nl> DCHECK ( has_eval_from_shared ( ) ) ; <nl> return SharedFunctionInfo : : cast ( eval_from_shared_or_wrapped_arguments ( ) ) ; <nl> } <nl> mmm a / src / objects / script . h <nl> ppp b / src / objects / script . h <nl> class Script : public Struct , public NeverReadOnlySpaceObject { <nl> <nl> / / [ eval_from_shared ] : for eval scripts the shared function info for the <nl> / / function from which eval was called . <nl> - DECL_ACCESSORS ( eval_from_shared , SharedFunctionInfo ) <nl> + DECL_ACCESSORS2 ( eval_from_shared , SharedFunctionInfo ) <nl> <nl> / / [ wrapped_arguments ] : for the list of arguments in a wrapped script . <nl> DECL_ACCESSORS2 ( wrapped_arguments , FixedArray ) <nl> mmm a / src / objects / shared - function - info - inl . h <nl> ppp b / src / objects / shared - function - info - inl . h <nl> ACCESSORS2 ( InterpreterData , bytecode_array , BytecodeArray , kBytecodeArrayOffset ) <nl> ACCESSORS2 ( InterpreterData , interpreter_trampoline , Code , <nl> kInterpreterTrampolineOffset ) <nl> <nl> - CAST_ACCESSOR ( SharedFunctionInfo ) <nl> + OBJECT_CONSTRUCTORS_IMPL ( SharedFunctionInfo , HeapObjectPtr ) <nl> + NEVER_READ_ONLY_SPACE_IMPL ( SharedFunctionInfo ) <nl> + CAST_ACCESSOR2 ( SharedFunctionInfo ) <nl> DEFINE_DEOPT_ELEMENT_ACCESSORS ( SharedFunctionInfo , Object ) <nl> <nl> ACCESSORS ( SharedFunctionInfo , name_or_scope_info , Object , <nl> mmm a / src / objects / shared - function - info . h <nl> ppp b / src / objects / shared - function - info . h <nl> class InterpreterData : public Struct { <nl> <nl> / / SharedFunctionInfo describes the JSFunction information that can be <nl> / / shared by multiple instances of the function . <nl> - class SharedFunctionInfo : public HeapObject , public NeverReadOnlySpaceObject { <nl> + class SharedFunctionInfo : public HeapObjectPtr { <nl> public : <nl> + NEVER_READ_ONLY_SPACE <nl> static constexpr ObjectPtr const kNoSharedNameSentinel = Smi : : kZero ; <nl> <nl> / / [ name ] : Returns shared name if it exists or an empty string otherwise . <nl> class SharedFunctionInfo : public HeapObject , public NeverReadOnlySpaceObject { <nl> ScriptIterator ( Isolate * isolate , Script * script ) ; <nl> ScriptIterator ( Isolate * isolate , <nl> Handle < WeakFixedArray > shared_function_infos ) ; <nl> - SharedFunctionInfo * Next ( ) ; <nl> + SharedFunctionInfo Next ( ) ; <nl> int CurrentIndex ( ) const { return index_ - 1 ; } <nl> <nl> / / Reset the iterator to run on | script | . <nl> class SharedFunctionInfo : public HeapObject , public NeverReadOnlySpaceObject { <nl> class GlobalIterator { <nl> public : <nl> explicit GlobalIterator ( Isolate * isolate ) ; <nl> - SharedFunctionInfo * Next ( ) ; <nl> + SharedFunctionInfo Next ( ) ; <nl> <nl> private : <nl> Script : : Iterator script_iterator_ ; <nl> class SharedFunctionInfo : public HeapObject , public NeverReadOnlySpaceObject { <nl> DISALLOW_COPY_AND_ASSIGN ( GlobalIterator ) ; <nl> } ; <nl> <nl> - DECL_CAST ( SharedFunctionInfo ) <nl> + DECL_CAST2 ( SharedFunctionInfo ) <nl> <nl> / / Constants . <nl> static const uint16_t kDontAdaptArgumentsSentinel = static_cast < uint16_t > ( - 1 ) ; <nl> class SharedFunctionInfo : public HeapObject , public NeverReadOnlySpaceObject { <nl> / / FunctionLiteralId . <nl> int FindIndexInScript ( Isolate * isolate ) const ; <nl> <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( SharedFunctionInfo ) ; <nl> + OBJECT_CONSTRUCTORS ( SharedFunctionInfo , HeapObjectPtr ) ; <nl> } ; <nl> <nl> / / Printing support . <nl> struct SourceCodeOf { <nl> - explicit SourceCodeOf ( SharedFunctionInfo * v , int max = - 1 ) <nl> + explicit SourceCodeOf ( SharedFunctionInfo v , int max = - 1 ) <nl> : value ( v ) , max_length ( max ) { } <nl> - const SharedFunctionInfo * value ; <nl> + const SharedFunctionInfo value ; <nl> int max_length ; <nl> } ; <nl> <nl> mmm a / src / objects / templates - inl . h <nl> ppp b / src / objects / templates - inl . h <nl> bool FunctionTemplateInfo : : instantiated ( ) { <nl> bool FunctionTemplateInfo : : BreakAtEntry ( ) { <nl> Object * maybe_shared = shared_function_info ( ) ; <nl> if ( maybe_shared - > IsSharedFunctionInfo ( ) ) { <nl> - SharedFunctionInfo * shared = SharedFunctionInfo : : cast ( maybe_shared ) ; <nl> + SharedFunctionInfo shared = SharedFunctionInfo : : cast ( maybe_shared ) ; <nl> return shared - > BreakAtEntry ( ) ; <nl> } <nl> return false ; <nl> mmm a / src / perf - jit . cc <nl> ppp b / src / perf - jit . cc <nl> uint64_t PerfJitLogger : : GetTimestamp ( ) { <nl> } <nl> <nl> void PerfJitLogger : : LogRecordedBuffer ( AbstractCode abstract_code , <nl> - SharedFunctionInfo * shared , <nl> + SharedFunctionInfo shared , <nl> const char * name , int length ) { <nl> if ( FLAG_perf_basic_prof_only_functions & & <nl> ( abstract_code - > kind ( ) ! = AbstractCode : : INTERPRETED_FUNCTION & & <nl> void PerfJitLogger : : LogRecordedBuffer ( AbstractCode abstract_code , <nl> DCHECK ( code - > raw_instruction_start ( ) = = code - > address ( ) + Code : : kHeaderSize ) ; <nl> <nl> / / Debug info has to be emitted first . <nl> - if ( FLAG_perf_prof & & shared ! = nullptr ) { <nl> + if ( FLAG_perf_prof & & ! shared . is_null ( ) ) { <nl> / / TODO ( herhut ) : This currently breaks for js2wasm / wasm2js functions . <nl> if ( code - > kind ( ) ! = Code : : JS_TO_WASM_FUNCTION & & <nl> code - > kind ( ) ! = Code : : WASM_TO_JS_FUNCTION ) { <nl> SourcePositionInfo GetSourcePositionInfo ( Handle < Code > code , <nl> <nl> } / / namespace <nl> <nl> - void PerfJitLogger : : LogWriteDebugInfo ( Code code , SharedFunctionInfo * shared ) { <nl> + void PerfJitLogger : : LogWriteDebugInfo ( Code code , SharedFunctionInfo shared ) { <nl> / / Compute the entry count and get the name of the script . <nl> uint32_t entry_count = 0 ; <nl> for ( SourcePositionTableIterator iterator ( code - > SourcePositionTable ( ) ) ; <nl> mmm a / src / perf - jit . h <nl> ppp b / src / perf - jit . h <nl> class PerfJitLogger : public CodeEventLogger { <nl> <nl> void CodeMoveEvent ( AbstractCode from , AbstractCode to ) override ; <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { } <nl> + SharedFunctionInfo shared ) override { } <nl> <nl> private : <nl> void OpenJitDumpFile ( ) ; <nl> class PerfJitLogger : public CodeEventLogger { <nl> void CloseMarkerFile ( void * marker_address ) ; <nl> <nl> uint64_t GetTimestamp ( ) ; <nl> - void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) override ; <nl> void LogRecordedBuffer ( const wasm : : WasmCode * code , const char * name , <nl> int length ) override ; <nl> class PerfJitLogger : public CodeEventLogger { <nl> <nl> void LogWriteBytes ( const char * bytes , int size ) ; <nl> void LogWriteHeader ( ) ; <nl> - void LogWriteDebugInfo ( Code code , SharedFunctionInfo * shared ) ; <nl> + void LogWriteDebugInfo ( Code code , SharedFunctionInfo shared ) ; <nl> void LogWriteUnwindingInfo ( Code code ) ; <nl> <nl> static const uint32_t kElfMachIA32 = 3 ; <nl> class PerfJitLogger : public CodeEventLogger { <nl> } <nl> <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { <nl> + SharedFunctionInfo shared ) override { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * shared , <nl> + void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo shared , <nl> const char * name , int length ) override { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> mmm a / src / profiler / allocation - tracker . cc <nl> ppp b / src / profiler / allocation - tracker . cc <nl> void AllocationTracker : : AllocationEvent ( Address addr , int size ) { <nl> JavaScriptFrameIterator it ( isolate ) ; <nl> while ( ! it . done ( ) & & length < kMaxAllocationTraceLength ) { <nl> JavaScriptFrame * frame = it . frame ( ) ; <nl> - SharedFunctionInfo * shared = frame - > function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = frame - > function ( ) - > shared ( ) ; <nl> SnapshotObjectId id = ids_ - > FindOrAddEntry ( <nl> shared - > address ( ) , shared - > Size ( ) , false ) ; <nl> allocation_trace_buffer_ [ length + + ] = AddFunctionInfo ( shared , id ) ; <nl> static uint32_t SnapshotObjectIdHash ( SnapshotObjectId id ) { <nl> return ComputeUnseededHash ( static_cast < uint32_t > ( id ) ) ; <nl> } <nl> <nl> - <nl> - unsigned AllocationTracker : : AddFunctionInfo ( SharedFunctionInfo * shared , <nl> + unsigned AllocationTracker : : AddFunctionInfo ( SharedFunctionInfo shared , <nl> SnapshotObjectId id ) { <nl> base : : HashMap : : Entry * entry = id_to_function_info_index_ . LookupOrInsert ( <nl> reinterpret_cast < void * > ( id ) , SnapshotObjectIdHash ( id ) ) ; <nl> unsigned AllocationTracker : : AddFunctionInfo ( SharedFunctionInfo * shared , <nl> return static_cast < unsigned > ( reinterpret_cast < intptr_t > ( ( entry - > value ) ) ) ; <nl> } <nl> <nl> - <nl> unsigned AllocationTracker : : functionInfoIndexForVMState ( StateTag state ) { <nl> if ( state ! = OTHER ) return 0 ; <nl> if ( info_index_for_other_state_ = = 0 ) { <nl> mmm a / src / profiler / allocation - tracker . h <nl> ppp b / src / profiler / allocation - tracker . h <nl> class AllocationTracker { <nl> AddressToTraceMap * address_to_trace ( ) { return & address_to_trace_ ; } <nl> <nl> private : <nl> - unsigned AddFunctionInfo ( SharedFunctionInfo * info , SnapshotObjectId id ) ; <nl> + unsigned AddFunctionInfo ( SharedFunctionInfo info , SnapshotObjectId id ) ; <nl> unsigned functionInfoIndexForVMState ( StateTag state ) ; <nl> <nl> class UnresolvedLocation { <nl> mmm a / src / profiler / heap - snapshot - generator . cc <nl> ppp b / src / profiler / heap - snapshot - generator . cc <nl> void V8HeapExplorer : : ExtractLocationForJSFunction ( HeapEntry * entry , <nl> HeapEntry * V8HeapExplorer : : AddEntry ( HeapObject * object ) { <nl> if ( object - > IsJSFunction ( ) ) { <nl> JSFunction * func = JSFunction : : cast ( object ) ; <nl> - SharedFunctionInfo * shared = func - > shared ( ) ; <nl> + SharedFunctionInfo shared = func - > shared ( ) ; <nl> const char * name = names_ - > GetName ( shared - > Name ( ) ) ; <nl> return AddEntry ( object , HeapEntry : : kClosure , name ) ; <nl> } else if ( object - > IsJSBoundFunction ( ) ) { <nl> void V8HeapExplorer : : ExtractJSObjectReferences ( HeapEntry * entry , <nl> } <nl> } <nl> } <nl> - SharedFunctionInfo * shared_info = js_fun - > shared ( ) ; <nl> + SharedFunctionInfo shared_info = js_fun - > shared ( ) ; <nl> TagObject ( js_fun - > feedback_cell ( ) , " ( function feedback cell ) " ) ; <nl> SetInternalReference ( entry , " feedback_cell " , js_fun - > feedback_cell ( ) , <nl> JSFunction : : kFeedbackCellOffset ) ; <nl> void V8HeapExplorer : : ExtractMapReferences ( HeapEntry * entry , Map map ) { <nl> } <nl> <nl> void V8HeapExplorer : : ExtractSharedFunctionInfoReferences ( <nl> - HeapEntry * entry , SharedFunctionInfo * shared ) { <nl> + HeapEntry * entry , SharedFunctionInfo shared ) { <nl> String shared_name = shared - > DebugName ( ) ; <nl> const char * name = nullptr ; <nl> if ( shared_name ! = ReadOnlyRoots ( heap_ ) . empty_string ( ) ) { <nl> mmm a / src / profiler / heap - snapshot - generator . h <nl> ppp b / src / profiler / heap - snapshot - generator . h <nl> class V8HeapExplorer : public HeapEntriesAllocator { <nl> void ExtractContextReferences ( HeapEntry * entry , Context context ) ; <nl> void ExtractMapReferences ( HeapEntry * entry , Map map ) ; <nl> void ExtractSharedFunctionInfoReferences ( HeapEntry * entry , <nl> - SharedFunctionInfo * shared ) ; <nl> + SharedFunctionInfo shared ) ; <nl> void ExtractScriptReferences ( HeapEntry * entry , Script * script ) ; <nl> void ExtractAccessorInfoReferences ( HeapEntry * entry , <nl> AccessorInfo * accessor_info ) ; <nl> mmm a / src / profiler / profile - generator . cc <nl> ppp b / src / profiler / profile - generator . cc <nl> void CodeEntry : : set_deopt_info ( <nl> rare_data - > deopt_inlined_frames_ = std : : move ( inlined_frames ) ; <nl> } <nl> <nl> - void CodeEntry : : FillFunctionInfo ( SharedFunctionInfo * shared ) { <nl> + void CodeEntry : : FillFunctionInfo ( SharedFunctionInfo shared ) { <nl> if ( ! shared - > script ( ) - > IsScript ( ) ) return ; <nl> Script * script = Script : : cast ( shared - > script ( ) ) ; <nl> set_script_id ( script - > id ( ) ) ; <nl> mmm a / src / profiler / profile - generator . h <nl> ppp b / src / profiler / profile - generator . h <nl> class CodeEntry { <nl> void mark_used ( ) { bit_field_ = UsedField : : update ( bit_field_ , true ) ; } <nl> bool used ( ) const { return UsedField : : decode ( bit_field_ ) ; } <nl> <nl> - void FillFunctionInfo ( SharedFunctionInfo * shared ) ; <nl> + void FillFunctionInfo ( SharedFunctionInfo shared ) ; <nl> <nl> void SetBuiltinId ( Builtins : : Name id ) ; <nl> Builtins : : Name builtin_id ( ) const { <nl> mmm a / src / profiler / profiler - listener . cc <nl> ppp b / src / profiler / profiler - listener . cc <nl> void ProfilerListener : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> <nl> void ProfilerListener : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , <nl> - SharedFunctionInfo * shared , <nl> + SharedFunctionInfo shared , <nl> Name script_name ) { <nl> CodeEventsContainer evt_rec ( CodeEventRecord : : CODE_CREATION ) ; <nl> CodeCreateEventRecord * rec = & evt_rec . CodeCreateEventRecord_ ; <nl> void ProfilerListener : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> <nl> void ProfilerListener : : CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode abstract_code , <nl> - SharedFunctionInfo * shared , <nl> + SharedFunctionInfo shared , <nl> Name script_name , int line , int column ) { <nl> CodeEventsContainer evt_rec ( CodeEventRecord : : CODE_CREATION ) ; <nl> CodeCreateEventRecord * rec = & evt_rec . CodeCreateEventRecord_ ; <nl> void ProfilerListener : : CodeMoveEvent ( AbstractCode from , AbstractCode to ) { <nl> } <nl> <nl> void ProfilerListener : : CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) { <nl> + SharedFunctionInfo shared ) { <nl> CodeEventsContainer evt_rec ( CodeEventRecord : : CODE_DISABLE_OPT ) ; <nl> CodeDisableOptEventRecord * rec = & evt_rec . CodeDisableOptEventRecord_ ; <nl> rec - > instruction_start = code - > InstructionStart ( ) ; <nl> void ProfilerListener : : SetterCallbackEvent ( Name name , Address entry_point ) { <nl> DispatchCodeEvent ( evt_rec ) ; <nl> } <nl> <nl> - Name ProfilerListener : : InferScriptName ( Name name , SharedFunctionInfo * info ) { <nl> + Name ProfilerListener : : InferScriptName ( Name name , SharedFunctionInfo info ) { <nl> if ( name - > IsString ( ) & & String : : cast ( name ) - > length ( ) ) return name ; <nl> if ( ! info - > script ( ) - > IsScript ( ) ) return name ; <nl> Object * source_url = Script : : cast ( info - > script ( ) ) - > source_url ( ) ; <nl> void ProfilerListener : : RecordInliningInfo ( CodeEntry * entry , <nl> it . Next ( ) ; / / Skip height <nl> it . Next ( ) ; / / Skip return value offset <nl> it . Next ( ) ; / / Skip return value count <nl> - SharedFunctionInfo * shared_info = SharedFunctionInfo : : cast ( <nl> + SharedFunctionInfo shared_info = SharedFunctionInfo : : cast ( <nl> deopt_input_data - > LiteralArray ( ) - > get ( shared_info_id ) ) ; <nl> if ( ! depth + + ) continue ; / / Skip the current function itself . <nl> <nl> mmm a / src / profiler / profiler - listener . h <nl> ppp b / src / profiler / profiler - listener . h <nl> class ProfilerListener : public CodeEventListener { <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> AbstractCode code , Name name ) override ; <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> - AbstractCode code , SharedFunctionInfo * shared , <nl> + AbstractCode code , SharedFunctionInfo shared , <nl> Name script_name ) override ; <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> - AbstractCode code , SharedFunctionInfo * shared , <nl> + AbstractCode code , SharedFunctionInfo shared , <nl> Name script_name , int line , int column ) override ; <nl> void CodeCreateEvent ( CodeEventListener : : LogEventsAndTags tag , <nl> const wasm : : WasmCode * code , <nl> class ProfilerListener : public CodeEventListener { <nl> void CodeMovingGCEvent ( ) override { } <nl> void CodeMoveEvent ( AbstractCode from , AbstractCode to ) override ; <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override ; <nl> + SharedFunctionInfo shared ) override ; <nl> void CodeDeoptEvent ( Code code , DeoptimizeKind kind , Address pc , <nl> int fp_to_sp_delta ) override ; <nl> void GetterCallbackEvent ( Name name , Address entry_point ) override ; <nl> class ProfilerListener : public CodeEventListener { <nl> private : <nl> void RecordInliningInfo ( CodeEntry * entry , AbstractCode abstract_code ) ; <nl> void AttachDeoptInlinedFrames ( Code code , CodeDeoptEventRecord * rec ) ; <nl> - Name InferScriptName ( Name name , SharedFunctionInfo * info ) ; <nl> + Name InferScriptName ( Name name , SharedFunctionInfo info ) ; <nl> V8_INLINE void DispatchCodeEvent ( const CodeEventsContainer & evt_rec ) { <nl> observer_ - > CodeEventHandler ( evt_rec ) ; <nl> } <nl> mmm a / src / profiler / sampling - heap - profiler . cc <nl> ppp b / src / profiler / sampling - heap - profiler . cc <nl> SamplingHeapProfiler : : AllocationNode * SamplingHeapProfiler : : FindOrAddChildNode ( <nl> SamplingHeapProfiler : : AllocationNode * SamplingHeapProfiler : : AddStack ( ) { <nl> AllocationNode * node = & profile_root_ ; <nl> <nl> - std : : vector < SharedFunctionInfo * > stack ; <nl> + std : : vector < SharedFunctionInfo > stack ; <nl> JavaScriptFrameIterator it ( isolate_ ) ; <nl> int frames_captured = 0 ; <nl> bool found_arguments_marker_frames = false ; <nl> SamplingHeapProfiler : : AllocationNode * SamplingHeapProfiler : : AddStack ( ) { <nl> / / in the top frames of the stack ) . The allocations made in this <nl> / / sensitive moment belong to the formerly optimized frame anyway . <nl> if ( frame - > unchecked_function ( ) - > IsJSFunction ( ) ) { <nl> - SharedFunctionInfo * shared = frame - > function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = frame - > function ( ) - > shared ( ) ; <nl> stack . push_back ( shared ) ; <nl> frames_captured + + ; <nl> } else { <nl> SamplingHeapProfiler : : AllocationNode * SamplingHeapProfiler : : AddStack ( ) { <nl> / / We need to process the stack in reverse order as the top of the stack is <nl> / / the first element in the list . <nl> for ( auto it = stack . rbegin ( ) ; it ! = stack . rend ( ) ; + + it ) { <nl> - SharedFunctionInfo * shared = * it ; <nl> + SharedFunctionInfo shared = * it ; <nl> const char * name = this - > names ( ) - > GetName ( shared - > DebugName ( ) ) ; <nl> int script_id = v8 : : UnboundScript : : kNoScriptId ; <nl> if ( shared - > script ( ) - > IsScript ( ) ) { <nl> mmm a / src / runtime - profiler . cc <nl> ppp b / src / runtime - profiler . cc <nl> void RuntimeProfiler : : Optimize ( JSFunction * function , <nl> void RuntimeProfiler : : AttemptOnStackReplacement ( InterpretedFrame * frame , <nl> int loop_nesting_levels ) { <nl> JSFunction * function = frame - > function ( ) ; <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> if ( ! FLAG_use_osr | | ! function - > shared ( ) - > IsUserJavaScript ( ) ) { <nl> return ; <nl> } <nl> mmm a / src / runtime / runtime - debug . cc <nl> ppp b / src / runtime / runtime - debug . cc <nl> RUNTIME_FUNCTION_RETURN_PAIR ( Runtime_DebugBreakOnBytecode ) { <nl> DCHECK ( it . frame ( ) - > is_interpreted ( ) ) ; <nl> InterpretedFrame * interpreted_frame = <nl> reinterpret_cast < InterpretedFrame * > ( it . frame ( ) ) ; <nl> - SharedFunctionInfo * shared = interpreted_frame - > function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = interpreted_frame - > function ( ) - > shared ( ) ; <nl> BytecodeArray bytecode_array = shared - > GetBytecodeArray ( ) ; <nl> int bytecode_offset = interpreted_frame - > GetBytecodeOffset ( ) ; <nl> Bytecode bytecode = Bytecodes : : FromByte ( bytecode_array - > get ( bytecode_offset ) ) ; <nl> RUNTIME_FUNCTION ( Runtime_IncBlockCounter ) { <nl> / / coverage collection mode , which triggers deletion of all coverage infos in <nl> / / order to avoid memory leaks . <nl> <nl> - SharedFunctionInfo * shared = function - > shared ( ) ; <nl> + SharedFunctionInfo shared = function - > shared ( ) ; <nl> if ( shared - > HasCoverageInfo ( ) ) { <nl> CoverageInfo coverage_info = shared - > GetCoverageInfo ( ) ; <nl> coverage_info - > IncrementBlockCount ( coverage_array_slot_index ) ; <nl> mmm a / src / runtime / runtime - generator . cc <nl> ppp b / src / runtime / runtime - generator . cc <nl> RUNTIME_FUNCTION ( Runtime_AsyncGeneratorHasCatchHandlerForPC ) { <nl> / / not reach a catch handler . <nl> if ( state < 1 ) return ReadOnlyRoots ( isolate ) . false_value ( ) ; <nl> <nl> - SharedFunctionInfo * shared = generator - > function ( ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = generator - > function ( ) - > shared ( ) ; <nl> DCHECK ( shared - > HasBytecodeArray ( ) ) ; <nl> HandlerTable handler_table ( shared - > GetBytecodeArray ( ) ) ; <nl> <nl> mmm a / src / runtime / runtime - object . cc <nl> ppp b / src / runtime / runtime - object . cc <nl> inline void TrySetNative ( Handle < Object > maybe_func ) { <nl> <nl> inline void TrySetNativeAndLength ( Handle < Object > maybe_func , int length ) { <nl> if ( ! maybe_func - > IsJSFunction ( ) ) return ; <nl> - SharedFunctionInfo * shared = JSFunction : : cast ( * maybe_func ) - > shared ( ) ; <nl> + SharedFunctionInfo shared = JSFunction : : cast ( * maybe_func ) - > shared ( ) ; <nl> shared - > set_native ( true ) ; <nl> if ( length > = 0 ) { <nl> shared - > set_length ( length ) ; <nl> mmm a / src / runtime / runtime - scopes . cc <nl> ppp b / src / runtime / runtime - scopes . cc <nl> std : : unique_ptr < Handle < Object > [ ] > GetCallerArguments ( Isolate * isolate , <nl> / / Find frame containing arguments passed to the caller . <nl> JavaScriptFrameIterator it ( isolate ) ; <nl> JavaScriptFrame * frame = it . frame ( ) ; <nl> - std : : vector < SharedFunctionInfo * > functions ; <nl> + std : : vector < SharedFunctionInfo > functions ; <nl> frame - > GetFunctions ( & functions ) ; <nl> if ( functions . size ( ) > 1 ) { <nl> int inlined_jsframe_index = static_cast < int > ( functions . size ( ) ) - 1 ; <nl> mmm a / src / snapshot / code - serializer . cc <nl> ppp b / src / snapshot / code - serializer . cc <nl> void CodeSerializer : : SerializeObject ( HeapObject * obj , HowToCode how_to_code , <nl> } <nl> <nl> if ( obj - > IsSharedFunctionInfo ( ) ) { <nl> - SharedFunctionInfo * sfi = SharedFunctionInfo : : cast ( obj ) ; <nl> + SharedFunctionInfo sfi = SharedFunctionInfo : : cast ( obj ) ; <nl> / / TODO ( 7110 ) : Enable serializing of Asm modules once the AsmWasmData <nl> / / is context independent . <nl> DCHECK ( ! sfi - > IsApiFunction ( ) & & ! sfi - > HasAsmWasmData ( ) ) ; <nl> mmm a / src / snapshot / serializer . h <nl> ppp b / src / snapshot / serializer . h <nl> class CodeAddressMap : public CodeEventLogger { <nl> } <nl> <nl> void CodeDisableOptEvent ( AbstractCode code , <nl> - SharedFunctionInfo * shared ) override { } <nl> + SharedFunctionInfo shared ) override { } <nl> <nl> const char * Lookup ( Address address ) { <nl> return address_to_name_map_ . Lookup ( address ) ; <nl> class CodeAddressMap : public CodeEventLogger { <nl> DISALLOW_COPY_AND_ASSIGN ( NameMap ) ; <nl> } ; <nl> <nl> - void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo * , <nl> + void LogRecordedBuffer ( AbstractCode code , SharedFunctionInfo , <nl> const char * name , int length ) override { <nl> address_to_name_map_ . Insert ( code - > address ( ) , name , length ) ; <nl> } <nl> mmm a / src / snapshot / startup - serializer . cc <nl> ppp b / src / snapshot / startup - serializer . cc <nl> void StartupSerializer : : SerializeObject ( HeapObject * obj , HowToCode how_to_code , <nl> ReadOnlyRoots ( isolate ( ) ) . uninitialized_symbol ( ) ) ; <nl> } else if ( obj - > IsSharedFunctionInfo ( ) ) { <nl> / / Clear inferred name for native functions . <nl> - SharedFunctionInfo * shared = SharedFunctionInfo : : cast ( obj ) ; <nl> + SharedFunctionInfo shared = SharedFunctionInfo : : cast ( obj ) ; <nl> if ( ! shared - > IsSubjectToDebugging ( ) & & shared - > HasUncompiledData ( ) ) { <nl> shared - > uncompiled_data ( ) - > set_inferred_name ( <nl> ReadOnlyRoots ( isolate ( ) ) . empty_string ( ) ) ; <nl> mmm a / src / source - position . cc <nl> ppp b / src / source - position . cc <nl> std : : vector < SourcePositionInfo > SourcePosition : : InliningStack ( <nl> } <nl> <nl> void SourcePosition : : Print ( std : : ostream & out , <nl> - SharedFunctionInfo * function ) const { <nl> + SharedFunctionInfo function ) const { <nl> Script : : PositionInfo pos ; <nl> Object * source_name = nullptr ; <nl> if ( function - > script ( ) - > IsScript ( ) ) { <nl> void SourcePosition : : Print ( std : : ostream & out , Code code ) const { <nl> DeoptimizationData deopt_data = <nl> DeoptimizationData : : cast ( code - > deoptimization_data ( ) ) ; <nl> if ( ! isInlined ( ) ) { <nl> - SharedFunctionInfo * function ( <nl> + SharedFunctionInfo function ( <nl> SharedFunctionInfo : : cast ( deopt_data - > SharedFunctionInfo ( ) ) ) ; <nl> Print ( out , function ) ; <nl> } else { <nl> void SourcePosition : : Print ( std : : ostream & out , Code code ) const { <nl> if ( inl . inlined_function_id = = - 1 ) { <nl> out < < * this ; <nl> } else { <nl> - SharedFunctionInfo * function = <nl> + SharedFunctionInfo function = <nl> deopt_data - > GetInlinedFunction ( inl . inlined_function_id ) ; <nl> Print ( out , function ) ; <nl> } <nl> mmm a / src / source - position . h <nl> ppp b / src / source - position . h <nl> class SourcePosition final { <nl> } <nl> <nl> private : <nl> - void Print ( std : : ostream & out , SharedFunctionInfo * function ) const ; <nl> + void Print ( std : : ostream & out , SharedFunctionInfo function ) const ; <nl> <nl> / / InliningId is in the high bits for better compression in <nl> / / SourcePositionTable . <nl> mmm a / test / cctest / heap / test - heap . cc <nl> ppp b / test / cctest / heap / test - heap . cc <nl> TEST ( SharedFunctionInfoIterator ) { <nl> <nl> { <nl> SharedFunctionInfo : : GlobalIterator iterator ( isolate ) ; <nl> - while ( iterator . Next ( ) ) sfi_count - - ; <nl> + while ( ! iterator . Next ( ) . is_null ( ) ) sfi_count - - ; <nl> } <nl> <nl> CHECK_EQ ( 0 , sfi_count ) ; <nl> mmm a / test / cctest / parsing / test - parse - decision . cc <nl> ppp b / test / cctest / parsing / test - parse - decision . cc <nl> void GetTopLevelFunctionInfo ( <nl> SharedFunctionInfo : : ScriptIterator iterator ( <nl> toplevel_fn - > GetIsolate ( ) , Script : : cast ( toplevel_fn - > shared ( ) - > script ( ) ) ) ; <nl> <nl> - while ( SharedFunctionInfo * shared = iterator . Next ( ) ) { <nl> + for ( SharedFunctionInfo shared = iterator . Next ( ) ; ! shared . is_null ( ) ; <nl> + shared = iterator . Next ( ) ) { <nl> std : : unique_ptr < char [ ] > name = String : : cast ( shared - > Name ( ) ) - > ToCString ( ) ; <nl> is_compiled - > insert ( std : : make_pair ( name . get ( ) , shared - > is_compiled ( ) ) ) ; <nl> } <nl> mmm a / test / cctest / test - cpu - profiler . cc <nl> ppp b / test / cctest / test - cpu - profiler . cc <nl> static void TickLines ( bool optimize ) { <nl> <nl> i : : Handle < i : : JSFunction > func = i : : Handle < i : : JSFunction > : : cast ( <nl> v8 : : Utils : : OpenHandle ( * GetFunction ( env . local ( ) , func_name ) ) ) ; <nl> - CHECK ( func - > shared ( ) ) ; <nl> + CHECK ( ! func - > shared ( ) . is_null ( ) ) ; <nl> CHECK ( ! func - > shared ( ) - > abstract_code ( ) . is_null ( ) ) ; <nl> CHECK ( ! optimize | | func - > IsOptimized ( ) | | <nl> ! CcTest : : i_isolate ( ) - > use_optimizer ( ) ) ; <nl> mmm a / test / cctest / test - log . cc <nl> ppp b / test / cctest / test - log . cc <nl> TEST ( Issue539892 ) { <nl> <nl> void CodeMoveEvent ( i : : AbstractCode from , i : : AbstractCode to ) override { } <nl> void CodeDisableOptEvent ( i : : AbstractCode code , <nl> - i : : SharedFunctionInfo * shared ) override { } <nl> + i : : SharedFunctionInfo shared ) override { } <nl> <nl> private : <nl> - void LogRecordedBuffer ( i : : AbstractCode code , i : : SharedFunctionInfo * shared , <nl> + void LogRecordedBuffer ( i : : AbstractCode code , i : : SharedFunctionInfo shared , <nl> const char * name , int length ) override { } <nl> void LogRecordedBuffer ( const i : : wasm : : WasmCode * code , const char * name , <nl> int length ) override { } <nl> mmm a / test / cctest / test - serialize . cc <nl> ppp b / test / cctest / test - serialize . cc <nl> void CheckDeserializedFlag ( v8 : : Local < v8 : : UnboundScript > script ) { <nl> i : : Handle < i : : SharedFunctionInfo > sfi = v8 : : Utils : : OpenHandle ( * script ) ; <nl> i : : SharedFunctionInfo : : ScriptIterator iterator ( sfi - > GetIsolate ( ) , <nl> Script : : cast ( sfi - > script ( ) ) ) ; <nl> - while ( SharedFunctionInfo * next = iterator . Next ( ) ) { <nl> + for ( SharedFunctionInfo next = iterator . Next ( ) ; ! next . is_null ( ) ; <nl> + next = iterator . Next ( ) ) { <nl> CHECK_EQ ( next - > is_compiled ( ) , next - > deserialized ( ) ) ; <nl> } <nl> } <nl>
[ ubsan ] Port SharedFunctionInfo to the new design
v8/v8
81620900e93bf9d2c5c84346b29c0f9ec7d7b28d
2018-11-28T21:23:50Z
mmm a / Code / CryPlugins / CryDefaultEntities / Module / DefaultComponents / Audio / AudioSpotComponent . cpp <nl> ppp b / Code / CryPlugins / CryDefaultEntities / Module / DefaultComponents / Audio / AudioSpotComponent . cpp <nl> void CEntityAudioSpotComponent : : Initialize ( ) <nl> <nl> void CEntityAudioSpotComponent : : OnShutDown ( ) <nl> { <nl> - CRY_ASSERT_MESSAGE ( m_pAudioComp , " Audio proxy was not created " ) ; <nl> - if ( m_auxAudioObjectId ! = CryAudio : : InvalidAuxObjectId & & m_auxAudioObjectId ! = CryAudio : : DefaultAuxObjectId ) <nl> + if ( m_pAudioComp & & m_auxAudioObjectId ! = CryAudio : : InvalidAuxObjectId & & m_auxAudioObjectId ! = CryAudio : : DefaultAuxObjectId ) <nl> { <nl> m_pAudioComp - > RemoveAudioAuxObject ( m_auxAudioObjectId ) ; <nl> } <nl> uint64 CEntityAudioSpotComponent : : GetEventMask ( ) const <nl> <nl> void CEntityAudioSpotComponent : : ProcessEvent ( SEntityEvent & event ) <nl> { <nl> + if ( ! m_pAudioComp ) / / otherwise initialize has not been called yet <nl> + return ; <nl> + <nl> switch ( event . event ) <nl> { <nl> case ENTITY_EVENT_START_GAME : <nl> mmm a / Code / CryPlugins / CryDefaultEntities / Module / DefaultComponents / Audio / AudioSpotComponent . h <nl> ppp b / Code / CryPlugins / CryDefaultEntities / Module / DefaultComponents / Audio / AudioSpotComponent . h <nl> namespace Cry <nl> if ( ! bEnabled ) <nl> { <nl> GetEntity ( ) - > KillTimer ( ' ats ' ) ; <nl> - m_pAudioComp - > StopTrigger ( m_defaultTrigger . m_triggerId , m_auxAudioObjectId ) ; <nl> + if ( m_pAudioComp ) <nl> + { <nl> + m_pAudioComp - > StopTrigger ( m_defaultTrigger . m_triggerId , m_auxAudioObjectId ) ; <nl> + } <nl> } <nl> else <nl> { <nl>
! B ( CE - 12590 ) ( audio ) CRASH : Altering values of AudioSpot used in SCHEM - entity , jump into game and exit crashes
CRYTEK/CRYENGINE
f6ecae5b31594fa82a08c11476edab9c71c8187a
2017-06-08T08:57:55Z
new file mode 100644 <nl> index 0000000000 . . 3272304b92 <nl> mmm / dev / null <nl> ppp b / keywords . txt <nl> <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Syntax Coloring Map <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Datatypes ( KEYWORD1 ) <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Methods and Functions ( KEYWORD2 ) <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + analogWriteFreq KEYWORD2 <nl> + analogWriteRange KEYWORD2 <nl> + baudrate KEYWORD2 <nl> + swap KEYWORD2 <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Constants ( LITERAL1 ) <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + INPUT_PULLDOWN_16 LITERAL1 <nl> + PWMRANGE LITERAL1 <nl>
Minimal file with a few ESP8266 - specific keywords - github issue
esp8266/Arduino
5397813e5cddb0e16b1bc1031b1de7bf031ef5fe
2017-10-22T05:29:38Z
mmm a / data / gui . xml <nl> ppp b / data / gui . xml <nl> <nl> < separator / > <nl> < item command = " Launch " text = " Quick & amp ; Reference " > <nl> < param name = " type " value = " url " / > <nl> - < param name = " path " value = " http : / / aseprite . org / quickref / " / > <nl> + < param name = " path " value = " / quickref / " / > <nl> < / item > <nl> < item command = " Launch " text = " Documentation " > <nl> < param name = " type " value = " url " / > <nl> - < param name = " path " value = " http : / / aseprite . org / docs / " / > <nl> + < param name = " path " value = " / docs / " / > <nl> < / item > <nl> < item command = " Launch " text = " Tutorial " > <nl> < param name = " type " value = " url " / > <nl> - < param name = " path " value = " http : / / aseprite . org / tutorial / " / > <nl> + < param name = " path " value = " / tutorial / " / > <nl> < / item > <nl> < separator / > <nl> < item command = " Launch " text = " Release Notes " > <nl> < param name = " type " value = " url " / > <nl> - < param name = " path " value = " http : / / aseprite . org / release - notes / " / > <nl> + < param name = " path " value = " / release - notes / " / > <nl> < / item > <nl> < item command = " Launch " text = " Twitter " > <nl> < param name = " type " value = " url " / > <nl> <nl> < separator / > <nl> < item command = " Launch " text = " & amp ; Donate " > <nl> < param name = " type " value = " url " / > <nl> - < param name = " path " value = " http : / / aseprite . org / donate / " / > <nl> + < param name = " path " value = " / donate / " / > <nl> < / item > <nl> < item command = " About " text = " & amp ; About " / > <nl> < / menu > <nl> mmm a / src / app / commands / cmd_launch . cpp <nl> ppp b / src / app / commands / cmd_launch . cpp <nl> void LaunchCommand : : onLoadParams ( Params * params ) <nl> m_type = Url ; <nl> <nl> m_path = params - > get ( " path " ) ; <nl> + <nl> + if ( m_type = = Url & & ! m_path . empty ( ) & & m_path [ 0 ] = = ' / ' ) { <nl> + m_path = WEBSITE + m_path . substr ( 1 ) ; <nl> + } <nl> } <nl> <nl> void LaunchCommand : : onExecute ( Context * context ) <nl> mmm a / src / config . h <nl> ppp b / src / config . h <nl> <nl> / / General information <nl> # define PACKAGE " Aseprite " <nl> # define VERSION " 1 . 0 . 0 - dev " <nl> - # define WEBSITE " http : / / aseprite . org / " <nl> + # define WEBSITE " http : / / www . aseprite . org / " <nl> # define WEBSITE_DOWNLOAD WEBSITE " download / " <nl> # define WEBSITE_CONTRIBUTORS WEBSITE " contributors / " <nl> # define COPYRIGHT " Copyright ( C ) 2001 - 2014 David Capello " <nl>
Easier way to reference the program website in commands
aseprite/aseprite
fa204baf42e939117379a18456371b1b280fc3a5
2014-05-06T00:28:58Z
mmm a / . gitignore <nl> ppp b / . gitignore <nl> <nl> Makefile <nl> sqlitebrowser . pro . user <nl> + . qmake . stash <nl> CMakeLists . txt . user <nl> CMakeFiles <nl> * . cmake <nl>
Added . qmake . stash to . gitignore
sqlitebrowser/sqlitebrowser
75e01bff0de8a739d319040ced5e520d32335e44
2016-09-28T16:02:51Z
mmm a / tensorflow / lite / micro / kernels / BUILD <nl> ppp b / tensorflow / lite / micro / kernels / BUILD <nl> tflite_micro_cc_test ( <nl> " arg_min_max_test . cc " , <nl> ] , <nl> deps = [ <nl> + " : kernel_runner " , <nl> " / / tensorflow / lite / c : common " , <nl> " / / tensorflow / lite / micro : op_resolvers " , <nl> " / / tensorflow / lite / micro / testing : micro_test " , <nl> mmm a / tensorflow / lite / micro / kernels / arg_min_max . cc <nl> ppp b / tensorflow / lite / micro / kernels / arg_min_max . cc <nl> limitations under the License . <nl> # include " tensorflow / lite / c / common . h " <nl> # include " tensorflow / lite / kernels / internal / tensor_ctypes . h " <nl> # include " tensorflow / lite / kernels / kernel_util . h " <nl> + # include " tensorflow / lite / micro / kernels / kernel_util . h " <nl> # include " tensorflow / lite / micro / kernels / micro_utils . h " <nl> <nl> namespace tflite { <nl> inline void ArgMinMaxHelper ( const RuntimeShape & input1_shape , <nl> } <nl> <nl> TfLiteStatus Eval ( TfLiteContext * context , TfLiteNode * node , bool is_arg_max ) { <nl> - const TfLiteTensor * input = GetInput ( context , node , kInputTensor ) ; <nl> - const TfLiteTensor * axis = GetInput ( context , node , kAxis ) ; <nl> - TfLiteTensor * output = GetOutput ( context , node , kOutputTensor ) ; <nl> - <nl> - # define TF_LITE_ARG_MIN_MAX ( data_type , axis_type , output_type ) \ <nl> - ArgMinMaxHelper ( GetTensorShape ( input ) , GetTensorData < data_type > ( input ) , \ <nl> - GetTensorData < axis_type > ( axis ) , GetTensorShape ( output ) , \ <nl> - GetTensorData < output_type > ( output ) , is_arg_max ) <nl> + const TfLiteEvalTensor * input = <nl> + tflite : : micro : : GetEvalInput ( context , node , kInputTensor ) ; <nl> + const TfLiteEvalTensor * axis = <nl> + tflite : : micro : : GetEvalInput ( context , node , kAxis ) ; <nl> + TfLiteEvalTensor * output = <nl> + tflite : : micro : : GetEvalOutput ( context , node , kOutputTensor ) ; <nl> + <nl> + # define TF_LITE_ARG_MIN_MAX ( data_type , axis_type , output_type ) \ <nl> + ArgMinMaxHelper ( tflite : : micro : : GetTensorShape ( input ) , \ <nl> + tflite : : micro : : GetTensorData < data_type > ( input ) , \ <nl> + tflite : : micro : : GetTensorData < axis_type > ( axis ) , \ <nl> + tflite : : micro : : GetTensorShape ( output ) , \ <nl> + tflite : : micro : : GetTensorData < output_type > ( output ) , \ <nl> + is_arg_max ) <nl> if ( axis - > type = = kTfLiteInt32 ) { <nl> if ( output - > type = = kTfLiteInt32 ) { <nl> switch ( input - > type ) { <nl> mmm a / tensorflow / lite / micro / kernels / arg_min_max_test . cc <nl> ppp b / tensorflow / lite / micro / kernels / arg_min_max_test . cc <nl> limitations under the License . <nl> # include " tensorflow / lite / c / builtin_op_data . h " <nl> # include " tensorflow / lite / c / common . h " <nl> # include " tensorflow / lite / micro / all_ops_resolver . h " <nl> + # include " tensorflow / lite / micro / kernels / kernel_runner . h " <nl> # include " tensorflow / lite / micro / testing / micro_test . h " <nl> # include " tensorflow / lite / micro / testing / test_utils . h " <nl> <nl> namespace { <nl> void ValidateArgMinMaxGoldens ( TfLiteTensor * tensors , int tensors_size , <nl> const int32_t * golden , int32_t * output , <nl> int output_size , bool using_min ) { <nl> - TfLiteContext context ; <nl> - PopulateContext ( tensors , tensors_size , micro_test : : reporter , & context ) ; <nl> - : : tflite : : AllOpsResolver resolver ; <nl> - const TfLiteRegistration * registration ; <nl> - if ( using_min ) { <nl> - registration = resolver . FindOp ( tflite : : BuiltinOperator_ARG_MIN ) ; <nl> - } else { <nl> - registration = resolver . FindOp ( tflite : : BuiltinOperator_ARG_MAX ) ; <nl> - } <nl> - TF_LITE_MICRO_EXPECT_NE ( nullptr , registration ) ; <nl> - <nl> - size_t init_data_size = 0 ; <nl> - void * user_data = nullptr ; <nl> - if ( registration - > init ) { <nl> - user_data = registration - > init ( & context , nullptr , init_data_size ) ; <nl> - } <nl> int inputs_array_data [ ] = { 2 , 0 , 1 } ; <nl> TfLiteIntArray * inputs_array = IntArrayFromInts ( inputs_array_data ) ; <nl> int outputs_array_data [ ] = { 1 , 2 } ; <nl> TfLiteIntArray * outputs_array = IntArrayFromInts ( outputs_array_data ) ; <nl> - TfLiteNode node ; <nl> - node . inputs = inputs_array ; <nl> - node . outputs = outputs_array ; <nl> - node . user_data = user_data ; <nl> - node . builtin_data = nullptr ; <nl> - node . custom_initial_data = nullptr ; <nl> - node . custom_initial_data_size = 0 ; <nl> - if ( registration - > prepare ) { <nl> - TF_LITE_MICRO_EXPECT_EQ ( kTfLiteOk , registration - > prepare ( & context , & node ) ) ; <nl> - } <nl> - TF_LITE_MICRO_EXPECT_NE ( nullptr , registration - > invoke ) ; <nl> - TF_LITE_MICRO_EXPECT_EQ ( kTfLiteOk , registration - > invoke ( & context , & node ) ) ; <nl> - if ( registration - > free ) { <nl> - registration - > free ( & context , user_data ) ; <nl> - } <nl> + <nl> + const TfLiteRegistration registration = using_min <nl> + ? ops : : micro : : Register_ARG_MIN ( ) <nl> + : ops : : micro : : Register_ARG_MAX ( ) ; <nl> + micro : : KernelRunner runner ( registration , tensors , tensors_size , inputs_array , <nl> + outputs_array , <nl> + / * builtin_data = * / nullptr , micro_test : : reporter ) ; <nl> + <nl> + TF_LITE_MICRO_EXPECT_EQ ( kTfLiteOk , runner . InitAndPrepare ( ) ) ; <nl> + TF_LITE_MICRO_EXPECT_EQ ( kTfLiteOk , runner . Invoke ( ) ) ; <nl> + <nl> for ( int i = 0 ; i < output_size ; + + i ) { <nl> TF_LITE_MICRO_EXPECT_EQ ( golden [ i ] , output [ i ] ) ; <nl> } <nl>
Port the arg min / max kernel to the new TfLiteEvalTensor API .
tensorflow/tensorflow
d7f7908beb64b4fdc19a8eb28f6893e04145069c
2020-07-23T00:46:09Z
mmm a / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 03fa359e8600a122fad1620afffa69e0ba4bedd6 <nl> + Subproject commit 8564148093e8b4a6366e36e97e8f5e97f63843d4 <nl> mmm a / build / deps / github_hashes / facebook / wangle - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / wangle - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 96ff6a8a0cb8651678c46d449b60631e044928fd <nl> + Subproject commit c0a190627f1df73c9067a6d370e8358b1dda4688 <nl>
Updating submodules
facebook/watchman
22ca73ecf16786d1e3ed301ac23f66c5a01e6ed6
2020-12-25T04:22:17Z
mmm a / src / serializer / log / lba / lba_list . cc <nl> ppp b / src / serializer / log / lba / lba_list . cc <nl> bool lba_list_t : : start_existing ( file_t * file , metablock_mixin_t * last_metablock , <nl> } <nl> <nl> block_id_t lba_list_t : : end_block_id ( ) { <nl> - rassert ( state = = state_ready ) ; <nl> + rassert ( state = = state_ready | | state = = state_gc_shutting_down ) ; <nl> <nl> return in_memory_index . end_block_id ( ) ; <nl> } <nl> <nl> index_block_info_t lba_list_t : : get_block_info ( block_id_t block ) { <nl> - rassert ( state = = state_ready ) ; <nl> + rassert ( state = = state_ready | | state = = state_gc_shutting_down ) ; <nl> return in_memory_index . get_block_info ( block ) ; <nl> } <nl> <nl> repli_timestamp_t lba_list_t : : get_block_recency ( block_id_t block ) { <nl> void lba_list_t : : set_block_info ( block_id_t block , repli_timestamp_t recency , <nl> flagged_off64_t offset , uint32_t ser_block_size , <nl> file_account_t * io_account , extent_transaction_t * txn ) { <nl> - rassert ( state = = state_ready ) ; <nl> + rassert ( state = = state_ready | | state = = state_gc_shutting_down ) ; <nl> <nl> in_memory_index . set_block_info ( block , recency , offset , ser_block_size ) ; <nl> <nl> class lba_syncer_t : <nl> } ; <nl> <nl> void lba_list_t : : sync ( file_account_t * io_account , sync_callback_t * cb ) { <nl> - rassert ( state = = state_ready ) ; <nl> + rassert ( state = = state_ready | | state = = state_gc_shutting_down ) ; <nl> <nl> lba_syncer_t * syncer = new lba_syncer_t ( this , io_account ) ; <nl> if ( syncer - > done ) { <nl>
Fixed assertions in LBA .
rethinkdb/rethinkdb
ab4013546a78a0990e351d4df939291e26e5a72e
2014-01-17T05:00:48Z
mmm a / README . md <nl> ppp b / README . md <nl> <nl> # simdjson : Parsing gigabytes of JSON per second <nl> - [ ! [ Build Status ] ( https : / / cloud . drone . io / api / badges / lemire / simdjson / status . svg ) ] ( https : / / cloud . drone . io / lemire / simdjson / ) <nl> + [ ! [ Build Status ] ( https : / / cloud . drone . io / api / badges / simdjson / simdjson / status . svg ) ] ( https : / / cloud . drone . io / simdjson / simdjson ) <nl> [ ! [ CircleCI ] ( https : / / circleci . com / gh / simdjson / simdjson . svg ? style = svg ) ] ( https : / / circleci . com / gh / simdjson / simdjson ) <nl> [ ! [ Build Status ] ( https : / / img . shields . io / appveyor / ci / lemire / simdjson / master . svg ) ] ( https : / / ci . appveyor . com / project / lemire / simdjson ) <nl> [ ! [ ] [ license img ] ] [ license ] <nl>
Updating drone link
simdjson/simdjson
8f1e4018c0a8871be02abd55250c369b5d8d87fd
2020-03-20T20:57:38Z
mmm a / modules / videoio / src / cap_dc1394_v2 . cpp <nl> ppp b / modules / videoio / src / cap_dc1394_v2 . cpp <nl> bool CvCaptureCAM_DC1394_v2_CPP : : startCapture ( ) <nl> DC1394_ISO_SPEED_3200 ) ; <nl> } <nl> <nl> - / / should a specific mode be used <nl> - if ( userMode > = 0 ) <nl> + dc1394video_modes_t videoModes ; <nl> + dc1394_video_get_supported_modes ( dcCam , & videoModes ) ; <nl> <nl> + / / should a specific mode be used <nl> + while ( userMode > = 0 ) / / ' if ' semantic , no real loop here <nl> { <nl> dc1394video_mode_t wantedMode ; <nl> - dc1394video_modes_t videoModes ; <nl> - dc1394_video_get_supported_modes ( dcCam , & videoModes ) ; <nl> - <nl> - / / set mode from number , for example the second supported mode , i . e userMode = 1 <nl> <nl> if ( userMode < ( int ) videoModes . num ) <nl> { <nl> + / / set mode from number , for example the second supported mode , i . e userMode = 1 <nl> wantedMode = videoModes . modes [ userMode ] ; <nl> } <nl> - <nl> - / / set modes directly from DC134 constants ( from dc1394video_mode_t ) <nl> - else if ( ( userMode > = DC1394_VIDEO_MODE_MIN ) & & ( userMode < = DC1394_VIDEO_MODE_MAX ) ) <nl> + else if ( ( userMode > = DC1394_VIDEO_MODE_MIN ) & & ( userMode < = DC1394_VIDEO_MODE_MAX ) ) <nl> { <nl> + / / set modes directly from DC134 constants ( from dc1394video_mode_t ) <nl> + <nl> / / search for wanted mode , to check if camera supports it <nl> int j = 0 ; <nl> - while ( ( j < ( int ) videoModes . num ) & & videoModes . modes [ j ] ! = userMode ) <nl> + while ( ( j < ( int ) videoModes . num ) & & videoModes . modes [ j ] ! = userMode ) <nl> { <nl> j + + ; <nl> } <nl> - <nl> - if ( ( int ) videoModes . modes [ j ] = = userMode ) <nl> - { <nl> - wantedMode = videoModes . modes [ j ] ; <nl> - } <nl> - else <nl> + if ( ! ( j < ( int ) videoModes . num ) ) <nl> { <nl> userMode = - 1 ; / / wanted mode not supported , search for best mode <nl> + break ; <nl> } <nl> + <nl> + wantedMode = videoModes . modes [ j ] ; <nl> } <nl> else <nl> { <nl> - userMode = - 1 ; / / wanted mode not supported , search for best mode <nl> + userMode = - 1 ; / / wanted mode not supported , search for best mode <nl> + break ; <nl> } <nl> + <nl> / / if userMode is available : set it and update size <nl> - if ( userMode ! = - 1 ) <nl> { <nl> code = dc1394_video_set_mode ( dcCam , wantedMode ) ; <nl> - uint32_t width , height ; <nl> + uint32_t width = 0 , height = 0 ; <nl> dc1394_get_image_size_from_video_mode ( dcCam , wantedMode , & width , & height ) ; <nl> frameWidth = ( int ) width ; <nl> frameHeight = ( int ) height ; <nl> } <nl> + break ; <nl> } <nl> <nl> if ( userMode = = - 1 & & ( frameWidth > 0 | | frameHeight > 0 ) ) <nl> { <nl> - dc1394video_mode_t bestMode = ( dc1394video_mode_t ) - 1 ; <nl> - dc1394video_modes_t videoModes ; <nl> - dc1394_video_get_supported_modes ( dcCam , & videoModes ) ; <nl> + dc1394video_mode_t bestMode = ( dc1394video_mode_t ) ( - 1 ) ; <nl> for ( i = 0 ; i < ( int ) videoModes . num ; i + + ) <nl> { <nl> dc1394video_mode_t mode = videoModes . modes [ i ] ; <nl>
videoio ( dc1394_v2 ) : ensure variable initialization
opencv/opencv
f2bb3d0d8062645114e23479ab2352e74330ff01
2020-10-06T21:00:36Z
mmm a / bazel / BUILD <nl> ppp b / bazel / BUILD <nl> config_setting ( <nl> values = { " cpu " : " x64_windows " } , <nl> ) <nl> <nl> + config_setting ( <nl> + name = " linux_ppc " , <nl> + values = { " cpu " : " ppc " } , <nl> + ) <nl> + <nl> config_setting ( <nl> name = " windows_opt_build " , <nl> values = { <nl> mmm a / bazel / repositories . bzl <nl> ppp b / bazel / repositories . bzl <nl> load ( <nl> ) <nl> load ( " @ bazel_tools / / tools / cpp : lib_cc_configure . bzl " , " get_env_var " ) <nl> <nl> + # dict of { build recipe name : longform extension name , } <nl> + PPC_SKIP_TARGETS = { " luajit " : " envoy . filters . http . lua " } <nl> + <nl> def _repository_impl ( name , * * kwargs ) : <nl> # ` existing_rule_keys ` contains the names of repositories that have already <nl> # been defined in the Bazel workspace . By skipping repos with existing keys , <nl> def _repository_impl ( name , * * kwargs ) : <nl> ) <nl> <nl> def _build_recipe_repository_impl ( ctxt ) : <nl> + # modify the recipes list based on the build context <nl> + recipes = _apply_dep_blacklist ( ctxt , ctxt . attr . recipes ) <nl> + <nl> # Setup the build directory with links to the relevant files . <nl> ctxt . symlink ( Label ( " / / bazel : repositories . sh " ) , " repositories . sh " ) <nl> ctxt . symlink ( Label ( " / / bazel : repositories . bat " ) , " repositories . bat " ) <nl> def _build_recipe_repository_impl ( ctxt ) : <nl> ) <nl> ctxt . symlink ( Label ( " / / ci / build_container : recipe_wrapper . sh " ) , " recipe_wrapper . sh " ) <nl> ctxt . symlink ( Label ( " / / ci / build_container : Makefile " ) , " Makefile " ) <nl> - for r in ctxt . attr . recipes : <nl> + for r in recipes : <nl> ctxt . symlink ( <nl> Label ( " / / ci / build_container / build_recipes : " + r + " . sh " ) , <nl> " build_recipes / " + r + " . sh " , <nl> def _build_recipe_repository_impl ( ctxt ) : <nl> env [ " CXX " ] = " cl " <nl> env [ " CXXFLAGS " ] = " - DNDEBUG " <nl> env [ " CFLAGS " ] = " - DNDEBUG " <nl> - command = [ " . / repositories . bat " ] + ctxt . attr . recipes <nl> + command = [ " . / repositories . bat " ] + recipes <nl> else : <nl> - command = [ " . / repositories . sh " ] + ctxt . attr . recipes <nl> + command = [ " . / repositories . sh " ] + recipes <nl> <nl> print ( " Fetching external dependencies . . . " ) <nl> result = ctxt . execute ( <nl> def envoy_dependencies ( path = " @ envoy_deps / / " , skip_targets = [ ] ) : <nl> name = " envoy_deps " , <nl> recipes = recipes . to_list ( ) , <nl> ) <nl> + <nl> for t in TARGET_RECIPES : <nl> if t not in skip_targets : <nl> native . bind ( <nl> def _com_github_google_jwt_verify ( ) : <nl> name = " jwt_verify_lib " , <nl> actual = " @ com_github_google_jwt_verify / / : jwt_verify_lib " , <nl> ) <nl> + <nl> + def _apply_dep_blacklist ( ctxt , recipes ) : <nl> + newlist = [ ] <nl> + skip_list = dict ( ) <nl> + if _is_linux_ppc ( ctxt ) : <nl> + skip_list = PPC_SKIP_TARGETS <nl> + for t in recipes : <nl> + if t not in skip_list . keys ( ) : <nl> + newlist . append ( t ) <nl> + return newlist <nl> + <nl> + def _is_linux_ppc ( ctxt ) : <nl> + if ctxt . os . name ! = " linux " : <nl> + return False <nl> + res = ctxt . execute ( [ " uname " , " - m " ] ) <nl> + return " ppc " in res . stdout <nl> mmm a / source / exe / BUILD <nl> ppp b / source / exe / BUILD <nl> load ( <nl> " envoy_all_extensions " , <nl> " envoy_windows_extensions " , <nl> ) <nl> + load ( " / / bazel : repositories . bzl " , " PPC_SKIP_TARGETS " ) <nl> <nl> envoy_package ( ) <nl> <nl> envoy_cc_library ( <nl> " / / source / server : test_hooks_lib " , <nl> ] + select ( { <nl> " / / bazel : windows_x86_64 " : envoy_windows_extensions ( ) , <nl> + " / / bazel : linux_ppc " : envoy_all_extensions ( PPC_SKIP_TARGETS ) , <nl> " / / conditions : default " : envoy_all_extensions ( ) , <nl> } ) , <nl> ) <nl> mmm a / source / extensions / all_extensions . bzl <nl> ppp b / source / extensions / all_extensions . bzl <nl> <nl> load ( " @ envoy_build_config / / : extensions_build_config . bzl " , " EXTENSIONS " , " WINDOWS_EXTENSIONS " ) <nl> <nl> # Return all extensions to be compiled into Envoy . <nl> - def envoy_all_extensions ( ) : <nl> + def envoy_all_extensions ( blacklist = dict ( ) ) : <nl> # These extensions are registered using the extension system but are required for the core <nl> # Envoy build . <nl> all_extensions = [ <nl> def envoy_all_extensions ( ) : <nl> ] <nl> <nl> # These extensions can be removed on a site specific basis . <nl> - for path in EXTENSIONS . values ( ) : <nl> - all_extensions . append ( path ) <nl> + for name , path in EXTENSIONS . items ( ) : <nl> + if not name in blacklist . values ( ) : <nl> + all_extensions . append ( path ) <nl> <nl> return all_extensions <nl> <nl>
ppc64le build ( )
envoyproxy/envoy
2d155f901da9371e51c012aab56703e06ac9d74d
2018-09-04T22:20:59Z
mmm a / Installation / release . sh <nl> ppp b / Installation / release . sh <nl> else <nl> fi <nl> <nl> ( cd enterprise ; git checkout master ; git fetch - - tags ; git pull - - all ; git checkout $ { GITARGS } ; git pull ) <nl> - git pull - - tags <nl> + git fetch - - tags <nl> <nl> <nl> # shellcheck disable = SC2002 <nl>
tags are fetched , not pulled
arangodb/arangodb
4a65419090541a5b7b72d65e868393582293db13
2018-08-28T15:21:14Z
mmm a / tensorflow / compiler / xla / service / hlo_evaluator_typed_visitor . h <nl> ppp b / tensorflow / compiler / xla / service / hlo_evaluator_typed_visitor . h <nl> class HloEvaluatorTypedVisitor : public DfsHloVisitorWithDefault { <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - Status HandleDivide ( HloInstruction * divide ) override { <nl> + template < <nl> + typename NativeT , <nl> + typename std : : enable_if < std : : is_floating_point < NativeT > : : value | | <nl> + is_complex_t < NativeT > : : value > : : type * = nullptr > <nl> + Status HandleDivide ( HloInstruction * divide ) { <nl> TF_ASSIGN_OR_RETURN ( parent_ - > evaluated_ [ divide ] , <nl> ElementWiseBinaryOp ( divide , [ ] ( ElementwiseT lhs_elem , <nl> ElementwiseT rhs_elem ) { <nl> class HloEvaluatorTypedVisitor : public DfsHloVisitorWithDefault { <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + template < typename NativeT , <nl> + typename std : : enable_if < std : : is_signed < NativeT > : : value & & <nl> + std : : is_integral < NativeT > : : value > : : type * = <nl> + nullptr > <nl> + Status HandleDivide ( HloInstruction * divide ) { <nl> + TF_ASSIGN_OR_RETURN ( <nl> + parent_ - > evaluated_ [ divide ] , <nl> + ElementWiseBinaryOp ( <nl> + divide , <nl> + [ ] ( ElementwiseT lhs_elem , ElementwiseT rhs_elem ) - > ElementwiseT { <nl> + if ( rhs_elem = = 0 ) { <nl> + return static_cast < ElementwiseT > ( - 1 ) ; <nl> + } <nl> + if ( rhs_elem = = - 1 & & <nl> + lhs_elem = = std : : numeric_limits < ElementwiseT > : : min ( ) ) { <nl> + return lhs_elem ; <nl> + } <nl> + return lhs_elem / rhs_elem ; <nl> + } ) ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + template < typename NativeT , <nl> + typename std : : enable_if < std : : is_unsigned < NativeT > : : value > : : type * = <nl> + nullptr > <nl> + Status HandleDivide ( HloInstruction * divide ) { <nl> + TF_ASSIGN_OR_RETURN ( parent_ - > evaluated_ [ divide ] , <nl> + ElementWiseBinaryOp ( divide , [ ] ( ElementwiseT lhs_elem , <nl> + ElementwiseT rhs_elem ) { <nl> + return rhs_elem = = 0 <nl> + ? std : : numeric_limits < ElementwiseT > : : max ( ) <nl> + : ( lhs_elem / rhs_elem ) ; <nl> + } ) ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + Status HandleDivide ( HloInstruction * divide ) { <nl> + return HandleDivide < ElementwiseT > ( divide ) ; <nl> + } <nl> + <nl> template < typename NativeT , <nl> typename std : : enable_if < std : : is_integral < NativeT > : : value > : : type * = <nl> nullptr > <nl> class HloEvaluatorTypedVisitor : public DfsHloVisitorWithDefault { <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - template < <nl> - typename NativeT , <nl> - typename std : : enable_if < ! is_complex_t < NativeT > : : value > : : type * = nullptr > <nl> + template < typename NativeT , typename std : : enable_if < std : : is_floating_point < <nl> + NativeT > : : value > : : type * = nullptr > <nl> Status HandleRemainder ( HloInstruction * remainder ) { <nl> TF_ASSIGN_OR_RETURN ( parent_ - > evaluated_ [ remainder ] , <nl> ElementWiseBinaryOp ( remainder , [ ] ( ElementwiseT lhs_el , <nl> class HloEvaluatorTypedVisitor : public DfsHloVisitorWithDefault { <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + template < typename NativeT , <nl> + typename std : : enable_if < std : : is_unsigned < NativeT > : : value > : : type * = <nl> + nullptr > <nl> + Status HandleRemainder ( HloInstruction * remainder ) { <nl> + TF_ASSIGN_OR_RETURN ( parent_ - > evaluated_ [ remainder ] , <nl> + ElementWiseBinaryOp ( remainder , [ ] ( ElementwiseT lhs_el , <nl> + ElementwiseT rhs_el ) { <nl> + return rhs_el = = 0 ? lhs_el : ( lhs_el % rhs_el ) ; <nl> + } ) ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + template < typename NativeT , <nl> + typename std : : enable_if < std : : is_signed < NativeT > : : value & & <nl> + std : : is_integral < NativeT > : : value > : : type * = <nl> + nullptr > <nl> + Status HandleRemainder ( HloInstruction * remainder ) { <nl> + TF_ASSIGN_OR_RETURN ( <nl> + parent_ - > evaluated_ [ remainder ] , <nl> + ElementWiseBinaryOp ( <nl> + remainder , <nl> + [ ] ( ElementwiseT lhs_el , ElementwiseT rhs_el ) - > ElementwiseT { <nl> + if ( rhs_el = = 0 ) { <nl> + return lhs_el ; <nl> + } <nl> + if ( rhs_el = = - 1 & & <nl> + lhs_el = = std : : numeric_limits < ElementwiseT > : : min ( ) ) { <nl> + return 0 ; <nl> + } <nl> + return lhs_el % rhs_el ; <nl> + } ) ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> template < <nl> typename NativeT , <nl> typename std : : enable_if < is_complex_t < NativeT > : : value > : : type * = nullptr > <nl> mmm a / tensorflow / compiler / xla / tests / array_elementwise_ops_test . cc <nl> ppp b / tensorflow / compiler / xla / tests / array_elementwise_ops_test . cc <nl> limitations under the License . <nl> # include " tensorflow / compiler / xla / types . h " <nl> # include " tensorflow / compiler / xla / xla_data . pb . h " <nl> # include " tensorflow / core / lib / core / casts . h " <nl> + # include " tensorflow / core / lib / gtl / array_slice . h " <nl> # include " tensorflow / core / platform / types . h " <nl> <nl> namespace xla { <nl> namespace { <nl> <nl> + using tensorflow : : gtl : : ArraySlice ; <nl> + <nl> class ArrayElementwiseOpTest : public ClientLibraryTestBase { <nl> public : <nl> ErrorSpec error_spec_ { 0 . 0001 , 0 . 0001 } ; <nl> XLA_TEST_F ( ArrayElementwiseOpTest , DivTwoConstantZeroElementF32s ) { <nl> ComputeAndCompareR1 < float > ( & builder , { } , { } , error_spec_ ) ; <nl> } <nl> <nl> - XLA_TEST_F ( ArrayElementwiseOpTest , DivS32s ) { <nl> + class IntegerDivideOpTest : public ArrayElementwiseOpTest { <nl> + protected : <nl> + template < typename T > <nl> + void TestDivRem ( ArraySlice < T > dividends , ArraySlice < T > divisors , <nl> + ArraySlice < T > quotients , ArraySlice < T > remainders ) { <nl> + { <nl> + XlaBuilder builder ( TestName ( ) ) ; <nl> + XlaOp dividend ; <nl> + XlaOp divisor ; <nl> + auto dividend_data = <nl> + CreateR1Parameter < T > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> + auto divisor_data = <nl> + CreateR1Parameter < T > ( divisors , 1 , " divisor " , & builder , & divisor ) ; <nl> + Div ( dividend , divisor ) ; <nl> + <nl> + ComputeAndCompareR1 < T > ( & builder , quotients , <nl> + { dividend_data . get ( ) , divisor_data . get ( ) } ) ; <nl> + } <nl> + <nl> + / / Test with a compile - time constant divisor . <nl> + { <nl> + XlaBuilder builder ( TestName ( ) ) ; <nl> + XlaOp dividend ; <nl> + auto dividend_data = <nl> + CreateR1Parameter < T > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> + Div ( dividend , ConstantR1 < T > ( & builder , divisors ) ) ; <nl> + <nl> + ComputeAndCompareR1 < T > ( & builder , quotients , { dividend_data . get ( ) } ) ; <nl> + } <nl> + <nl> + { <nl> + XlaBuilder builder ( TestName ( ) ) ; <nl> + XlaOp dividend ; <nl> + XlaOp divisor ; <nl> + auto dividend_data = <nl> + CreateR1Parameter < T > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> + auto divisor_data = <nl> + CreateR1Parameter < T > ( divisors , 1 , " divisor " , & builder , & divisor ) ; <nl> + Rem ( dividend , divisor ) ; <nl> + <nl> + ComputeAndCompareR1 < T > ( & builder , remainders , <nl> + { dividend_data . get ( ) , divisor_data . get ( ) } ) ; <nl> + } <nl> + <nl> + / / Test with a compile - time constant divisor . <nl> + { <nl> + XlaBuilder builder ( TestName ( ) ) ; <nl> + XlaOp dividend ; <nl> + auto dividend_data = <nl> + CreateR1Parameter < T > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> + Rem ( dividend , ConstantR1 < T > ( & builder , divisors ) ) ; <nl> + <nl> + ComputeAndCompareR1 < T > ( & builder , remainders , { dividend_data . get ( ) } ) ; <nl> + } <nl> + } <nl> + } ; <nl> + <nl> + XLA_TEST_F ( IntegerDivideOpTest , DivS32s ) { <nl> / / clang - format off <nl> / / Some interesting values to test . <nl> std : : vector < int32 > vals = { <nl> XLA_TEST_F ( ArrayElementwiseOpTest , DivS32s ) { <nl> } <nl> } <nl> <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - XlaOp divisor ; <nl> - auto dividend_data = <nl> - CreateR1Parameter < int32 > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> - auto divisor_data = <nl> - CreateR1Parameter < int32 > ( divisors , 1 , " divisor " , & builder , & divisor ) ; <nl> - Div ( dividend , divisor ) ; <nl> - <nl> - ComputeAndCompareR1 < int32 > ( & builder , quotients , <nl> - { dividend_data . get ( ) , divisor_data . get ( ) } ) ; <nl> - } <nl> - <nl> - / / Test with a compile - time constant divisor . <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - auto dividend_data = <nl> - CreateR1Parameter < int32 > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> - Div ( dividend , ConstantR1 < int32 > ( & builder , divisors ) ) ; <nl> - <nl> - ComputeAndCompareR1 < int32 > ( & builder , quotients , { dividend_data . get ( ) } ) ; <nl> - } <nl> - <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - XlaOp divisor ; <nl> - auto dividend_data = <nl> - CreateR1Parameter < int32 > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> - auto divisor_data = <nl> - CreateR1Parameter < int32 > ( divisors , 1 , " divisor " , & builder , & divisor ) ; <nl> - Rem ( dividend , divisor ) ; <nl> - <nl> - ComputeAndCompareR1 < int32 > ( & builder , remainders , <nl> - { dividend_data . get ( ) , divisor_data . get ( ) } ) ; <nl> - } <nl> + TestDivRem < int32 > ( dividends , divisors , quotients , remainders ) ; <nl> + } <nl> <nl> - / / Test with a compile - time constant divisor . <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - auto dividend_data = <nl> - CreateR1Parameter < int32 > ( dividends , 0 , " dividend " , & builder , & dividend ) ; <nl> - Rem ( dividend , ConstantR1 < int32 > ( & builder , divisors ) ) ; <nl> + XLA_TEST_F ( IntegerDivideOpTest , <nl> + DISABLED_ON_CPU ( DISABLED_ON_GPU ( SignedOverflow ) ) ) { <nl> + std : : vector < int32 > dividends = { 5 , INT32_MIN } , divisors = { 0 , - 1 } , <nl> + quotients = { - 1 , INT32_MIN } , remainders = { 5 , 0 } ; <nl> <nl> - ComputeAndCompareR1 < int32 > ( & builder , remainders , { dividend_data . get ( ) } ) ; <nl> - } <nl> + TestDivRem < int32 > ( dividends , divisors , quotients , remainders ) ; <nl> } <nl> <nl> - XLA_TEST_F ( ArrayElementwiseOpTest , DivU32s ) { <nl> + XLA_TEST_F ( IntegerDivideOpTest , DivU32s ) { <nl> / / clang - format off <nl> / / Some interesting values to test . <nl> std : : vector < uint32 > vals = { <nl> XLA_TEST_F ( ArrayElementwiseOpTest , DivU32s ) { <nl> } <nl> } <nl> <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - XlaOp divisor ; <nl> - auto dividend_data = CreateR1Parameter < uint32 > ( dividends , 0 , " dividend " , <nl> - & builder , & dividend ) ; <nl> - auto divisor_data = <nl> - CreateR1Parameter < uint32 > ( divisors , 1 , " divisor " , & builder , & divisor ) ; <nl> - Div ( dividend , divisor ) ; <nl> - <nl> - ComputeAndCompareR1 < uint32 > ( & builder , quotients , <nl> - { dividend_data . get ( ) , divisor_data . get ( ) } ) ; <nl> - } <nl> - <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - auto dividend_data = CreateR1Parameter < uint32 > ( dividends , 0 , " dividend " , <nl> - & builder , & dividend ) ; <nl> - Div ( dividend , ConstantR1 < uint32 > ( & builder , divisors ) ) ; <nl> - <nl> - ComputeAndCompareR1 < uint32 > ( & builder , quotients , { dividend_data . get ( ) } ) ; <nl> - } <nl> - <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - XlaOp divisor ; <nl> - auto dividend_data = CreateR1Parameter < uint32 > ( dividends , 0 , " dividend " , <nl> - & builder , & dividend ) ; <nl> - auto divisor_data = <nl> - CreateR1Parameter < uint32 > ( divisors , 1 , " divisor " , & builder , & divisor ) ; <nl> - Rem ( dividend , divisor ) ; <nl> - <nl> - ComputeAndCompareR1 < uint32 > ( & builder , remainders , <nl> - { dividend_data . get ( ) , divisor_data . get ( ) } ) ; <nl> - } <nl> + TestDivRem < uint32 > ( dividends , divisors , quotients , remainders ) ; <nl> + } <nl> <nl> - { <nl> - XlaBuilder builder ( TestName ( ) ) ; <nl> - XlaOp dividend ; <nl> - auto dividend_data = CreateR1Parameter < uint32 > ( dividends , 0 , " dividend " , <nl> - & builder , & dividend ) ; <nl> - Rem ( dividend , ConstantR1 < uint32 > ( & builder , divisors ) ) ; <nl> + XLA_TEST_F ( IntegerDivideOpTest , <nl> + DISABLED_ON_CPU ( DISABLED_ON_GPU ( UnsignedOverflow ) ) ) { <nl> + std : : vector < int32 > dividends = { 5 } , divisors = { 0 } , quotients = { - 1 } , <nl> + remainders = { 5 } ; <nl> <nl> - ComputeAndCompareR1 < uint32 > ( & builder , remainders , { dividend_data . get ( ) } ) ; <nl> - } <nl> + TestDivRem < int32 > ( dividends , divisors , quotients , remainders ) ; <nl> } <nl> <nl> XLA_TEST_F ( ArrayElementwiseOpTest , DivTwoConstantC64s ) { <nl>
[ XLA ] Define integer division overflow
tensorflow/tensorflow
b18cbef5772abd61d841b2b765f3a203f8616f2e
2018-08-22T03:07:31Z
mmm a / modules / python / test / test2 . py <nl> ppp b / modules / python / test / test2 . py <nl> <nl> <nl> import unittest <nl> import random <nl> - import urllib <nl> + import urllib2 <nl> import hashlib <nl> import numpy as np <nl> import cv2 <nl> class NewOpenCVTests ( unittest . TestCase ) : <nl> <nl> def get_sample ( self , filename , iscolor = cv . CV_LOAD_IMAGE_COLOR ) : <nl> if not filename in self . image_cache : <nl> - filedata = urllib . urlopen ( " https : / / raw . github . com / Itseez / opencv / 2 . 4 / " + filename ) . read ( ) <nl> + filedata = urllib2 . urlopen ( " https : / / raw . github . com / Itseez / opencv / 2 . 4 / " + filename ) . read ( ) <nl> image = cv2 . imdecode ( np . fromstring ( filedata , dtype = np . uint8 ) , iscolor ) <nl> self . assertFalse ( image is None ) <nl> self . image_cache [ filename ] = image <nl>
test2 . py : switch from urllib to urllib2
opencv/opencv
08ad3b500b8d458a12dbe78909bd9956dfe3e479
2015-09-17T15:24:30Z
mmm a / . github / workflows / ccpp_cmake . yml <nl> ppp b / . github / workflows / ccpp_cmake . yml <nl> <nl> - name : libswoole <nl> + name : lib - swoole <nl> <nl> on : [ push ] <nl> <nl> jobs : <nl> <nl> steps : <nl> - uses : actions / checkout @ v1 <nl> + - name : configure <nl> + run : phpize & & . / configure - - enable - sockets - - enable - mysqlnd - - enable - http2 - - enable - debug - log <nl> - name : cmake <nl> run : cmake . <nl> - name : make <nl>
Update ccpp_cmake . yml
swoole/swoole-src
8dd3428ba6877c5112573a2a264793f5ba01c413
2019-11-26T00:46:17Z
mmm a / src / clustering / administration / main / serve . cc <nl> ppp b / src / clustering / administration / main / serve . cc <nl> <nl> # include " clustering / administration / main / initial_join . hpp " <nl> # include " clustering / administration / main / ports . hpp " <nl> # include " clustering / administration / main / watchable_fields . hpp " <nl> + # include " clustering / administration / main / version_check . hpp " <nl> # include " clustering / administration / metadata . hpp " <nl> # include " clustering / administration / perfmon_collection_repo . hpp " <nl> # include " clustering / administration / persist . hpp " <nl> bool do_serve ( io_backender_t * io_backender , <nl> logNTC ( " Proxy ready " ) ; <nl> } <nl> <nl> + / / XXX here is where version checking should occur ? <nl> + cond_t version_cond ; <nl> + version_checker_t checker ( & rdb_ctx , & version_cond ) ; <nl> + checker . initial_check ( ) ; <nl> + timer_token_t * timer = add_timer ( 1000 , & checker ) ; <nl> + <nl> stop_cond - > wait_lazily_unordered ( ) ; <nl> <nl> + cancel_timer ( timer ) ; <nl> + <nl> <nl> if ( stop_cond - > get_source_signo ( ) = = SIGINT ) { <nl> logNTC ( " Server got SIGINT from pid % d , uid % d ; shutting down . . . \ n " , <nl> new file mode 100644 <nl> index 00000000000 . . 82e4b0e75a2 <nl> mmm / dev / null <nl> ppp b / src / clustering / administration / main / version_check . cc <nl> <nl> + / / Copyright 2010 - 2014 RethinkDB , all rights reserved . <nl> + # include " clustering / administration / main / version_check . hpp " <nl> + <nl> + # include < math . h > <nl> + <nl> + # include " logger . hpp " <nl> + <nl> + # include " clustering / administration / metadata . hpp " <nl> + # include " extproc / http_runner . hpp " <nl> + # include " rdb_protocol / env . hpp " <nl> + <nl> + std : : string uname_msr ( ) ; <nl> + namespace ql { <nl> + void dispatch_http ( ql : : env_t * env , <nl> + const http_opts_t & opts , <nl> + http_runner_t * runner , <nl> + http_result_t * res_out , <nl> + const ql : : pb_rcheckable_t * parent ) ; <nl> + } ; <nl> + <nl> + version_checker_t : : version_checker_t ( rdb_context_t * _rdb_ctx , signal_t * _interruptor ) : <nl> + rdb_ctx ( _rdb_ctx ) , <nl> + interruptor ( _interruptor ) , <nl> + seen_version ( ) { <nl> + rassert ( rdb_ctx ! = NULL ) ; <nl> + } <nl> + <nl> + void version_checker_t : : initial_check ( ) { <nl> + logINF ( " Beginning initial checkin " ) ; <nl> + <nl> + ql : : env_t env ( rdb_ctx , interruptor , std : : map < std : : string , ql : : wire_func_t > ( ) , nullptr ) ; <nl> + http_opts_t opts ; <nl> + opts . limits = env . limits ( ) ; <nl> + opts . result_format = http_result_format_t : : JSON ; <nl> + opts . url = strprintf ( " http : / / update . rethinkdb . com / update_for / % s " , <nl> + RETHINKDB_VERSION ) ; <nl> + <nl> + http_runner_t runner ( env . get_extproc_pool ( ) ) ; <nl> + http_result_t result ; <nl> + <nl> + dispatch_http ( & env , opts , & runner , & result , nullptr ) ; <nl> + <nl> + process_result ( result ) ; <nl> + } <nl> + <nl> + void version_checker_t : : periodic_checkin ( ) { <nl> + logINF ( " Beginning periodic checkin " ) ; <nl> + <nl> + const cluster_semilattice_metadata_t metadata ; / / = xxx ; <nl> + ql : : env_t env ( rdb_ctx , interruptor , std : : map < std : : string , ql : : wire_func_t > ( ) , nullptr ) ; <nl> + http_opts_t opts ; <nl> + opts . method = http_method_t : : POST ; <nl> + opts . limits = env . limits ( ) ; <nl> + opts . result_format = http_result_format_t : : JSON ; <nl> + opts . url = " http : / / update . rethinkdb . com / checkin " ; <nl> + opts . header . push_back ( " Content - Type : application / x - www - form - urlencoded " ) ; <nl> + opts . form_data [ " Version " ] = RETHINKDB_VERSION ; <nl> + opts . form_data [ " Number - Of - Servers " ] = metadata . servers . servers . size ( ) ; <nl> + opts . form_data [ " Uname " ] = uname_msr ( ) ; <nl> + int tables = 0 ; <nl> + for ( auto it = metadata . rdb_namespaces - > namespaces . begin ( ) ; <nl> + it ! = metadata . rdb_namespaces - > namespaces . end ( ) ; + + it ) { <nl> + auto pair = * it ; <nl> + tables + + ; <nl> + } <nl> + opts . form_data [ " Cooked - Number - Of - Tables " ] <nl> + = strprintf ( " % " PR_RECONSTRUCTABLE_DOUBLE , <nl> + cook ( metadata . databases . databases . size ( ) ) ) ; <nl> + opts . form_data [ " Cooked - Size - Of - Shards " ] <nl> + = strprintf ( " % " PR_RECONSTRUCTABLE_DOUBLE , cook ( 0 . 0 ) ) ; / / XXX <nl> + <nl> + http_runner_t runner ( env . get_extproc_pool ( ) ) ; <nl> + http_result_t result ; <nl> + <nl> + dispatch_http ( & env , opts , & runner , & result , nullptr ) ; <nl> + <nl> + process_result ( result ) ; <nl> + } <nl> + <nl> + / / sort of anonymize the input ; specifically we want $ 2 ^ ( round ( log_2 ( n ) ) ) $ <nl> + double version_checker_t : : cook ( double n ) { <nl> + return exp2 ( round ( log2 ( n ) ) ) ; <nl> + } <nl> + <nl> + void version_checker_t : : process_result ( const http_result_t & result ) { <nl> + if ( ! result . error . empty ( ) ) { <nl> + logWRN ( " Experienced protocol error attempting to check for updates : saw % s " , <nl> + result . error . c_str ( ) ) ; <nl> + return ; <nl> + } <nl> + <nl> + rassert ( result . body . has ( ) ) ; <nl> + ql : : datum_t status = result . body . get_field ( " status " , ql : : NOTHROW ) ; <nl> + if ( ! status . has ( ) ) { <nl> + logWRN ( " Got bizarre result from checking for updates ; ignoring . " ) ; <nl> + logDBG ( " Saw invalid datum % s ; headers are % s " , <nl> + result . body . trunc_print ( ) . c_str ( ) , result . header . trunc_print ( ) . c_str ( ) ) ; <nl> + return ; <nl> + } else if ( status . get_type ( ) ! = ql : : datum_t : : R_STR ) { <nl> + logWRN ( " Got malformed result from checking for updates ; ignoring . " ) ; <nl> + logDBG ( " Saw invalid status field % s ; datum % s ; headers are % s " , <nl> + status . trunc_print ( ) . c_str ( ) , result . body . trunc_print ( ) . c_str ( ) , <nl> + result . header . trunc_print ( ) . c_str ( ) ) ; <nl> + return ; <nl> + } <nl> + const datum_string_t & str = status . as_str ( ) ; <nl> + if ( str = = " ok " ) { <nl> + logINF ( " Server up - to - date " ) ; <nl> + } else if ( str = = " error " ) { <nl> + ql : : datum_t reason = result . body . get_field ( " error " , ql : : NOTHROW ) ; <nl> + if ( ! reason . has ( ) | | reason . get_type ( ) ! = ql : : datum_t : : R_STR ) { <nl> + logWRN ( " Remote server had some kind of problem : % s " , <nl> + result . body . trunc_print ( ) . c_str ( ) ) ; <nl> + } else { <nl> + logWRN ( " Remote server returned error message % s when checking for updates . " , <nl> + reason . trunc_print ( ) . c_str ( ) ) ; <nl> + } <nl> + } else if ( str = = " need_update " ) { <nl> + ql : : datum_t new_version = result . body . get_field ( " last_version " , ql : : NOTHROW ) ; <nl> + if ( ! new_version . has ( ) | | new_version . get_type ( ) ! = ql : : datum_t : : R_STR ) { <nl> + logWRN ( " Remote server had some kind of problem : % s " , <nl> + result . body . trunc_print ( ) . c_str ( ) ) ; <nl> + } else if ( seen_version ! = new_version . as_str ( ) ) { <nl> + logNTC ( " New server version available : % s " , new_version . trunc_print ( ) . c_str ( ) ) ; <nl> + ql : : datum_t changelog = result . body . get_field ( " link_changelog " , ql : : NOTHROW ) ; <nl> + if ( changelog . has ( ) & & changelog . get_type ( ) = = ql : : datum_t : : R_STR ) { <nl> + logNTC ( " Changelog URL : % s " , changelog . trunc_print ( ) . c_str ( ) ) ; <nl> + } <nl> + seen_version = new_version . as_str ( ) ; <nl> + } else { <nl> + / / already logged an update for that version , so no point <nl> + / / in spamming them . <nl> + } <nl> + } else { <nl> + logWRN ( " Remote server gave a status code I don ' t understand : % s " , <nl> + result . body . trunc_print ( ) . c_str ( ) ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . ce403491d3a <nl> mmm / dev / null <nl> ppp b / src / clustering / administration / main / version_check . hpp <nl> <nl> + / / Copyright 2010 - 2014 RethinkDB , all rights reserved . <nl> + # ifndef CLUSTERING_ADMINISTRATION_MAIN_VERSION_CHECK_HPP_ <nl> + # define CLUSTERING_ADMINISTRATION_MAIN_VERSION_CHECK_HPP_ <nl> + <nl> + # include " rdb_protocol / context . hpp " <nl> + # include " arch / timer . hpp " <nl> + <nl> + struct http_result_t ; <nl> + <nl> + class version_checker_t : public timer_callback_t { <nl> + public : <nl> + version_checker_t ( rdb_context_t * , signal_t * ) ; <nl> + void initial_check ( ) ; <nl> + void periodic_checkin ( ) ; <nl> + virtual void on_timer ( ) { periodic_checkin ( ) ; } <nl> + private : <nl> + void process_result ( const http_result_t & ) ; <nl> + double cook ( double ) ; <nl> + <nl> + rdb_context_t * rdb_ctx ; <nl> + signal_t * interruptor ; <nl> + datum_string_t seen_version ; <nl> + } ; <nl> + <nl> + # endif / * CLUSTERING_ADMINISTRATION_MAIN_VERSION_CHECK_HPP_ * / <nl> mmm a / src / rdb_protocol / terms / http . cc <nl> ppp b / src / rdb_protocol / terms / http . cc <nl> void check_error_result ( const http_result_t & res , <nl> / / Any error coming back from the extproc may be due to the fragility of <nl> / / interfacing with external servers . Provide a non - existence error so that <nl> / / users may call ` r . default ` for more robustness . <nl> - rfail_target ( parent , base_exc_t : : NON_EXISTENCE , <nl> - " % s " , error_string . c_str ( ) ) ; <nl> + if ( parent = = nullptr ) { <nl> + rfail_datum ( base_exc_t : : NON_EXISTENCE , " % s " , error_string . c_str ( ) ) ; <nl> + } else { <nl> + rfail_target ( parent , base_exc_t : : NON_EXISTENCE , <nl> + " % s " , error_string . c_str ( ) ) ; <nl> + } <nl> } <nl> } <nl> <nl>
Save stuff for later
rethinkdb/rethinkdb
ee5b543d411a9434ad1cbb12cb751cdd2072e7b1
2014-12-23T03:05:07Z
mmm a / tools / autodebugger . py <nl> ppp b / tools / autodebugger . py <nl> <nl> in_func = False <nl> index = i + 1 + lines_added <nl> pre = ' call void @ emscripten_autodebug_i32 ( i32 - 1 , i32 % d ) ' % index <nl> + elif lines [ i ] . startswith ( ' ret ' ) : <nl> + # This is a good place to mark entry to this function <nl> + index = i + 1 + lines_added <nl> + pre = ' call void @ emscripten_autodebug_i32 ( i32 - 2 , i32 % d ) ' % index <nl> <nl> m = re . match ( ' store ( ? P < type > i64 | i32 | i16 | i8 | float | double | % ? [ \ w \ . \ * ] + ) ( ? P < var > % ? [ \ w . + _ ] + ) , . * ' , lines [ i ] ) <nl> if m : <nl>
add function exits to autodebugger
emscripten-core/emscripten
2494c26ae0294de160a51c8347e1bbe4a438918e
2012-02-07T02:12:13Z
mmm a / native_client / definitions . mk <nl> ppp b / native_client / definitions . mk <nl> endif <nl> endif <nl> <nl> ifeq ( $ ( TARGET ) , rpi3 ) <nl> - TOOLCHAIN ? = $ { TFDIR } / bazel - $ ( shell basename " $ { TFDIR } " ) / external / GccArmRpi / arm - bcm2708 / arm - rpi - 4 . 9 . 3 - linux - gnueabihf / bin / arm - linux - gnueabihf - <nl> - RASPBIAN ? = $ ( abspath $ ( NC_DIR ) / . . / multistrap - raspbian - jessie ) <nl> - CFLAGS : = - isystem $ ( RASPBIAN ) / usr / include - isystem $ ( RASPBIAN ) / usr / include / arm - linux - gnueabihf <nl> - LDFLAGS : = - Wl , - rpath - link , $ ( RASPBIAN ) / lib / arm - linux - gnueabihf - Wl , - rpath - link , $ ( RASPBIAN ) / usr / lib / arm - linux - gnueabihf / <nl> + TOOLCHAIN ? = $ { TFDIR } / bazel - $ ( shell basename " $ { TFDIR } " ) / external / LinaroArmGcc72 / bin / arm - linux - gnueabihf - <nl> + RASPBIAN ? = $ ( abspath $ ( NC_DIR ) / . . / multistrap - raspbian - stretch ) <nl> + CFLAGS : = - D_GLIBCXX_USE_CXX11_ABI = 0 - isystem $ ( RASPBIAN ) / usr / include - isystem $ ( RASPBIAN ) / usr / include / arm - linux - gnueabihf <nl> + LDFLAGS : = $ ( RASPBIAN ) / lib / arm - linux - gnueabihf / libc . so . 6 - Wl , - rpath - link , $ ( RASPBIAN ) / lib / arm - linux - gnueabihf / - Wl , - rpath - link , $ ( RASPBIAN ) / usr / lib / arm - linux - gnueabihf / <nl> <nl> SOX_CFLAGS : = <nl> SOX_LDFLAGS : = $ ( RASPBIAN ) / usr / lib / arm - linux - gnueabihf / libsox . so <nl> mmm a / native_client / multistrap . conf <nl> ppp b / native_client / multistrap . conf <nl> aptsources = Raspbian <nl> cleanup = true <nl> <nl> [ Raspbian ] <nl> - packages = libc6 - dev libpython2 . 7 - dev libpython3 . 4 - dev libsox - dev python - numpy <nl> + packages = libc6 libc6 - dev libstdc + + - 6 - dev linux - libc - dev libpython2 . 7 - dev libpython3 . 4 - dev libsox - dev python - numpy <nl> source = http : / / mirrordirector . raspbian . org / raspbian / <nl> keyring = raspbian - archive - keyring <nl> components = main <nl> - suite = jessie <nl> + suite = stretch <nl> mmm a / taskcluster / darwin - amd64 - cpu - aot_prod - opt . yml <nl> ppp b / taskcluster / darwin - amd64 - cpu - aot_prod - opt . yml <nl> build : <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . osx_aot " <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . $ { event . head . sha } . osx_aot " <nl> - " index . project . deepspeech . deepspeech . native_client . osx_aot . $ { event . head . sha } " <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . osx / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . osx / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . osx / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . osx / artifacts / public / summarize_graph " <nl> scripts : <nl> build : " taskcluster / host - build . sh - - aot " <nl> package : " taskcluster / package . sh " <nl> mmm a / taskcluster / darwin - amd64 - cpu - opt . yml <nl> ppp b / taskcluster / darwin - amd64 - cpu - opt . yml <nl> build : <nl> - " index . project . deepspeech . deepspeech . native_client . osx . $ { event . head . sha } " <nl> - " notify . irc - channel . $ { notifications . irc } . on - exception " <nl> - " notify . irc - channel . $ { notifications . irc } . on - failed " <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . osx / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . osx / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . osx / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . osx / artifacts / public / summarize_graph " <nl> scripts : <nl> build : " taskcluster / host - build . sh " <nl> package : " taskcluster / package . sh " <nl> mmm a / taskcluster / linux - amd64 - cpu - aot_prod - opt . yml <nl> ppp b / taskcluster / linux - amd64 - cpu - aot_prod - opt . yml <nl> build : <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . cpu_aot " <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . $ { event . head . sha } . cpu_aot " <nl> - " index . project . deepspeech . deepspeech . native_client . cpu_aot . $ { event . head . sha } " <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> system_setup : <nl> > <nl> $ { nodejs . packages . prep_6 } & & apt - get - qq update & & apt - get - qq - y install nodejs python - yaml & & <nl> mmm a / taskcluster / linux - amd64 - cpu - aot_test - opt . yml <nl> ppp b / taskcluster / linux - amd64 - cpu - aot_test - opt . yml <nl> build : <nl> template_file : linux - opt - base . tyml <nl> dependencies : <nl> - " test - training_upstream - linux - amd64 - py27mu - opt " <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> system_setup : <nl> > <nl> $ { nodejs . packages . prep_6 } & & apt - get - qq update & & apt - get - qq - y install nodejs python - yaml & & <nl> mmm a / taskcluster / linux - amd64 - cpu - opt . yml <nl> ppp b / taskcluster / linux - amd64 - cpu - opt . yml <nl> build : <nl> system_config : <nl> > <nl> $ { swig . patch_nodejs . linux } <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> scripts : <nl> build : " taskcluster / host - build . sh " <nl> package : " taskcluster / package . sh " <nl> mmm a / taskcluster / linux - amd64 - ctc - opt . yml <nl> ppp b / taskcluster / linux - amd64 - ctc - opt . yml <nl> build : <nl> - " pull_request . synchronize " <nl> - " pull_request . reopened " <nl> template_file : linux - opt - base . tyml <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> scripts : <nl> build : ' taskcluster / decoder - build . sh ' <nl> package : ' taskcluster / decoder - package . sh ' <nl> mmm a / taskcluster / linux - amd64 - gpu - opt . yml <nl> ppp b / taskcluster / linux - amd64 - gpu - opt . yml <nl> build : <nl> system_config : <nl> > <nl> $ { swig . patch_nodejs . linux } <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . gpu / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . gpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . gpu / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . gpu / artifacts / public / summarize_graph " <nl> maxRunTime : 14400 <nl> scripts : <nl> build : " taskcluster / cuda - build . sh " <nl> mmm a / taskcluster / linux - rpi3 - cpu - aot_prod - opt . yml <nl> ppp b / taskcluster / linux - rpi3 - cpu - aot_prod - opt . yml <nl> build : <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . arm_aot " <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . $ { event . head . sha } . arm_aot " <nl> - " index . project . deepspeech . deepspeech . native_client . arm_aot . $ { event . head . sha } " <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . arm / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . arm / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> # # multistrap 2 . 2 . 0 - ubuntu1 is broken in 14 . 04 : https : / / bugs . launchpad . net / ubuntu / + source / multistrap / + bug / 1313787 <nl> system_setup : <nl> > <nl> mmm a / taskcluster / linux - rpi3 - cpu - opt . yml <nl> ppp b / taskcluster / linux - rpi3 - cpu - opt . yml <nl> build : <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . arm " <nl> - " index . project . deepspeech . deepspeech . native_client . $ { event . head . branch } . $ { event . head . sha } . arm " <nl> - " index . project . deepspeech . deepspeech . native_client . arm . $ { event . head . sha } " <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . arm / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . arm / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> # # multistrap 2 . 2 . 0 - ubuntu1 is broken in 14 . 04 : https : / / bugs . launchpad . net / ubuntu / + source / multistrap / + bug / 1313787 <nl> system_setup : <nl> > <nl> mmm a / taskcluster / node - package . yml <nl> ppp b / taskcluster / node - package . yml <nl> build : <nl> system_config : <nl> > <nl> $ { swig . patch_nodejs . linux } <nl> - tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / home . tar . xz " <nl> - summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / summarize_graph " <nl> + tensorflow : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / home . tar . xz " <nl> + summarize_graph : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / summarize_graph " <nl> scripts : <nl> build : " taskcluster / node - build . sh " <nl> package : " taskcluster / node - package . sh " <nl> mmm a / taskcluster / test - darwin - opt - base . tyml <nl> ppp b / taskcluster / test - darwin - opt - base . tyml <nl> then : <nl> DEEPSPEECH_TEST_MODEL : https : / / queue . taskcluster . net / v1 / task / $ { training } / artifacts / public / output_graph . pb <nl> DEEPSPEECH_PROD_MODEL : https : / / s3 - us - west - 2 . amazonaws . com / deepspeech / mmap / output_graph . pb <nl> DEEPSPEECH_PROD_MODEL_MMAP : https : / / s3 - us - west - 2 . amazonaws . com / deepspeech / mmap / output_graph . pbmm <nl> - EXPECTED_TENSORFLOW_VERSION : " TensorFlow : v1 . 6 . 0 - 9 - g236f83e " <nl> + EXPECTED_TENSORFLOW_VERSION : " TensorFlow : v1 . 6 . 0 - 11 - g7554dd8 " <nl> <nl> command : <nl> - - " / bin / bash " <nl> mmm a / taskcluster / test - linux - opt - base . tyml <nl> ppp b / taskcluster / test - linux - opt - base . tyml <nl> then : <nl> DEEPSPEECH_PROD_MODEL : https : / / s3 . amazonaws . com / deep - speech / mmap / output_graph . pb <nl> DEEPSPEECH_PROD_MODEL_MMAP : https : / / s3 . amazonaws . com / deep - speech / mmap / output_graph . pbmm <nl> PIP_DEFAULT_TIMEOUT : 60 <nl> - EXPECTED_TENSORFLOW_VERSION : " TensorFlow : v1 . 6 . 0 - 9 - g236f83e " <nl> + EXPECTED_TENSORFLOW_VERSION : " TensorFlow : v1 . 6 . 0 - 11 - g7554dd8 " <nl> <nl> command : <nl> - " / bin / bash " <nl> mmm a / taskcluster / test - training_upstream - linux - amd64 - py27mu - opt . yml <nl> ppp b / taskcluster / test - training_upstream - linux - amd64 - py27mu - opt . yml <nl> build : <nl> apt - get - qq - y install $ { python . packages . apt } <nl> args : <nl> tests_cmdline : " $ { system . homedir . linux } / DeepSpeech / ds / tc - train - tests . sh 2 . 7 . 14 : mu upstream " <nl> - convert_graphdef : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 236f83eb5d4d73a33938154f4b1e631355f6a1f0 . cpu / artifacts / public / convert_graphdef_memmapped_format " <nl> + convert_graphdef : " https : / / index . taskcluster . net / v1 / task / project . deepspeech . tensorflow . pip . r1 . 6 . 7554dd8d54cc081f97d34d4f1574aa15dff5eb0d . cpu / artifacts / public / convert_graphdef_memmapped_format " <nl> metadata : <nl> name : " DeepSpeech Linux AMD64 CPU upstream training Py2 . 7 mu " <nl> description : " Training a DeepSpeech LDC93S1 model for Linux / AMD64 using upstream TensorFlow Python 2 . 7 mu , CPU only , optimized version " <nl>
Switch to GCC 7 . 2 from Linaro and Raspbian Stretch
mozilla/DeepSpeech
f77a5cdd2a32ee9c3df1a36dcbfd8feea2908b99
2018-03-19T19:28:06Z
mmm a / tensorflow / python / distribute / cross_device_ops . py <nl> ppp b / tensorflow / python / distribute / cross_device_ops . py <nl> def reduce_implementation ( self , reduce_op , per_replica_value , destinations ) : <nl> else : <nl> # TODO ( josh11b ) : Once we add support for model parallelism , get the <nl> # copy from the corresponding replica instead of the primary . <nl> - index . append ( array_ops . identity ( all_reduced . primary ) ) <nl> + index . append ( array_ops . identity ( all_reduced . _primary ) ) # pylint : disable = protected - access <nl> return value_lib . regroup ( index , wrap_class = value_lib . Mirrored ) <nl> <nl> def batch_reduce_implementation ( self , reduce_op , value_destination_pairs ) : <nl> mmm a / tensorflow / python / distribute / mirrored_strategy_test . py <nl> ppp b / tensorflow / python / distribute / mirrored_strategy_test . py <nl> def testBackwardFunctionDevicePlacement ( self ) : <nl> def forward ( x , w , b ) : <nl> return x * w + b <nl> x = constant_op . constant ( [ 1 . 0 ] , name = " x_useless " ) <nl> - concrete_forward = forward . get_concrete_function ( x , w . primary , b . primary ) <nl> + concrete_forward = forward . get_concrete_function ( x , w . _primary , b . _primary ) <nl> <nl> with ms . scope ( ) : <nl> def replica_fn ( ) : <nl> def step_fn ( ) : <nl> g1 , g2 = step_fn ( ) <nl> run_metadata = context . export_run_metadata ( ) <nl> context . disable_run_metadata ( ) <nl> - self . assertEqual ( self . evaluate ( g1 . primary ) , 1 . 0 ) <nl> - self . assertEqual ( self . evaluate ( g2 . primary ) , 1 . 0 ) <nl> + self . assertEqual ( self . evaluate ( g1 . _primary ) , 1 . 0 ) <nl> + self . assertEqual ( self . evaluate ( g2 . _primary ) , 1 . 0 ) <nl> <nl> # Verify that this node runs on both devices . <nl> node_name = " gradients_mul_grad_mul_1_x " <nl> mmm a / tensorflow / python / distribute / parameter_server_strategy . py <nl> ppp b / tensorflow / python / distribute / parameter_server_strategy . py <nl> def _select_single_value ( self , structured ) : <nl> def _select_fn ( x ) : # pylint : disable = g - missing - docstring <nl> if isinstance ( x , values . Mirrored ) : <nl> if len ( x . devices ) = = 1 : <nl> - return x . primary <nl> + return x . _primary # pylint : disable = protected - access <nl> else : <nl> raise ValueError ( <nl> " You cannot update variable with a Mirrored object with multiple " <nl> mmm a / tensorflow / python / distribute / values . py <nl> ppp b / tensorflow / python / distribute / values . py <nl> def _get_cross_replica ( self ) : <nl> " replica accesses . " ) <nl> <nl> def _get_closest ( self ) : <nl> - " " " Returns value in same replica or device if possible , else the primary . " " " <nl> + " " " Returns value in same replica or device if possible , else the _primary . " " " <nl> replica_id = _get_current_replica_id_as_int ( ) <nl> if replica_id is None : <nl> # Try to find a value on the current device . <nl> def _get_closest ( self ) : <nl> for value in self . _values : <nl> if device_util . canonicalize ( value . device ) = = current_device : <nl> return value <nl> - return self . primary <nl> + return self . _primary <nl> else : <nl> return self . _values [ replica_id ] <nl> <nl> @ property <nl> - def primary ( self ) : <nl> + def _primary ( self ) : <nl> " " " Returns a representative component . " " " <nl> return self . _values [ 0 ] <nl> <nl> class DistributedVariable ( DistributedDelegate , variables_lib . Variable ) : <nl> def __init__ ( self , strategy , values ) : <nl> self . _distribute_strategy = strategy <nl> super ( DistributedVariable , self ) . __init__ ( values ) <nl> - self . _common_name = self . primary . name . split ( " : " ) [ 0 ] <nl> + self . _common_name = self . _primary . name . split ( " : " ) [ 0 ] <nl> # Use a weakref to make it easy to map from the contained values <nl> # to the container without introducing a reference cycle . <nl> for v in values : <nl> def is_initialized ( self , name = None ) : <nl> The op that evaluates to True or False depending on if all the <nl> component variables are initialized . <nl> " " " <nl> - result = self . primary . is_initialized ( ) <nl> + result = self . _primary . is_initialized ( ) <nl> # We iterate through the list of values except the last one to allow us to <nl> # name the final ` logical_and ` op the same name that is passed by the user <nl> # to the ` is_initialized ` op . For distributed variables , the <nl> def initial_value ( self ) : <nl> <nl> @ property <nl> def constraint ( self ) : <nl> - return self . primary . constraint <nl> + return self . _primary . constraint <nl> <nl> @ property <nl> def graph ( self ) : <nl> - return self . primary . graph <nl> + return self . _primary . graph <nl> <nl> @ property <nl> def _shared_name ( self ) : <nl> def _shared_name ( self ) : <nl> <nl> @ property <nl> def _unique_id ( self ) : <nl> - return self . primary . _unique_id # pylint : disable = protected - access <nl> + return self . _primary . _unique_id # pylint : disable = protected - access <nl> <nl> @ property <nl> def _graph_key ( self ) : <nl> " " " Lets Optimizers know which graph this variable is from . " " " <nl> - return self . primary . _graph_key # pylint : disable = protected - access <nl> + return self . _primary . _graph_key # pylint : disable = protected - access <nl> <nl> @ property <nl> def name ( self ) : <nl> - return self . primary . name <nl> + return self . _primary . name <nl> <nl> @ property <nl> def dtype ( self ) : <nl> - return self . primary . dtype <nl> + return self . _primary . dtype <nl> <nl> @ property <nl> def shape ( self ) : <nl> - return self . primary . shape <nl> + return self . _primary . shape <nl> <nl> @ property <nl> def synchronization ( self ) : <nl> - return self . primary . synchronization <nl> + return self . _primary . synchronization <nl> <nl> @ property <nl> def handle ( self ) : <nl> def eval ( self , session = None ) : <nl> <nl> @ property <nl> def _save_slice_info ( self ) : <nl> - return self . primary . _save_slice_info # pylint : disable = protected - access <nl> + return self . _primary . _save_slice_info # pylint : disable = protected - access <nl> <nl> def _get_save_slice_info ( self ) : <nl> - return self . primary . _get_save_slice_info ( ) # pylint : disable = protected - access <nl> + return self . _primary . _get_save_slice_info ( ) # pylint : disable = protected - access <nl> <nl> def _set_save_slice_info ( self , save_slice_info ) : <nl> for v in self . _values : <nl> def device ( self ) : <nl> <nl> @ property <nl> def trainable ( self ) : <nl> - return self . primary . trainable <nl> + return self . _primary . trainable <nl> <nl> @ property <nl> def distribute_strategy ( self ) : <nl> return self . _distribute_strategy <nl> <nl> def get_shape ( self ) : <nl> - return self . primary . get_shape ( ) <nl> + return self . _primary . get_shape ( ) <nl> <nl> def to_proto ( self , export_scope = None ) : <nl> - return self . primary . to_proto ( export_scope = export_scope ) <nl> + return self . _primary . to_proto ( export_scope = export_scope ) <nl> <nl> @ property <nl> def op ( self ) : <nl> def op ( self ) : <nl> # to work ( even if the current device isn ' t in self . devices ) , but <nl> # other uses of var . op in a cross - replica context to fail . <nl> if distribution_strategy_context . in_cross_replica_context ( ) : <nl> - return DistributedVarOp ( self . primary . op . name , self . primary . op . graph , <nl> - self . primary . op . traceback , self . primary . op . type ) <nl> + return DistributedVarOp ( self . _primary . op . name , self . _primary . op . graph , <nl> + self . _primary . op . traceback , self . _primary . op . type ) <nl> return self . _get ( ) . op <nl> <nl> @ property <nl> def _in_graph_mode ( self ) : <nl> - return self . primary . _in_graph_mode # pylint : disable = protected - access <nl> + return self . _primary . _in_graph_mode # pylint : disable = protected - access <nl> <nl> def read_value ( self ) : <nl> with _enter_or_assert_strategy ( self . _distribute_strategy ) : <nl> def __init__ ( self , * args , * * kwargs ) : <nl> # Handle ID is needed for ` get_replicated_var_handle ` to cache the variables <nl> # correctly since in eager mode different variables can have the same name . <nl> if ops . executing_eagerly_outside_functions ( ) : <nl> - self . _handle_id = self . _common_name + " _ " + str ( id ( self . primary ) ) <nl> + self . _handle_id = self . _common_name + " _ " + str ( id ( self . _primary ) ) <nl> else : <nl> self . _handle_id = self . _common_name <nl> <nl> def _get_closest ( self ) : <nl> if _enclosing_tpu_context ( ) is None : <nl> return super ( TPUVariableMixin , self ) . _get_closest ( ) <nl> else : <nl> - return self . primary <nl> + return self . _primary <nl> <nl> def numpy ( self ) : <nl> if context . executing_eagerly ( ) : <nl> def _as_graph_element ( self ) : <nl> <nl> @ property <nl> def op ( self ) : <nl> - return DistributedVarOp ( self . primary . op . name , self . primary . op . graph , <nl> - self . primary . op . traceback , self . primary . op . type ) <nl> + return DistributedVarOp ( self . _primary . op . name , self . _primary . op . graph , <nl> + self . _primary . op . traceback , self . _primary . op . type ) <nl> <nl> def _dense_var_to_tensor ( self , dtype = None , name = None , as_ref = False ) : <nl> " " " Converts a variable to a tensor . " " " <nl> def _gather_saveables_for_checkpoint ( self ) : <nl> " " " <nl> <nl> def _saveable_factory ( name = self . _common_name ) : <nl> - return _MirroredSaveable ( self , self . primary , name ) <nl> + return _MirroredSaveable ( self , self . _primary , name ) <nl> <nl> return { trackable . VARIABLE_VALUE_KEY : _saveable_factory } <nl> <nl> def tensor ( ) : <nl> slice_spec = " " , <nl> name = name , <nl> dtype = sync_on_read_variable . dtype , <nl> - device = sync_on_read_variable . primary . device ) <nl> + device = sync_on_read_variable . _primary . device ) # pylint : disable = protected - access <nl> + <nl> super ( _SyncOnReadSaveable , self ) . __init__ ( tensor , [ spec ] , name ) <nl> <nl> def restore ( self , restored_tensors , restored_shapes ) : <nl> def aggregation ( self ) : <nl> <nl> def _get_cross_replica ( self ) : <nl> if self . _aggregation = = vs . VariableAggregation . ONLY_FIRST_REPLICA : <nl> - return self . primary <nl> + return self . _primary <nl> <nl> with _enter_or_assert_strategy ( self . _distribute_strategy ) : <nl> return self . _distribute_strategy . reduce ( <nl> mmm a / tensorflow / python / saved_model / save . py <nl> ppp b / tensorflow / python / saved_model / save . py <nl> def map_resources ( self ) : <nl> self . captured_tensor_node_ids [ obj . resource_handle ] = node_id <nl> elif ( ds_values . is_distributed_variable ( obj ) or <nl> resource_variable_ops . is_resource_variable ( obj ) ) : <nl> - obj_to_copy = obj . primary if ds_values . is_distributed_variable ( <nl> + obj_to_copy = obj . _primary if ds_values . is_distributed_variable ( # pylint : disable = protected - access <nl> obj ) else obj <nl> new_variable = resource_variable_ops . copy_to_graph_uninitialized ( <nl> obj_to_copy ) <nl>
Automated rollback of commit 36fe0e7aadccfcba4b5dd5ed35c9995dceb6e4b6
tensorflow/tensorflow
5c16c2c48a3ac44f20ab3dac2493b4c261915455
2020-02-18T23:00:51Z
mmm a / src / arm / assembler - arm . h <nl> ppp b / src / arm / assembler - arm . h <nl> GENERAL_REGISTERS ( DECLARE_REGISTER ) <nl> const Register no_reg = { Register : : kCode_no_reg } ; <nl> <nl> static const bool kSimpleFPAliasing = false ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> / / Single word VFP register . <nl> struct SwVfpRegister { <nl> mmm a / src / arm64 / assembler - arm64 . h <nl> ppp b / src / arm64 / assembler - arm64 . h <nl> struct Register : public CPURegister { <nl> } ; <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> struct FPRegister : public CPURegister { <nl> enum Code { <nl> mmm a / src / compiler / arm / code - generator - arm . cc <nl> ppp b / src / compiler / arm / code - generator - arm . cc <nl> CodeGenerator : : CodeGenResult CodeGenerator : : AssembleArchInstruction ( <nl> __ vmvn ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 0 ) ) ; <nl> break ; <nl> } <nl> - case kArmSimd32x4Select : { <nl> - / / Canonicalize input 0 lanes to all 0 ' s or all 1 ' s and move to dest . <nl> - __ vtst ( Neon32 , i . OutputSimd128Register ( ) , i . InputSimd128Register ( 0 ) , <nl> - i . InputSimd128Register ( 0 ) ) ; <nl> - __ vbsl ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 1 ) , <nl> - i . InputSimd128Register ( 2 ) ) ; <nl> - break ; <nl> - } <nl> - case kArmSimd16x8Select : { <nl> - / / Canonicalize input 0 lanes to all 0 ' s or all 1 ' s and move to dest . <nl> - __ vtst ( Neon16 , i . OutputSimd128Register ( ) , i . InputSimd128Register ( 0 ) , <nl> - i . InputSimd128Register ( 0 ) ) ; <nl> - __ vbsl ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 1 ) , <nl> - i . InputSimd128Register ( 2 ) ) ; <nl> - break ; <nl> - } <nl> + case kArmSimd32x4Select : <nl> + case kArmSimd16x8Select : <nl> case kArmSimd8x16Select : { <nl> - / / Canonicalize input 0 lanes to all 0 ' s or all 1 ' s and move to dest . <nl> - __ vtst ( Neon8 , i . OutputSimd128Register ( ) , i . InputSimd128Register ( 0 ) , <nl> - i . InputSimd128Register ( 0 ) ) ; <nl> + / / vbsl clobbers the mask input so make sure it was DefineSameAsFirst . <nl> + DCHECK ( i . OutputSimd128Register ( ) . is ( i . InputSimd128Register ( 0 ) ) ) ; <nl> __ vbsl ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 1 ) , <nl> i . InputSimd128Register ( 2 ) ) ; <nl> break ; <nl> mmm a / src / compiler / arm / instruction - selector - arm . cc <nl> ppp b / src / compiler / arm / instruction - selector - arm . cc <nl> void VisitRR ( InstructionSelector * selector , ArchOpcode opcode , Node * node ) { <nl> g . UseRegister ( node - > InputAt ( 0 ) ) ) ; <nl> } <nl> <nl> - <nl> void VisitRRR ( InstructionSelector * selector , ArchOpcode opcode , Node * node ) { <nl> ArmOperandGenerator g ( selector ) ; <nl> selector - > Emit ( opcode , g . DefineAsRegister ( node ) , <nl> void VisitRRR ( InstructionSelector * selector , ArchOpcode opcode , Node * node ) { <nl> <nl> void VisitRRRR ( InstructionSelector * selector , ArchOpcode opcode , Node * node ) { <nl> ArmOperandGenerator g ( selector ) ; <nl> + / / Use DefineSameAsFirst for ternary ops that clobber their first input , <nl> + / / e . g . the NEON vbsl instruction . <nl> selector - > Emit ( <nl> - opcode , g . DefineAsRegister ( node ) , g . UseRegister ( node - > InputAt ( 0 ) ) , <nl> + opcode , g . DefineSameAsFirst ( node ) , g . UseRegister ( node - > InputAt ( 0 ) ) , <nl> g . UseRegister ( node - > InputAt ( 1 ) ) , g . UseRegister ( node - > InputAt ( 2 ) ) ) ; <nl> } <nl> <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / arm64 / instruction - selector - arm64 . cc <nl> ppp b / src / compiler / arm64 / instruction - selector - arm64 . cc <nl> class Arm64OperandGenerator final : public OperandGenerator { <nl> <nl> bool CanBeLoadStoreShiftImmediate ( Node * node , MachineRepresentation rep ) { <nl> / / TODO ( arm64 ) : Load and Store on 128 bit Q registers is not supported yet . <nl> - DCHECK_NE ( MachineRepresentation : : kSimd128 , rep ) ; <nl> + DCHECK_GT ( MachineRepresentation : : kSimd128 , rep ) ; <nl> return IsIntegerConstant ( node ) & & <nl> ( GetIntegerConstantValue ( node ) = = ElementSizeLog2Of ( rep ) ) ; <nl> } <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> immediate_mode = kLoadStoreImm64 ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> immediate_mode = kLoadStoreImm64 ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kTaggedPointer : / / Fall through . <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kTaggedPointer : / / Fall through . <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / ia32 / instruction - selector - ia32 . cc <nl> ppp b / src / compiler / ia32 / instruction - selector - ia32 . cc <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / instruction - selector . cc <nl> ppp b / src / compiler / instruction - selector . cc <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kFloat32x4Sub : <nl> return MarkAsSimd128 ( node ) , VisitFloat32x4Sub ( node ) ; <nl> case IrOpcode : : kFloat32x4Equal : <nl> - return MarkAsSimd128 ( node ) , VisitFloat32x4Equal ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitFloat32x4Equal ( node ) ; <nl> case IrOpcode : : kFloat32x4NotEqual : <nl> - return MarkAsSimd128 ( node ) , VisitFloat32x4NotEqual ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitFloat32x4NotEqual ( node ) ; <nl> case IrOpcode : : kCreateInt32x4 : <nl> return MarkAsSimd128 ( node ) , VisitCreateInt32x4 ( node ) ; <nl> case IrOpcode : : kInt32x4ExtractLane : <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kInt32x4Max : <nl> return MarkAsSimd128 ( node ) , VisitInt32x4Max ( node ) ; <nl> case IrOpcode : : kInt32x4Equal : <nl> - return MarkAsSimd128 ( node ) , VisitInt32x4Equal ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitInt32x4Equal ( node ) ; <nl> case IrOpcode : : kInt32x4NotEqual : <nl> - return MarkAsSimd128 ( node ) , VisitInt32x4NotEqual ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitInt32x4NotEqual ( node ) ; <nl> case IrOpcode : : kInt32x4GreaterThan : <nl> - return MarkAsSimd128 ( node ) , VisitInt32x4GreaterThan ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitInt32x4GreaterThan ( node ) ; <nl> case IrOpcode : : kInt32x4GreaterThanOrEqual : <nl> - return MarkAsSimd128 ( node ) , VisitInt32x4GreaterThanOrEqual ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitInt32x4GreaterThanOrEqual ( node ) ; <nl> case IrOpcode : : kUint32x4ShiftRightByScalar : <nl> return MarkAsSimd128 ( node ) , VisitUint32x4ShiftRightByScalar ( node ) ; <nl> case IrOpcode : : kUint32x4Min : <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kUint32x4Max : <nl> return MarkAsSimd128 ( node ) , VisitUint32x4Max ( node ) ; <nl> case IrOpcode : : kUint32x4GreaterThan : <nl> - return MarkAsSimd128 ( node ) , VisitUint32x4GreaterThan ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitUint32x4GreaterThan ( node ) ; <nl> case IrOpcode : : kUint32x4GreaterThanOrEqual : <nl> - return MarkAsSimd128 ( node ) , VisitUint32x4GreaterThanOrEqual ( node ) ; <nl> + return MarkAsSimd1x4 ( node ) , VisitUint32x4GreaterThanOrEqual ( node ) ; <nl> case IrOpcode : : kCreateInt16x8 : <nl> return MarkAsSimd128 ( node ) , VisitCreateInt16x8 ( node ) ; <nl> case IrOpcode : : kInt16x8ExtractLane : <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kInt16x8Max : <nl> return MarkAsSimd128 ( node ) , VisitInt16x8Max ( node ) ; <nl> case IrOpcode : : kInt16x8Equal : <nl> - return MarkAsSimd128 ( node ) , VisitInt16x8Equal ( node ) ; <nl> + return MarkAsSimd1x8 ( node ) , VisitInt16x8Equal ( node ) ; <nl> case IrOpcode : : kInt16x8NotEqual : <nl> - return MarkAsSimd128 ( node ) , VisitInt16x8NotEqual ( node ) ; <nl> + return MarkAsSimd1x8 ( node ) , VisitInt16x8NotEqual ( node ) ; <nl> case IrOpcode : : kInt16x8GreaterThan : <nl> - return MarkAsSimd128 ( node ) , VisitInt16x8GreaterThan ( node ) ; <nl> + return MarkAsSimd1x8 ( node ) , VisitInt16x8GreaterThan ( node ) ; <nl> case IrOpcode : : kInt16x8GreaterThanOrEqual : <nl> - return MarkAsSimd128 ( node ) , VisitInt16x8GreaterThanOrEqual ( node ) ; <nl> + return MarkAsSimd1x8 ( node ) , VisitInt16x8GreaterThanOrEqual ( node ) ; <nl> case IrOpcode : : kUint16x8ShiftRightByScalar : <nl> return MarkAsSimd128 ( node ) , VisitUint16x8ShiftRightByScalar ( node ) ; <nl> case IrOpcode : : kUint16x8AddSaturate : <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kUint16x8Max : <nl> return MarkAsSimd128 ( node ) , VisitUint16x8Max ( node ) ; <nl> case IrOpcode : : kUint16x8GreaterThan : <nl> - return MarkAsSimd128 ( node ) , VisitUint16x8GreaterThan ( node ) ; <nl> + return MarkAsSimd1x8 ( node ) , VisitUint16x8GreaterThan ( node ) ; <nl> case IrOpcode : : kUint16x8GreaterThanOrEqual : <nl> - return MarkAsSimd128 ( node ) , VisitUint16x8GreaterThanOrEqual ( node ) ; <nl> + return MarkAsSimd1x8 ( node ) , VisitUint16x8GreaterThanOrEqual ( node ) ; <nl> case IrOpcode : : kCreateInt8x16 : <nl> return MarkAsSimd128 ( node ) , VisitCreateInt8x16 ( node ) ; <nl> case IrOpcode : : kInt8x16ExtractLane : <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kInt8x16Max : <nl> return MarkAsSimd128 ( node ) , VisitInt8x16Max ( node ) ; <nl> case IrOpcode : : kInt8x16Equal : <nl> - return MarkAsSimd128 ( node ) , VisitInt8x16Equal ( node ) ; <nl> + return MarkAsSimd1x16 ( node ) , VisitInt8x16Equal ( node ) ; <nl> case IrOpcode : : kInt8x16NotEqual : <nl> - return MarkAsSimd128 ( node ) , VisitInt8x16NotEqual ( node ) ; <nl> + return MarkAsSimd1x16 ( node ) , VisitInt8x16NotEqual ( node ) ; <nl> case IrOpcode : : kInt8x16GreaterThan : <nl> - return MarkAsSimd128 ( node ) , VisitInt8x16GreaterThan ( node ) ; <nl> + return MarkAsSimd1x16 ( node ) , VisitInt8x16GreaterThan ( node ) ; <nl> case IrOpcode : : kInt8x16GreaterThanOrEqual : <nl> - return MarkAsSimd128 ( node ) , VisitInt8x16GreaterThanOrEqual ( node ) ; <nl> + return MarkAsSimd1x16 ( node ) , VisitInt8x16GreaterThanOrEqual ( node ) ; <nl> case IrOpcode : : kUint8x16ShiftRightByScalar : <nl> return MarkAsSimd128 ( node ) , VisitUint8x16ShiftRightByScalar ( node ) ; <nl> case IrOpcode : : kUint8x16AddSaturate : <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> case IrOpcode : : kUint8x16Max : <nl> return MarkAsSimd128 ( node ) , VisitUint8x16Max ( node ) ; <nl> case IrOpcode : : kUint8x16GreaterThan : <nl> - return MarkAsSimd128 ( node ) , VisitUint8x16GreaterThan ( node ) ; <nl> + return MarkAsSimd1x16 ( node ) , VisitUint8x16GreaterThan ( node ) ; <nl> case IrOpcode : : kUint8x16GreaterThanOrEqual : <nl> - return MarkAsSimd128 ( node ) , VisitUint16x8GreaterThanOrEqual ( node ) ; <nl> + return MarkAsSimd1x16 ( node ) , VisitUint16x8GreaterThanOrEqual ( node ) ; <nl> case IrOpcode : : kSimd128And : <nl> return MarkAsSimd128 ( node ) , VisitSimd128And ( node ) ; <nl> case IrOpcode : : kSimd128Or : <nl> void InstructionSelector : : VisitUint8x16GreaterThanOrEqual ( Node * node ) { <nl> UNIMPLEMENTED ( ) ; <nl> } <nl> <nl> - void InstructionSelector : : VisitSimd32x4Select ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> - <nl> - void InstructionSelector : : VisitSimd16x8Select ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> - <nl> - void InstructionSelector : : VisitSimd8x16Select ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> - <nl> void InstructionSelector : : VisitSimd128And ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void InstructionSelector : : VisitSimd128Or ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitSimd128Or ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitSimd128Xor ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> <nl> void InstructionSelector : : VisitSimd128Not ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> + <nl> + void InstructionSelector : : VisitSimd32x4Select ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> + <nl> + void InstructionSelector : : VisitSimd16x8Select ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> + <nl> + void InstructionSelector : : VisitSimd8x16Select ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> # endif / / ! V8_TARGET_ARCH_ARM <nl> <nl> void InstructionSelector : : VisitFinishRegion ( Node * node ) { EmitIdentity ( node ) ; } <nl> mmm a / src / compiler / instruction - selector . h <nl> ppp b / src / compiler / instruction - selector . h <nl> class V8_EXPORT_PRIVATE InstructionSelector final { <nl> void MarkAsSimd128 ( Node * node ) { <nl> MarkAsRepresentation ( MachineRepresentation : : kSimd128 , node ) ; <nl> } <nl> + void MarkAsSimd1x4 ( Node * node ) { <nl> + if ( kSimdMaskRegisters ) { <nl> + MarkAsRepresentation ( MachineRepresentation : : kSimd1x4 , node ) ; <nl> + } else { <nl> + MarkAsSimd128 ( node ) ; <nl> + } <nl> + } <nl> + void MarkAsSimd1x8 ( Node * node ) { <nl> + if ( kSimdMaskRegisters ) { <nl> + MarkAsRepresentation ( MachineRepresentation : : kSimd1x8 , node ) ; <nl> + } else { <nl> + MarkAsSimd128 ( node ) ; <nl> + } <nl> + } <nl> + void MarkAsSimd1x16 ( Node * node ) { <nl> + if ( kSimdMaskRegisters ) { <nl> + MarkAsRepresentation ( MachineRepresentation : : kSimd1x16 , node ) ; <nl> + } else { <nl> + MarkAsSimd128 ( node ) ; <nl> + } <nl> + } <nl> void MarkAsReference ( Node * node ) { <nl> MarkAsRepresentation ( MachineRepresentation : : kTagged , node ) ; <nl> } <nl> mmm a / src / compiler / instruction . cc <nl> ppp b / src / compiler / instruction . cc <nl> std : : ostream & operator < < ( std : : ostream & os , <nl> case MachineRepresentation : : kSimd128 : <nl> os < < " | s128 " ; <nl> break ; <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + os < < " | s1x4 " ; <nl> + break ; <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + os < < " | s1x8 " ; <nl> + break ; <nl> + case MachineRepresentation : : kSimd1x16 : <nl> + os < < " | s1x16 " ; <nl> + break ; <nl> case MachineRepresentation : : kTaggedSigned : <nl> os < < " | ts " ; <nl> break ; <nl> static MachineRepresentation FilterRepresentation ( MachineRepresentation rep ) { <nl> case MachineRepresentation : : kFloat32 : <nl> case MachineRepresentation : : kFloat64 : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kTaggedSigned : <nl> case MachineRepresentation : : kTaggedPointer : <nl> case MachineRepresentation : : kTagged : <nl> mmm a / src / compiler / instruction . h <nl> ppp b / src / compiler / instruction . h <nl> class LocationOperand : public InstructionOperand { <nl> case MachineRepresentation : : kFloat32 : <nl> case MachineRepresentation : : kFloat64 : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kTaggedSigned : <nl> case MachineRepresentation : : kTaggedPointer : <nl> case MachineRepresentation : : kTagged : <nl> mmm a / src / compiler / js - native - context - specialization . cc <nl> ppp b / src / compiler / js - native - context - specialization . cc <nl> JSNativeContextSpecialization : : BuildPropertyAccess ( <nl> case MachineRepresentation : : kWord64 : <nl> case MachineRepresentation : : kFloat32 : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> UNREACHABLE ( ) ; <nl> break ; <nl> } <nl> mmm a / src / compiler / load - elimination . cc <nl> ppp b / src / compiler / load - elimination . cc <nl> Reduction LoadElimination : : ReduceStoreElement ( Node * node ) { <nl> / / Only record the new value if the store doesn ' t have an implicit truncation . <nl> switch ( access . machine_type . representation ( ) ) { <nl> case MachineRepresentation : : kNone : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kBit : <nl> UNREACHABLE ( ) ; <nl> break ; <nl> int LoadElimination : : FieldIndexOf ( FieldAccess const & access ) { <nl> case MachineRepresentation : : kNone : <nl> case MachineRepresentation : : kBit : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> UNREACHABLE ( ) ; <nl> break ; <nl> case MachineRepresentation : : kWord32 : <nl> mmm a / src / compiler / machine - graph - verifier . cc <nl> ppp b / src / compiler / machine - graph - verifier . cc <nl> class MachineRepresentationChecker { <nl> case MachineRepresentation : : kFloat32 : <nl> case MachineRepresentation : : kFloat64 : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kBit : <nl> case MachineRepresentation : : kWord8 : <nl> case MachineRepresentation : : kWord16 : <nl> mmm a / src / compiler / machine - operator . cc <nl> ppp b / src / compiler / machine - operator . cc <nl> MachineRepresentation AtomicStoreRepresentationOf ( Operator const * op ) { <nl> V ( Uint32x4GreaterThan , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Uint32x4GreaterThanOrEqual , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Uint32x4FromFloat32x4 , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> - V ( CreateBool32x4 , Operator : : kNoProperties , 4 , 0 , 1 ) \ <nl> V ( Bool32x4And , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool32x4Or , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool32x4Xor , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool32x4Not , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Bool32x4AnyTrue , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Bool32x4AllTrue , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> - V ( Bool32x4Swizzle , Operator : : kNoProperties , 5 , 0 , 1 ) \ <nl> - V ( Bool32x4Shuffle , Operator : : kNoProperties , 6 , 0 , 1 ) \ <nl> - V ( Bool32x4Equal , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> - V ( Bool32x4NotEqual , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( CreateInt16x8 , Operator : : kNoProperties , 8 , 0 , 1 ) \ <nl> V ( Int16x8Neg , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Int16x8Add , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> MachineRepresentation AtomicStoreRepresentationOf ( Operator const * op ) { <nl> V ( Uint16x8LessThanOrEqual , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Uint16x8GreaterThan , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Uint16x8GreaterThanOrEqual , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> - V ( CreateBool16x8 , Operator : : kNoProperties , 8 , 0 , 1 ) \ <nl> V ( Bool16x8And , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool16x8Or , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool16x8Xor , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool16x8Not , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Bool16x8AnyTrue , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Bool16x8AllTrue , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> - V ( Bool16x8Swizzle , Operator : : kNoProperties , 9 , 0 , 1 ) \ <nl> - V ( Bool16x8Shuffle , Operator : : kNoProperties , 10 , 0 , 1 ) \ <nl> - V ( Bool16x8Equal , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> - V ( Bool16x8NotEqual , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( CreateInt8x16 , Operator : : kNoProperties , 16 , 0 , 1 ) \ <nl> V ( Int8x16Neg , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Int8x16Add , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> MachineRepresentation AtomicStoreRepresentationOf ( Operator const * op ) { <nl> V ( Uint8x16LessThanOrEqual , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Uint8x16GreaterThan , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Uint8x16GreaterThanOrEqual , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> - V ( CreateBool8x16 , Operator : : kNoProperties , 16 , 0 , 1 ) \ <nl> V ( Bool8x16And , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool8x16Or , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool8x16Xor , Operator : : kAssociative | Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Bool8x16Not , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Bool8x16AnyTrue , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( Bool8x16AllTrue , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> - V ( Bool8x16Swizzle , Operator : : kNoProperties , 17 , 0 , 1 ) \ <nl> - V ( Bool8x16Shuffle , Operator : : kNoProperties , 18 , 0 , 1 ) \ <nl> - V ( Bool8x16Equal , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> - V ( Bool8x16NotEqual , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( Simd128Load , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Simd128Load1 , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> V ( Simd128Load2 , Operator : : kNoProperties , 2 , 0 , 1 ) \ <nl> MachineRepresentation AtomicStoreRepresentationOf ( Operator const * op ) { <nl> # define SIMD_LANE_OP_LIST ( V ) \ <nl> V ( Float32x4 , 4 ) \ <nl> V ( Int32x4 , 4 ) \ <nl> - V ( Bool32x4 , 4 ) \ <nl> V ( Int16x8 , 8 ) \ <nl> - V ( Bool16x8 , 8 ) \ <nl> - V ( Int8x16 , 16 ) \ <nl> - V ( Bool8x16 , 16 ) <nl> + V ( Int8x16 , 16 ) <nl> <nl> # define SIMD_FORMAT_LIST ( V ) \ <nl> V ( 32x4 , 32 ) \ <nl> const Operator * MachineOperatorBuilder : : UnalignedStore ( <nl> MACHINE_REPRESENTATION_LIST ( STORE ) <nl> # undef STORE <nl> case MachineRepresentation : : kBit : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kNone : <nl> break ; <nl> } <nl> const Operator * MachineOperatorBuilder : : Store ( StoreRepresentation store_rep ) { <nl> MACHINE_REPRESENTATION_LIST ( STORE ) <nl> # undef STORE <nl> case MachineRepresentation : : kBit : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kNone : <nl> break ; <nl> } <nl> const Operator * MachineOperatorBuilder : : ProtectedStore ( <nl> MACHINE_REPRESENTATION_LIST ( STORE ) <nl> # undef STORE <nl> case MachineRepresentation : : kBit : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kNone : <nl> break ; <nl> } <nl> const Operator * MachineOperatorBuilder : : CheckedStore ( <nl> MACHINE_REPRESENTATION_LIST ( STORE ) <nl> # undef STORE <nl> case MachineRepresentation : : kBit : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kNone : <nl> break ; <nl> } <nl> mmm a / src / compiler / machine - operator . h <nl> ppp b / src / compiler / machine - operator . h <nl> class V8_EXPORT_PRIVATE MachineOperatorBuilder final <nl> const Operator * Uint32x4GreaterThanOrEqual ( ) ; <nl> const Operator * Uint32x4FromFloat32x4 ( ) ; <nl> <nl> - const Operator * CreateBool32x4 ( ) ; <nl> - const Operator * Bool32x4ExtractLane ( int32_t ) ; <nl> - const Operator * Bool32x4ReplaceLane ( int32_t ) ; <nl> const Operator * Bool32x4And ( ) ; <nl> const Operator * Bool32x4Or ( ) ; <nl> const Operator * Bool32x4Xor ( ) ; <nl> const Operator * Bool32x4Not ( ) ; <nl> const Operator * Bool32x4AnyTrue ( ) ; <nl> const Operator * Bool32x4AllTrue ( ) ; <nl> - const Operator * Bool32x4Swizzle ( ) ; <nl> - const Operator * Bool32x4Shuffle ( ) ; <nl> - const Operator * Bool32x4Equal ( ) ; <nl> - const Operator * Bool32x4NotEqual ( ) ; <nl> <nl> const Operator * CreateInt16x8 ( ) ; <nl> const Operator * Int16x8ExtractLane ( int32_t ) ; <nl> class V8_EXPORT_PRIVATE MachineOperatorBuilder final <nl> const Operator * Uint16x8GreaterThan ( ) ; <nl> const Operator * Uint16x8GreaterThanOrEqual ( ) ; <nl> <nl> - const Operator * CreateBool16x8 ( ) ; <nl> - const Operator * Bool16x8ExtractLane ( int32_t ) ; <nl> - const Operator * Bool16x8ReplaceLane ( int32_t ) ; <nl> const Operator * Bool16x8And ( ) ; <nl> const Operator * Bool16x8Or ( ) ; <nl> const Operator * Bool16x8Xor ( ) ; <nl> const Operator * Bool16x8Not ( ) ; <nl> const Operator * Bool16x8AnyTrue ( ) ; <nl> const Operator * Bool16x8AllTrue ( ) ; <nl> - const Operator * Bool16x8Swizzle ( ) ; <nl> - const Operator * Bool16x8Shuffle ( ) ; <nl> - const Operator * Bool16x8Equal ( ) ; <nl> - const Operator * Bool16x8NotEqual ( ) ; <nl> <nl> const Operator * CreateInt8x16 ( ) ; <nl> const Operator * Int8x16ExtractLane ( int32_t ) ; <nl> class V8_EXPORT_PRIVATE MachineOperatorBuilder final <nl> const Operator * Uint8x16GreaterThan ( ) ; <nl> const Operator * Uint8x16GreaterThanOrEqual ( ) ; <nl> <nl> - const Operator * CreateBool8x16 ( ) ; <nl> - const Operator * Bool8x16ExtractLane ( int32_t ) ; <nl> - const Operator * Bool8x16ReplaceLane ( int32_t ) ; <nl> const Operator * Bool8x16And ( ) ; <nl> const Operator * Bool8x16Or ( ) ; <nl> const Operator * Bool8x16Xor ( ) ; <nl> const Operator * Bool8x16Not ( ) ; <nl> const Operator * Bool8x16AnyTrue ( ) ; <nl> const Operator * Bool8x16AllTrue ( ) ; <nl> - const Operator * Bool8x16Swizzle ( ) ; <nl> - const Operator * Bool8x16Shuffle ( ) ; <nl> - const Operator * Bool8x16Equal ( ) ; <nl> - const Operator * Bool8x16NotEqual ( ) ; <nl> <nl> const Operator * Simd128Load ( ) ; <nl> const Operator * Simd128Load1 ( ) ; <nl> mmm a / src / compiler / mips / instruction - selector - mips . cc <nl> ppp b / src / compiler / mips / instruction - selector - mips . cc <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitUnalignedLoad ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitUnalignedStore ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / mips64 / instruction - selector - mips64 . cc <nl> ppp b / src / compiler / mips64 / instruction - selector - mips64 . cc <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> opcode = kMips64Ld ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> opcode = kMips64Sd ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitUnalignedLoad ( Node * node ) { <nl> opcode = kMips64Uld ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitUnalignedStore ( Node * node ) { <nl> opcode = kMips64Usd ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kTaggedPointer : / / Fall through . <nl> case MachineRepresentation : : kTagged : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kTaggedPointer : / / Fall through . <nl> case MachineRepresentation : : kTagged : <nl> case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / opcodes . h <nl> ppp b / src / compiler / opcodes . h <nl> <nl> V ( Uint32x4GreaterThan ) \ <nl> V ( Uint32x4GreaterThanOrEqual ) \ <nl> V ( Uint32x4FromFloat32x4 ) \ <nl> - V ( CreateBool32x4 ) \ <nl> - V ( Bool32x4ReplaceLane ) \ <nl> V ( Bool32x4And ) \ <nl> V ( Bool32x4Or ) \ <nl> V ( Bool32x4Xor ) \ <nl> V ( Bool32x4Not ) \ <nl> - V ( Bool32x4Swizzle ) \ <nl> - V ( Bool32x4Shuffle ) \ <nl> - V ( Bool32x4Equal ) \ <nl> - V ( Bool32x4NotEqual ) \ <nl> V ( CreateInt16x8 ) \ <nl> V ( Int16x8ReplaceLane ) \ <nl> V ( Int16x8Neg ) \ <nl> <nl> V ( Uint16x8LessThanOrEqual ) \ <nl> V ( Uint16x8GreaterThan ) \ <nl> V ( Uint16x8GreaterThanOrEqual ) \ <nl> - V ( CreateBool16x8 ) \ <nl> - V ( Bool16x8ReplaceLane ) \ <nl> V ( Bool16x8And ) \ <nl> V ( Bool16x8Or ) \ <nl> V ( Bool16x8Xor ) \ <nl> V ( Bool16x8Not ) \ <nl> - V ( Bool16x8Swizzle ) \ <nl> - V ( Bool16x8Shuffle ) \ <nl> - V ( Bool16x8Equal ) \ <nl> - V ( Bool16x8NotEqual ) \ <nl> V ( CreateInt8x16 ) \ <nl> V ( Int8x16ReplaceLane ) \ <nl> V ( Int8x16Neg ) \ <nl> <nl> V ( Uint8x16LessThanOrEqual ) \ <nl> V ( Uint8x16GreaterThan ) \ <nl> V ( Uint8x16GreaterThanOrEqual ) \ <nl> - V ( CreateBool8x16 ) \ <nl> - V ( Bool8x16ReplaceLane ) \ <nl> V ( Bool8x16And ) \ <nl> V ( Bool8x16Or ) \ <nl> V ( Bool8x16Xor ) \ <nl> V ( Bool8x16Not ) \ <nl> - V ( Bool8x16Swizzle ) \ <nl> - V ( Bool8x16Shuffle ) \ <nl> - V ( Bool8x16Equal ) \ <nl> - V ( Bool8x16NotEqual ) \ <nl> V ( Simd128And ) \ <nl> V ( Simd128Or ) \ <nl> V ( Simd128Xor ) \ <nl> <nl> V ( Int8x16ExtractLane ) <nl> <nl> # define MACHINE_SIMD_RETURN_BOOL_OP_LIST ( V ) \ <nl> - V ( Bool32x4ExtractLane ) \ <nl> V ( Bool32x4AnyTrue ) \ <nl> V ( Bool32x4AllTrue ) \ <nl> - V ( Bool16x8ExtractLane ) \ <nl> V ( Bool16x8AnyTrue ) \ <nl> V ( Bool16x8AllTrue ) \ <nl> - V ( Bool8x16ExtractLane ) \ <nl> V ( Bool8x16AnyTrue ) \ <nl> V ( Bool8x16AllTrue ) <nl> <nl> mmm a / src / compiler / ppc / instruction - selector - ppc . cc <nl> ppp b / src / compiler / ppc / instruction - selector - ppc . cc <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / register - allocator . cc <nl> ppp b / src / compiler / register - allocator . cc <nl> int GetByteWidth ( MachineRepresentation rep ) { <nl> return kDoubleSize ; <nl> case MachineRepresentation : : kSimd128 : <nl> return kSimd128Size ; <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> + return kSimdMaskRegisters ? kPointerSize : kSimd128Size ; <nl> case MachineRepresentation : : kNone : <nl> break ; <nl> } <nl> mmm a / src / compiler / representation - change . cc <nl> ppp b / src / compiler / representation - change . cc <nl> Node * RepresentationChanger : : GetRepresentationFor ( <nl> case MachineRepresentation : : kWord64 : <nl> DCHECK ( use_info . type_check ( ) = = TypeCheckKind : : kNone ) ; <nl> return GetWord64RepresentationFor ( node , output_rep , output_type ) ; <nl> - case MachineRepresentation : : kSimd128 : / / Fall through . <nl> - / / TODO ( bbudge ) Handle conversions between tagged and untagged . <nl> - break ; <nl> + case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kNone : <nl> return node ; <nl> } <nl> mmm a / src / compiler / s390 / instruction - selector - s390 . cc <nl> ppp b / src / compiler / s390 / instruction - selector - s390 . cc <nl> ArchOpcode SelectLoadOpcode ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> default : <nl> UNREACHABLE ( ) ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> # endif <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / compiler / simplified - lowering . cc <nl> ppp b / src / compiler / simplified - lowering . cc <nl> UseInfo TruncatingUseInfoFromRepresentation ( MachineRepresentation rep ) { <nl> return UseInfo : : TruncatingWord32 ( ) ; <nl> case MachineRepresentation : : kBit : <nl> return UseInfo : : Bool ( ) ; <nl> - case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd128 : <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + case MachineRepresentation : : kSimd1x16 : <nl> case MachineRepresentation : : kNone : <nl> break ; <nl> } <nl> mmm a / src / compiler / x64 / instruction - selector - x64 . cc <nl> ppp b / src / compiler / x64 / instruction - selector - x64 . cc <nl> ArchOpcode GetLoadOpcode ( LoadRepresentation load_rep ) { <nl> opcode = kX64Movq ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> break ; <nl> ArchOpcode GetStoreOpcode ( StoreRepresentation store_rep ) { <nl> return kX64Movq ; <nl> break ; <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return kArchNop ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kBit : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kTaggedSigned : / / Fall through . <nl> case MachineRepresentation : : kTaggedPointer : / / Fall through . <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kBit : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kTaggedSigned : / / Fall through . <nl> case MachineRepresentation : : kTaggedPointer : / / Fall through . <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> mmm a / src / compiler / x87 / instruction - selector - x87 . cc <nl> ppp b / src / compiler / x87 / instruction - selector - x87 . cc <nl> void InstructionSelector : : VisitLoad ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitStore ( Node * node ) { <nl> break ; <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedLoad ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> void InstructionSelector : : VisitCheckedStore ( Node * node ) { <nl> case MachineRepresentation : : kTagged : / / Fall through . <nl> case MachineRepresentation : : kWord64 : / / Fall through . <nl> case MachineRepresentation : : kSimd128 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x4 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x8 : / / Fall through . <nl> + case MachineRepresentation : : kSimd1x16 : / / Fall through . <nl> case MachineRepresentation : : kNone : <nl> UNREACHABLE ( ) ; <nl> return ; <nl> mmm a / src / ia32 / assembler - ia32 . h <nl> ppp b / src / ia32 / assembler - ia32 . h <nl> GENERAL_REGISTERS ( DECLARE_REGISTER ) <nl> const Register no_reg = { Register : : kCode_no_reg } ; <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> struct XMMRegister { <nl> enum Code { <nl> mmm a / src / machine - type . cc <nl> ppp b / src / machine - type . cc <nl> const char * MachineReprToString ( MachineRepresentation rep ) { <nl> return " kRepFloat64 " ; <nl> case MachineRepresentation : : kSimd128 : <nl> return " kRepSimd128 " ; <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + return " kRepSimd1x4 " ; <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + return " kRepSimd1x8 " ; <nl> + case MachineRepresentation : : kSimd1x16 : <nl> + return " kRepSimd1x16 " ; <nl> case MachineRepresentation : : kTaggedSigned : <nl> return " kRepTaggedSigned " ; <nl> case MachineRepresentation : : kTaggedPointer : <nl> mmm a / src / machine - type . h <nl> ppp b / src / machine - type . h <nl> enum class MachineRepresentation { <nl> kFloat32 , <nl> kFloat64 , <nl> kSimd128 , <nl> + kSimd1x4 , / / SIMD boolean vector types . <nl> + kSimd1x8 , <nl> + kSimd1x16 , <nl> kFirstFPRepresentation = kFloat32 , <nl> - kLastRepresentation = kSimd128 <nl> + kLastRepresentation = kSimd1x16 <nl> } ; <nl> <nl> static_assert ( static_cast < int > ( MachineRepresentation : : kLastRepresentation ) < <nl> class MachineType { <nl> static MachineType Simd128 ( ) { <nl> return MachineType ( MachineRepresentation : : kSimd128 , MachineSemantic : : kNone ) ; <nl> } <nl> + static MachineType Simd1x4 ( ) { <nl> + return MachineType ( MachineRepresentation : : kSimd1x4 , MachineSemantic : : kNone ) ; <nl> + } <nl> + static MachineType Simd1x8 ( ) { <nl> + return MachineType ( MachineRepresentation : : kSimd1x8 , MachineSemantic : : kNone ) ; <nl> + } <nl> + static MachineType Simd1x16 ( ) { <nl> + return MachineType ( MachineRepresentation : : kSimd1x16 , <nl> + MachineSemantic : : kNone ) ; <nl> + } <nl> static MachineType Pointer ( ) { <nl> return MachineType ( PointerRepresentation ( ) , MachineSemantic : : kNone ) ; <nl> } <nl> class MachineType { <nl> static MachineType RepSimd128 ( ) { <nl> return MachineType ( MachineRepresentation : : kSimd128 , MachineSemantic : : kNone ) ; <nl> } <nl> + static MachineType RepSimd1x4 ( ) { <nl> + return MachineType ( MachineRepresentation : : kSimd1x4 , MachineSemantic : : kNone ) ; <nl> + } <nl> + static MachineType RepSimd1x8 ( ) { <nl> + return MachineType ( MachineRepresentation : : kSimd1x8 , MachineSemantic : : kNone ) ; <nl> + } <nl> + static MachineType RepSimd1x16 ( ) { <nl> + return MachineType ( MachineRepresentation : : kSimd1x16 , <nl> + MachineSemantic : : kNone ) ; <nl> + } <nl> static MachineType RepTagged ( ) { <nl> return MachineType ( MachineRepresentation : : kTagged , MachineSemantic : : kNone ) ; <nl> } <nl> class MachineType { <nl> return MachineType : : Float64 ( ) ; <nl> case MachineRepresentation : : kSimd128 : <nl> return MachineType : : Simd128 ( ) ; <nl> + case MachineRepresentation : : kSimd1x4 : <nl> + return MachineType : : Simd1x4 ( ) ; <nl> + case MachineRepresentation : : kSimd1x8 : <nl> + return MachineType : : Simd1x8 ( ) ; <nl> + case MachineRepresentation : : kSimd1x16 : <nl> + return MachineType : : Simd1x16 ( ) ; <nl> case MachineRepresentation : : kTagged : <nl> return MachineType : : AnyTagged ( ) ; <nl> case MachineRepresentation : : kTaggedSigned : <nl> mmm a / src / mips / assembler - mips . h <nl> ppp b / src / mips / assembler - mips . h <nl> int ToNumber ( Register reg ) ; <nl> Register ToRegister ( int num ) ; <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> / / Coprocessor register . <nl> struct FPURegister { <nl> mmm a / src / mips64 / assembler - mips64 . h <nl> ppp b / src / mips64 / assembler - mips64 . h <nl> int ToNumber ( Register reg ) ; <nl> Register ToRegister ( int num ) ; <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> / / Coprocessor register . <nl> struct FPURegister { <nl> mmm a / src / ppc / assembler - ppc . h <nl> ppp b / src / ppc / assembler - ppc . h <nl> const Register kRootRegister = r29 ; / / Roots array pointer . <nl> const Register cp = r30 ; / / JavaScript context pointer . <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> / / Double word FP register . <nl> struct DoubleRegister { <nl> mmm a / src / s390 / assembler - s390 . h <nl> ppp b / src / s390 / assembler - s390 . h <nl> const Register kRootRegister = r10 ; / / Roots array pointer . <nl> const Register cp = r13 ; / / JavaScript context pointer . <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> / / Double word FP register . <nl> struct DoubleRegister { <nl> mmm a / src / wasm / function - body - decoder - impl . h <nl> ppp b / src / wasm / function - body - decoder - impl . h <nl> struct BlockTypeOperand { <nl> case kLocalS128 : <nl> * result = kWasmS128 ; <nl> return true ; <nl> + case kLocalS1x4 : <nl> + * result = kWasmS1x4 ; <nl> + return true ; <nl> + case kLocalS1x8 : <nl> + * result = kWasmS1x8 ; <nl> + return true ; <nl> + case kLocalS1x16 : <nl> + * result = kWasmS1x16 ; <nl> + return true ; <nl> default : <nl> * result = kWasmStmt ; <nl> return false ; <nl> mmm a / src / wasm / function - body - decoder . cc <nl> ppp b / src / wasm / function - body - decoder . cc <nl> class WasmDecoder : public Decoder { <nl> case kLocalS128 : <nl> type = kWasmS128 ; <nl> break ; <nl> + case kLocalS1x4 : <nl> + type = kWasmS1x4 ; <nl> + break ; <nl> + case kLocalS1x8 : <nl> + type = kWasmS1x8 ; <nl> + break ; <nl> + case kLocalS1x16 : <nl> + type = kWasmS1x16 ; <nl> + break ; <nl> default : <nl> decoder - > error ( decoder - > pc ( ) - 1 , " invalid local type " ) ; <nl> return false ; <nl> mmm a / src / wasm / module - decoder . cc <nl> ppp b / src / wasm / module - decoder . cc <nl> class ModuleDecoder : public Decoder { <nl> return kWasmF32 ; <nl> case kLocalF64 : <nl> return kWasmF64 ; <nl> - case kLocalS128 : <nl> + default : <nl> if ( origin_ ! = kAsmJsOrigin & & FLAG_wasm_simd_prototype ) { <nl> - return kWasmS128 ; <nl> - } else { <nl> - error ( pc_ - 1 , " invalid local type " ) ; <nl> - return kWasmStmt ; <nl> + switch ( t ) { <nl> + case kLocalS128 : <nl> + return kWasmS128 ; <nl> + case kLocalS1x4 : <nl> + return kWasmS1x4 ; <nl> + case kLocalS1x8 : <nl> + return kWasmS1x8 ; <nl> + case kLocalS1x16 : <nl> + return kWasmS1x16 ; <nl> + default : <nl> + break ; <nl> + } <nl> } <nl> - default : <nl> error ( pc_ - 1 , " invalid local type " ) ; <nl> return kWasmStmt ; <nl> } <nl> mmm a / src / wasm / wasm - opcodes . h <nl> ppp b / src / wasm / wasm - opcodes . h <nl> enum ValueTypeCode { <nl> kLocalI64 = 0x7e , <nl> kLocalF32 = 0x7d , <nl> kLocalF64 = 0x7c , <nl> - kLocalS128 = 0x7b <nl> + kLocalS128 = 0x7b , <nl> + kLocalS1x4 = 0x7a , <nl> + kLocalS1x8 = 0x79 , <nl> + kLocalS1x16 = 0x78 <nl> } ; <nl> <nl> / / Type code for multi - value block types . <nl> const ValueType kWasmI64 = MachineRepresentation : : kWord64 ; <nl> const ValueType kWasmF32 = MachineRepresentation : : kFloat32 ; <nl> const ValueType kWasmF64 = MachineRepresentation : : kFloat64 ; <nl> const ValueType kWasmS128 = MachineRepresentation : : kSimd128 ; <nl> + const ValueType kWasmS1x4 = MachineRepresentation : : kSimd1x4 ; <nl> + const ValueType kWasmS1x8 = MachineRepresentation : : kSimd1x8 ; <nl> + const ValueType kWasmS1x16 = MachineRepresentation : : kSimd1x16 ; <nl> const ValueType kWasmVar = MachineRepresentation : : kTagged ; <nl> <nl> typedef Signature < ValueType > FunctionSig ; <nl> const WasmCodePosition kNoCodePosition = - 1 ; <nl> V ( F32x4Max , 0xe50d , s_ss ) \ <nl> V ( F32x4MinNum , 0xe50e , s_ss ) \ <nl> V ( F32x4MaxNum , 0xe50f , s_ss ) \ <nl> - V ( F32x4Eq , 0xe510 , s_ss ) \ <nl> - V ( F32x4Ne , 0xe511 , s_ss ) \ <nl> - V ( F32x4Lt , 0xe512 , s_ss ) \ <nl> - V ( F32x4Le , 0xe513 , s_ss ) \ <nl> - V ( F32x4Gt , 0xe514 , s_ss ) \ <nl> - V ( F32x4Ge , 0xe515 , s_ss ) \ <nl> + V ( F32x4Eq , 0xe510 , s1x4_ss ) \ <nl> + V ( F32x4Ne , 0xe511 , s1x4_ss ) \ <nl> + V ( F32x4Lt , 0xe512 , s1x4_ss ) \ <nl> + V ( F32x4Le , 0xe513 , s1x4_ss ) \ <nl> + V ( F32x4Gt , 0xe514 , s1x4_ss ) \ <nl> + V ( F32x4Ge , 0xe515 , s1x4_ss ) \ <nl> V ( F32x4SConvertI32x4 , 0xe519 , s_s ) \ <nl> V ( F32x4UConvertI32x4 , 0xe51a , s_s ) \ <nl> V ( I32x4Splat , 0xe51b , s_i ) \ <nl> const WasmCodePosition kNoCodePosition = - 1 ; <nl> V ( I32x4Mul , 0xe521 , s_ss ) \ <nl> V ( I32x4MinS , 0xe522 , s_ss ) \ <nl> V ( I32x4MaxS , 0xe523 , s_ss ) \ <nl> - V ( I32x4Eq , 0xe526 , s_ss ) \ <nl> - V ( I32x4Ne , 0xe527 , s_ss ) \ <nl> - V ( I32x4LtS , 0xe528 , s_ss ) \ <nl> - V ( I32x4LeS , 0xe529 , s_ss ) \ <nl> - V ( I32x4GtS , 0xe52a , s_ss ) \ <nl> - V ( I32x4GeS , 0xe52b , s_ss ) \ <nl> + V ( I32x4Eq , 0xe526 , s1x4_ss ) \ <nl> + V ( I32x4Ne , 0xe527 , s1x4_ss ) \ <nl> + V ( I32x4LtS , 0xe528 , s1x4_ss ) \ <nl> + V ( I32x4LeS , 0xe529 , s1x4_ss ) \ <nl> + V ( I32x4GtS , 0xe52a , s1x4_ss ) \ <nl> + V ( I32x4GeS , 0xe52b , s1x4_ss ) \ <nl> V ( I32x4SConvertF32x4 , 0xe52f , s_s ) \ <nl> V ( I32x4MinU , 0xe530 , s_ss ) \ <nl> V ( I32x4MaxU , 0xe531 , s_ss ) \ <nl> - V ( I32x4LtU , 0xe533 , s_ss ) \ <nl> - V ( I32x4LeU , 0xe534 , s_ss ) \ <nl> - V ( I32x4GtU , 0xe535 , s_ss ) \ <nl> - V ( I32x4GeU , 0xe536 , s_ss ) \ <nl> + V ( I32x4LtU , 0xe533 , s1x4_ss ) \ <nl> + V ( I32x4LeU , 0xe534 , s1x4_ss ) \ <nl> + V ( I32x4GtU , 0xe535 , s1x4_ss ) \ <nl> + V ( I32x4GeU , 0xe536 , s1x4_ss ) \ <nl> V ( I32x4UConvertF32x4 , 0xe537 , s_s ) \ <nl> V ( I16x8Splat , 0xe538 , s_i ) \ <nl> V ( I16x8Neg , 0xe53b , s_s ) \ <nl> const WasmCodePosition kNoCodePosition = - 1 ; <nl> V ( I16x8Mul , 0xe540 , s_ss ) \ <nl> V ( I16x8MinS , 0xe541 , s_ss ) \ <nl> V ( I16x8MaxS , 0xe542 , s_ss ) \ <nl> - V ( I16x8Eq , 0xe545 , s_ss ) \ <nl> - V ( I16x8Ne , 0xe546 , s_ss ) \ <nl> - V ( I16x8LtS , 0xe547 , s_ss ) \ <nl> - V ( I16x8LeS , 0xe548 , s_ss ) \ <nl> - V ( I16x8GtS , 0xe549 , s_ss ) \ <nl> - V ( I16x8GeS , 0xe54a , s_ss ) \ <nl> + V ( I16x8Eq , 0xe545 , s1x8_ss ) \ <nl> + V ( I16x8Ne , 0xe546 , s1x8_ss ) \ <nl> + V ( I16x8LtS , 0xe547 , s1x8_ss ) \ <nl> + V ( I16x8LeS , 0xe548 , s1x8_ss ) \ <nl> + V ( I16x8GtS , 0xe549 , s1x8_ss ) \ <nl> + V ( I16x8GeS , 0xe54a , s1x8_ss ) \ <nl> V ( I16x8AddSaturateU , 0xe54e , s_ss ) \ <nl> V ( I16x8SubSaturateU , 0xe54f , s_ss ) \ <nl> V ( I16x8MinU , 0xe550 , s_ss ) \ <nl> V ( I16x8MaxU , 0xe551 , s_ss ) \ <nl> - V ( I16x8LtU , 0xe553 , s_ss ) \ <nl> - V ( I16x8LeU , 0xe554 , s_ss ) \ <nl> - V ( I16x8GtU , 0xe555 , s_ss ) \ <nl> - V ( I16x8GeU , 0xe556 , s_ss ) \ <nl> + V ( I16x8LtU , 0xe553 , s1x8_ss ) \ <nl> + V ( I16x8LeU , 0xe554 , s1x8_ss ) \ <nl> + V ( I16x8GtU , 0xe555 , s1x8_ss ) \ <nl> + V ( I16x8GeU , 0xe556 , s1x8_ss ) \ <nl> V ( I8x16Splat , 0xe557 , s_i ) \ <nl> V ( I8x16Neg , 0xe55a , s_s ) \ <nl> V ( I8x16Add , 0xe55b , s_ss ) \ <nl> const WasmCodePosition kNoCodePosition = - 1 ; <nl> V ( I8x16Mul , 0xe55f , s_ss ) \ <nl> V ( I8x16MinS , 0xe560 , s_ss ) \ <nl> V ( I8x16MaxS , 0xe561 , s_ss ) \ <nl> - V ( I8x16Eq , 0xe564 , s_ss ) \ <nl> - V ( I8x16Ne , 0xe565 , s_ss ) \ <nl> - V ( I8x16LtS , 0xe566 , s_ss ) \ <nl> - V ( I8x16LeS , 0xe567 , s_ss ) \ <nl> - V ( I8x16GtS , 0xe568 , s_ss ) \ <nl> - V ( I8x16GeS , 0xe569 , s_ss ) \ <nl> + V ( I8x16Eq , 0xe564 , s1x16_ss ) \ <nl> + V ( I8x16Ne , 0xe565 , s1x16_ss ) \ <nl> + V ( I8x16LtS , 0xe566 , s1x16_ss ) \ <nl> + V ( I8x16LeS , 0xe567 , s1x16_ss ) \ <nl> + V ( I8x16GtS , 0xe568 , s1x16_ss ) \ <nl> + V ( I8x16GeS , 0xe569 , s1x16_ss ) \ <nl> V ( I8x16AddSaturateU , 0xe56d , s_ss ) \ <nl> V ( I8x16SubSaturateU , 0xe56e , s_ss ) \ <nl> V ( I8x16MinU , 0xe56f , s_ss ) \ <nl> V ( I8x16MaxU , 0xe570 , s_ss ) \ <nl> - V ( I8x16LtU , 0xe572 , s_ss ) \ <nl> - V ( I8x16LeU , 0xe573 , s_ss ) \ <nl> - V ( I8x16GtU , 0xe574 , s_ss ) \ <nl> - V ( I8x16GeU , 0xe575 , s_ss ) \ <nl> + V ( I8x16LtU , 0xe572 , s1x16_ss ) \ <nl> + V ( I8x16LeU , 0xe573 , s1x16_ss ) \ <nl> + V ( I8x16GtU , 0xe574 , s1x16_ss ) \ <nl> + V ( I8x16GeU , 0xe575 , s1x16_ss ) \ <nl> V ( S128And , 0xe576 , s_ss ) \ <nl> V ( S128Or , 0xe577 , s_ss ) \ <nl> V ( S128Xor , 0xe578 , s_ss ) \ <nl> V ( S128Not , 0xe579 , s_s ) \ <nl> - V ( S32x4Select , 0xe52c , s_sss ) \ <nl> + V ( S32x4Select , 0xe52c , s_s1x4ss ) \ <nl> V ( S32x4Swizzle , 0xe52d , s_s ) \ <nl> V ( S32x4Shuffle , 0xe52e , s_ss ) \ <nl> - V ( S16x8Select , 0xe54b , s_sss ) \ <nl> + V ( S16x8Select , 0xe54b , s_s1x8ss ) \ <nl> V ( S16x8Swizzle , 0xe54c , s_s ) \ <nl> V ( S16x8Shuffle , 0xe54d , s_ss ) \ <nl> - V ( S8x16Select , 0xe56a , s_sss ) \ <nl> + V ( S8x16Select , 0xe56a , s_s1x16ss ) \ <nl> V ( S8x16Swizzle , 0xe56b , s_s ) \ <nl> V ( S8x16Shuffle , 0xe56c , s_ss ) <nl> <nl> const WasmCodePosition kNoCodePosition = - 1 ; <nl> V ( f_if , kWasmF32 , kWasmI32 , kWasmF32 ) \ <nl> V ( l_il , kWasmI64 , kWasmI32 , kWasmI64 ) <nl> <nl> - # define FOREACH_SIMD_SIGNATURE ( V ) \ <nl> - V ( s_s , kWasmS128 , kWasmS128 ) \ <nl> - V ( s_f , kWasmS128 , kWasmF32 ) \ <nl> - V ( s_ss , kWasmS128 , kWasmS128 , kWasmS128 ) \ <nl> - V ( s_sss , kWasmS128 , kWasmS128 , kWasmS128 , kWasmS128 ) \ <nl> - V ( s_i , kWasmS128 , kWasmI32 ) \ <nl> - V ( s_si , kWasmS128 , kWasmS128 , kWasmI32 ) <nl> + # define FOREACH_SIMD_SIGNATURE ( V ) \ <nl> + V ( s_s , kWasmS128 , kWasmS128 ) \ <nl> + V ( s_f , kWasmS128 , kWasmF32 ) \ <nl> + V ( s_ss , kWasmS128 , kWasmS128 , kWasmS128 ) \ <nl> + V ( s1x4_ss , kWasmS1x4 , kWasmS128 , kWasmS128 ) \ <nl> + V ( s1x8_ss , kWasmS1x8 , kWasmS128 , kWasmS128 ) \ <nl> + V ( s1x16_ss , kWasmS1x16 , kWasmS128 , kWasmS128 ) \ <nl> + V ( s_i , kWasmS128 , kWasmI32 ) \ <nl> + V ( s_si , kWasmS128 , kWasmS128 , kWasmI32 ) \ <nl> + V ( i_s , kWasmI32 , kWasmS128 ) \ <nl> + V ( s_s1x4ss , kWasmS128 , kWasmS1x4 , kWasmS128 , kWasmS128 ) \ <nl> + V ( s_s1x8ss , kWasmS128 , kWasmS1x8 , kWasmS128 , kWasmS128 ) \ <nl> + V ( s_s1x16ss , kWasmS128 , kWasmS1x16 , kWasmS128 , kWasmS128 ) <nl> <nl> # define FOREACH_PREFIX ( V ) \ <nl> V ( Simd , 0xe5 ) \ <nl> class V8_EXPORT_PRIVATE WasmOpcodes { <nl> return kLocalF64 ; <nl> case kWasmS128 : <nl> return kLocalS128 ; <nl> + case kWasmS1x4 : <nl> + return kLocalS1x4 ; <nl> + case kWasmS1x8 : <nl> + return kLocalS1x8 ; <nl> + case kWasmS1x16 : <nl> + return kLocalS1x16 ; <nl> case kWasmStmt : <nl> return kLocalVoid ; <nl> default : <nl> class V8_EXPORT_PRIVATE WasmOpcodes { <nl> return MachineType : : Float64 ( ) ; <nl> case kWasmS128 : <nl> return MachineType : : Simd128 ( ) ; <nl> + case kWasmS1x4 : <nl> + return MachineType : : Simd1x4 ( ) ; <nl> + case kWasmS1x8 : <nl> + return MachineType : : Simd1x8 ( ) ; <nl> + case kWasmS1x16 : <nl> + return MachineType : : Simd1x16 ( ) ; <nl> case kWasmStmt : <nl> return MachineType : : None ( ) ; <nl> default : <nl> class V8_EXPORT_PRIVATE WasmOpcodes { <nl> return kWasmF64 ; <nl> } else if ( type = = MachineType : : Simd128 ( ) ) { <nl> return kWasmS128 ; <nl> + } else if ( type = = MachineType : : Simd1x4 ( ) ) { <nl> + return kWasmS1x4 ; <nl> + } else if ( type = = MachineType : : Simd1x8 ( ) ) { <nl> + return kWasmS1x8 ; <nl> + } else if ( type = = MachineType : : Simd1x16 ( ) ) { <nl> + return kWasmS1x16 ; <nl> } else { <nl> UNREACHABLE ( ) ; <nl> return kWasmI32 ; <nl> class V8_EXPORT_PRIVATE WasmOpcodes { <nl> case kWasmF64 : <nl> return ' d ' ; <nl> case kWasmS128 : <nl> + case kWasmS1x4 : <nl> + case kWasmS1x8 : <nl> + case kWasmS1x16 : <nl> return ' s ' ; <nl> case kWasmStmt : <nl> return ' v ' ; <nl> class V8_EXPORT_PRIVATE WasmOpcodes { <nl> return " f64 " ; <nl> case kWasmS128 : <nl> return " s128 " ; <nl> + case kWasmS1x4 : <nl> + return " s1x4 " ; <nl> + case kWasmS1x8 : <nl> + return " s1x8 " ; <nl> + case kWasmS1x16 : <nl> + return " s1x16 " ; <nl> case kWasmStmt : <nl> return " < stmt > " ; <nl> case kWasmVar : <nl> mmm a / src / x64 / assembler - x64 . h <nl> ppp b / src / x64 / assembler - x64 . h <nl> const Register arg_reg_4 = { Register : : kCode_rcx } ; <nl> V ( xmm14 ) <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> struct XMMRegister { <nl> enum Code { <nl> mmm a / src / x87 / assembler - x87 . h <nl> ppp b / src / x87 / assembler - x87 . h <nl> GENERAL_REGISTERS ( DECLARE_REGISTER ) <nl> const Register no_reg = { Register : : kCode_no_reg } ; <nl> <nl> static const bool kSimpleFPAliasing = true ; <nl> + static const bool kSimdMaskRegisters = false ; <nl> <nl> struct X87Register { <nl> enum Code { <nl> mmm a / test / cctest / wasm / test - run - wasm - simd . cc <nl> ppp b / test / cctest / wasm / test - run - wasm - simd . cc <nl> typedef int8_t ( * Int8BinOp ) ( int8_t , int8_t ) ; <nl> typedef int8_t ( * Int8ShiftOp ) ( int8_t , int ) ; <nl> <nl> # if V8_TARGET_ARCH_ARM <nl> - / / Floating point specific value functions . <nl> - int32_t Equal ( float a , float b ) { return a = = b ? - 1 : 0 ; } <nl> + / / Floating point specific value functions , only used by ARM so far . <nl> + int32_t Equal ( float a , float b ) { return a = = b ? 1 : 0 ; } <nl> <nl> - int32_t NotEqual ( float a , float b ) { return a ! = b ? - 1 : 0 ; } <nl> + int32_t NotEqual ( float a , float b ) { return a ! = b ? 1 : 0 ; } <nl> # endif / / V8_TARGET_ARCH_ARM <nl> <nl> / / Generic expected value functions . <nl> T UnsignedMaximum ( T a , T b ) { <nl> <nl> template < typename T > <nl> T Equal ( T a , T b ) { <nl> - return a = = b ? - 1 : 0 ; <nl> + return a = = b ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T NotEqual ( T a , T b ) { <nl> - return a ! = b ? - 1 : 0 ; <nl> + return a ! = b ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T Greater ( T a , T b ) { <nl> - return a > b ? - 1 : 0 ; <nl> + return a > b ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T GreaterEqual ( T a , T b ) { <nl> - return a > = b ? - 1 : 0 ; <nl> + return a > = b ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T Less ( T a , T b ) { <nl> - return a < b ? - 1 : 0 ; <nl> + return a < b ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T LessEqual ( T a , T b ) { <nl> - return a < = b ? - 1 : 0 ; <nl> + return a < = b ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T UnsignedGreater ( T a , T b ) { <nl> using UnsignedT = typename std : : make_unsigned < T > : : type ; <nl> - return static_cast < UnsignedT > ( a ) > static_cast < UnsignedT > ( b ) ? - 1 : 0 ; <nl> + return static_cast < UnsignedT > ( a ) > static_cast < UnsignedT > ( b ) ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T UnsignedGreaterEqual ( T a , T b ) { <nl> using UnsignedT = typename std : : make_unsigned < T > : : type ; <nl> - return static_cast < UnsignedT > ( a ) > = static_cast < UnsignedT > ( b ) ? - 1 : 0 ; <nl> + return static_cast < UnsignedT > ( a ) > = static_cast < UnsignedT > ( b ) ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T UnsignedLess ( T a , T b ) { <nl> using UnsignedT = typename std : : make_unsigned < T > : : type ; <nl> - return static_cast < UnsignedT > ( a ) < static_cast < UnsignedT > ( b ) ? - 1 : 0 ; <nl> + return static_cast < UnsignedT > ( a ) < static_cast < UnsignedT > ( b ) ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T UnsignedLessEqual ( T a , T b ) { <nl> using UnsignedT = typename std : : make_unsigned < T > : : type ; <nl> - return static_cast < UnsignedT > ( a ) < = static_cast < UnsignedT > ( b ) ? - 1 : 0 ; <nl> + return static_cast < UnsignedT > ( a ) < = static_cast < UnsignedT > ( b ) ? 1 : 0 ; <nl> } <nl> <nl> template < typename T > <nl> T Not ( T a ) { <nl> <nl> # define TO_BYTE ( val ) static_cast < byte > ( val ) <nl> # define WASM_SIMD_OP ( op ) kSimdPrefix , TO_BYTE ( op ) <nl> + # define WASM_SIMD_SPLAT ( Type , x ) x , WASM_SIMD_OP ( kExpr # # Type # # Splat ) <nl> # define WASM_SIMD_UNOP ( op , x ) x , WASM_SIMD_OP ( op ) <nl> # define WASM_SIMD_BINOP ( op , x , y ) x , y , WASM_SIMD_OP ( op ) <nl> # define WASM_SIMD_SHIFT_OP ( op , shift , x ) x , WASM_SIMD_OP ( op ) , TO_BYTE ( shift ) <nl> # define WASM_SIMD_SELECT ( format , x , y , z ) \ <nl> x , y , z , WASM_SIMD_OP ( kExprS # # format # # Select ) <nl> + / / Since boolean vectors can ' t be checked directly , materialize them into <nl> + / / integer vectors using a Select operation . <nl> + # define WASM_SIMD_MATERIALIZE_BOOLS ( format , x ) \ <nl> + x , WASM_SIMD_I # # format # # _SPLAT ( WASM_ONE ) , \ <nl> + WASM_SIMD_I # # format # # _SPLAT ( WASM_ZERO ) , \ <nl> + WASM_SIMD_OP ( kExprS # # format # # Select ) <nl> <nl> # define WASM_SIMD_I16x8_SPLAT ( x ) x , WASM_SIMD_OP ( kExprI16x8Splat ) <nl> # define WASM_SIMD_I16x8_EXTRACT_LANE ( lane , x ) \ <nl> void RunF32x4CompareOpTest ( WasmOpcode simd_op , FloatCompareOp expected_op ) { <nl> byte simd1 = r . AllocateLocal ( kWasmS128 ) ; <nl> BUILD ( r , WASM_SET_LOCAL ( simd0 , WASM_SIMD_F32x4_SPLAT ( WASM_GET_LOCAL ( a ) ) ) , <nl> WASM_SET_LOCAL ( simd1 , WASM_SIMD_F32x4_SPLAT ( WASM_GET_LOCAL ( b ) ) ) , <nl> - WASM_SET_LOCAL ( simd1 , WASM_SIMD_BINOP ( simd_op , WASM_GET_LOCAL ( simd0 ) , <nl> - WASM_GET_LOCAL ( simd1 ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , <nl> + WASM_SIMD_MATERIALIZE_BOOLS ( <nl> + 32x4 , WASM_SIMD_BINOP ( simd_op , WASM_GET_LOCAL ( simd0 ) , <nl> + WASM_GET_LOCAL ( simd1 ) ) ) ) , <nl> WASM_SIMD_CHECK_SPLAT4 ( I32x4 , simd1 , I32 , expected ) , WASM_ONE ) ; <nl> <nl> FOR_FLOAT32_INPUTS ( i ) { <nl> WASM_EXEC_TEST ( I32x4Min ) { RunI32x4BinOpTest ( kExprI32x4MinS , Minimum ) ; } <nl> <nl> WASM_EXEC_TEST ( I32x4Max ) { RunI32x4BinOpTest ( kExprI32x4MaxS , Maximum ) ; } <nl> <nl> - WASM_EXEC_TEST ( I32x4Equal ) { RunI32x4BinOpTest ( kExprI32x4Eq , Equal ) ; } <nl> + WASM_EXEC_TEST ( Ui32x4Min ) { <nl> + RunI32x4BinOpTest ( kExprI32x4MinU , UnsignedMinimum ) ; <nl> + } <nl> + <nl> + WASM_EXEC_TEST ( Ui32x4Max ) { <nl> + RunI32x4BinOpTest ( kExprI32x4MaxU , UnsignedMaximum ) ; <nl> + } <nl> + <nl> + WASM_EXEC_TEST ( S128And ) { RunI32x4BinOpTest ( kExprS128And , And ) ; } <nl> <nl> - WASM_EXEC_TEST ( I32x4NotEqual ) { RunI32x4BinOpTest ( kExprI32x4Ne , NotEqual ) ; } <nl> + WASM_EXEC_TEST ( S128Or ) { RunI32x4BinOpTest ( kExprS128Or , Or ) ; } <nl> <nl> - WASM_EXEC_TEST ( I32x4Greater ) { RunI32x4BinOpTest ( kExprI32x4GtS , Greater ) ; } <nl> + WASM_EXEC_TEST ( S128Xor ) { RunI32x4BinOpTest ( kExprS128Xor , Xor ) ; } <nl> <nl> - WASM_EXEC_TEST ( I32x4GreaterEqual ) { <nl> - RunI32x4BinOpTest ( kExprI32x4GeS , GreaterEqual ) ; <nl> + void RunI32x4CompareOpTest ( WasmOpcode simd_op , Int32BinOp expected_op ) { <nl> + FLAG_wasm_simd_prototype = true ; <nl> + WasmRunner < int32_t , int32_t , int32_t , int32_t > r ( kExecuteCompiled ) ; <nl> + byte a = 0 ; <nl> + byte b = 1 ; <nl> + byte expected = 2 ; <nl> + byte simd0 = r . AllocateLocal ( kWasmS128 ) ; <nl> + byte simd1 = r . AllocateLocal ( kWasmS128 ) ; <nl> + BUILD ( r , WASM_SET_LOCAL ( simd0 , WASM_SIMD_I32x4_SPLAT ( WASM_GET_LOCAL ( a ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , WASM_SIMD_I32x4_SPLAT ( WASM_GET_LOCAL ( b ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , <nl> + WASM_SIMD_MATERIALIZE_BOOLS ( <nl> + 32x4 , WASM_SIMD_BINOP ( simd_op , WASM_GET_LOCAL ( simd0 ) , <nl> + WASM_GET_LOCAL ( simd1 ) ) ) ) , <nl> + WASM_SIMD_CHECK_SPLAT4 ( I32x4 , simd1 , I32 , expected ) , WASM_ONE ) ; <nl> + <nl> + FOR_INT32_INPUTS ( i ) { <nl> + FOR_INT32_INPUTS ( j ) { CHECK_EQ ( 1 , r . Call ( * i , * j , expected_op ( * i , * j ) ) ) ; } <nl> + } <nl> } <nl> <nl> - WASM_EXEC_TEST ( I32x4Less ) { RunI32x4BinOpTest ( kExprI32x4LtS , Less ) ; } <nl> + WASM_EXEC_TEST ( I32x4Equal ) { RunI32x4CompareOpTest ( kExprI32x4Eq , Equal ) ; } <nl> <nl> - WASM_EXEC_TEST ( I32x4LessEqual ) { RunI32x4BinOpTest ( kExprI32x4LeS , LessEqual ) ; } <nl> + WASM_EXEC_TEST ( I32x4NotEqual ) { RunI32x4CompareOpTest ( kExprI32x4Ne , NotEqual ) ; } <nl> <nl> - WASM_EXEC_TEST ( Ui32x4Min ) { <nl> - RunI32x4BinOpTest ( kExprI32x4MinU , UnsignedMinimum ) ; <nl> + WASM_EXEC_TEST ( I32x4Greater ) { RunI32x4CompareOpTest ( kExprI32x4GtS , Greater ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I32x4GreaterEqual ) { <nl> + RunI32x4CompareOpTest ( kExprI32x4GeS , GreaterEqual ) ; <nl> } <nl> <nl> - WASM_EXEC_TEST ( Ui32x4Max ) { <nl> - RunI32x4BinOpTest ( kExprI32x4MaxU , UnsignedMaximum ) ; <nl> + WASM_EXEC_TEST ( I32x4Less ) { RunI32x4CompareOpTest ( kExprI32x4LtS , Less ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I32x4LessEqual ) { <nl> + RunI32x4CompareOpTest ( kExprI32x4LeS , LessEqual ) ; <nl> } <nl> <nl> WASM_EXEC_TEST ( Ui32x4Greater ) { <nl> - RunI32x4BinOpTest ( kExprI32x4GtU , UnsignedGreater ) ; <nl> + RunI32x4CompareOpTest ( kExprI32x4GtU , UnsignedGreater ) ; <nl> } <nl> <nl> WASM_EXEC_TEST ( Ui32x4GreaterEqual ) { <nl> - RunI32x4BinOpTest ( kExprI32x4GeU , UnsignedGreaterEqual ) ; <nl> + RunI32x4CompareOpTest ( kExprI32x4GeU , UnsignedGreaterEqual ) ; <nl> } <nl> <nl> - WASM_EXEC_TEST ( Ui32x4Less ) { RunI32x4BinOpTest ( kExprI32x4LtU , UnsignedLess ) ; } <nl> + WASM_EXEC_TEST ( Ui32x4Less ) { <nl> + RunI32x4CompareOpTest ( kExprI32x4LtU , UnsignedLess ) ; <nl> + } <nl> <nl> WASM_EXEC_TEST ( Ui32x4LessEqual ) { <nl> - RunI32x4BinOpTest ( kExprI32x4LeU , UnsignedLessEqual ) ; <nl> + RunI32x4CompareOpTest ( kExprI32x4LeU , UnsignedLessEqual ) ; <nl> } <nl> <nl> - WASM_EXEC_TEST ( S128And ) { RunI32x4BinOpTest ( kExprS128And , And ) ; } <nl> - <nl> - WASM_EXEC_TEST ( S128Or ) { RunI32x4BinOpTest ( kExprS128Or , Or ) ; } <nl> - <nl> - WASM_EXEC_TEST ( S128Xor ) { RunI32x4BinOpTest ( kExprS128Xor , Xor ) ; } <nl> - <nl> void RunI32x4ShiftOpTest ( WasmOpcode simd_op , Int32ShiftOp expected_op , <nl> int shift ) { <nl> FLAG_wasm_simd_prototype = true ; <nl> WASM_EXEC_TEST ( I16x8Min ) { RunI16x8BinOpTest ( kExprI16x8MinS , Minimum ) ; } <nl> <nl> WASM_EXEC_TEST ( I16x8Max ) { RunI16x8BinOpTest ( kExprI16x8MaxS , Maximum ) ; } <nl> <nl> - WASM_EXEC_TEST ( I16x8Equal ) { RunI16x8BinOpTest ( kExprI16x8Eq , Equal ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I16x8NotEqual ) { RunI16x8BinOpTest ( kExprI16x8Ne , NotEqual ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I16x8Greater ) { RunI16x8BinOpTest ( kExprI16x8GtS , Greater ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I16x8GreaterEqual ) { <nl> - RunI16x8BinOpTest ( kExprI16x8GeS , GreaterEqual ) ; <nl> - } <nl> - <nl> - WASM_EXEC_TEST ( I16x8Less ) { RunI16x8BinOpTest ( kExprI16x8LtS , Less ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I16x8LessEqual ) { RunI16x8BinOpTest ( kExprI16x8LeS , LessEqual ) ; } <nl> - <nl> WASM_EXEC_TEST ( Ui16x8AddSaturate ) { <nl> RunI16x8BinOpTest ( kExprI16x8AddSaturateU , UnsignedAddSaturate ) ; <nl> } <nl> WASM_EXEC_TEST ( Ui16x8Max ) { <nl> RunI16x8BinOpTest ( kExprI16x8MaxU , UnsignedMaximum ) ; <nl> } <nl> <nl> + void RunI16x8CompareOpTest ( WasmOpcode simd_op , Int16BinOp expected_op ) { <nl> + FLAG_wasm_simd_prototype = true ; <nl> + WasmRunner < int32_t , int32_t , int32_t , int32_t > r ( kExecuteCompiled ) ; <nl> + byte a = 0 ; <nl> + byte b = 1 ; <nl> + byte expected = 2 ; <nl> + byte simd0 = r . AllocateLocal ( kWasmS128 ) ; <nl> + byte simd1 = r . AllocateLocal ( kWasmS128 ) ; <nl> + BUILD ( r , WASM_SET_LOCAL ( simd0 , WASM_SIMD_I16x8_SPLAT ( WASM_GET_LOCAL ( a ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , WASM_SIMD_I16x8_SPLAT ( WASM_GET_LOCAL ( b ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , <nl> + WASM_SIMD_MATERIALIZE_BOOLS ( <nl> + 16x8 , WASM_SIMD_BINOP ( simd_op , WASM_GET_LOCAL ( simd0 ) , <nl> + WASM_GET_LOCAL ( simd1 ) ) ) ) , <nl> + WASM_SIMD_CHECK_SPLAT8 ( I16x8 , simd1 , I32 , expected ) , WASM_ONE ) ; <nl> + <nl> + FOR_INT16_INPUTS ( i ) { <nl> + FOR_INT16_INPUTS ( j ) { CHECK_EQ ( 1 , r . Call ( * i , * j , expected_op ( * i , * j ) ) ) ; } <nl> + } <nl> + } <nl> + <nl> + WASM_EXEC_TEST ( I16x8Equal ) { RunI16x8CompareOpTest ( kExprI16x8Eq , Equal ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I16x8NotEqual ) { RunI16x8CompareOpTest ( kExprI16x8Ne , NotEqual ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I16x8Greater ) { RunI16x8CompareOpTest ( kExprI16x8GtS , Greater ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I16x8GreaterEqual ) { <nl> + RunI16x8CompareOpTest ( kExprI16x8GeS , GreaterEqual ) ; <nl> + } <nl> + <nl> + WASM_EXEC_TEST ( I16x8Less ) { RunI16x8CompareOpTest ( kExprI16x8LtS , Less ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I16x8LessEqual ) { <nl> + RunI16x8CompareOpTest ( kExprI16x8LeS , LessEqual ) ; <nl> + } <nl> + <nl> WASM_EXEC_TEST ( Ui16x8Greater ) { <nl> - RunI16x8BinOpTest ( kExprI16x8GtU , UnsignedGreater ) ; <nl> + RunI16x8CompareOpTest ( kExprI16x8GtU , UnsignedGreater ) ; <nl> } <nl> <nl> WASM_EXEC_TEST ( Ui16x8GreaterEqual ) { <nl> - RunI16x8BinOpTest ( kExprI16x8GeU , UnsignedGreaterEqual ) ; <nl> + RunI16x8CompareOpTest ( kExprI16x8GeU , UnsignedGreaterEqual ) ; <nl> } <nl> <nl> - WASM_EXEC_TEST ( Ui16x8Less ) { RunI16x8BinOpTest ( kExprI16x8LtU , UnsignedLess ) ; } <nl> + WASM_EXEC_TEST ( Ui16x8Less ) { <nl> + RunI16x8CompareOpTest ( kExprI16x8LtU , UnsignedLess ) ; <nl> + } <nl> <nl> WASM_EXEC_TEST ( Ui16x8LessEqual ) { <nl> - RunI16x8BinOpTest ( kExprI16x8LeU , UnsignedLessEqual ) ; <nl> + RunI16x8CompareOpTest ( kExprI16x8LeU , UnsignedLessEqual ) ; <nl> } <nl> <nl> void RunI16x8ShiftOpTest ( WasmOpcode simd_op , Int16ShiftOp expected_op , <nl> WASM_EXEC_TEST ( I8x16Min ) { RunI8x16BinOpTest ( kExprI8x16MinS , Minimum ) ; } <nl> <nl> WASM_EXEC_TEST ( I8x16Max ) { RunI8x16BinOpTest ( kExprI8x16MaxS , Maximum ) ; } <nl> <nl> - WASM_EXEC_TEST ( I8x16Equal ) { RunI8x16BinOpTest ( kExprI8x16Eq , Equal ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I8x16NotEqual ) { RunI8x16BinOpTest ( kExprI8x16Ne , NotEqual ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I8x16Greater ) { RunI8x16BinOpTest ( kExprI8x16GtS , Greater ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I8x16GreaterEqual ) { <nl> - RunI8x16BinOpTest ( kExprI8x16GeS , GreaterEqual ) ; <nl> - } <nl> - <nl> - WASM_EXEC_TEST ( I8x16Less ) { RunI8x16BinOpTest ( kExprI8x16LtS , Less ) ; } <nl> - <nl> - WASM_EXEC_TEST ( I8x16LessEqual ) { RunI8x16BinOpTest ( kExprI8x16LeS , LessEqual ) ; } <nl> - <nl> WASM_EXEC_TEST ( Ui8x16AddSaturate ) { <nl> RunI8x16BinOpTest ( kExprI8x16AddSaturateU , UnsignedAddSaturate ) ; <nl> } <nl> WASM_EXEC_TEST ( Ui8x16Max ) { <nl> RunI8x16BinOpTest ( kExprI8x16MaxU , UnsignedMaximum ) ; <nl> } <nl> <nl> + void RunI8x16CompareOpTest ( WasmOpcode simd_op , Int8BinOp expected_op ) { <nl> + FLAG_wasm_simd_prototype = true ; <nl> + WasmRunner < int32_t , int32_t , int32_t , int32_t > r ( kExecuteCompiled ) ; <nl> + byte a = 0 ; <nl> + byte b = 1 ; <nl> + byte expected = 2 ; <nl> + byte simd0 = r . AllocateLocal ( kWasmS128 ) ; <nl> + byte simd1 = r . AllocateLocal ( kWasmS128 ) ; <nl> + BUILD ( r , WASM_SET_LOCAL ( simd0 , WASM_SIMD_I8x16_SPLAT ( WASM_GET_LOCAL ( a ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , WASM_SIMD_I8x16_SPLAT ( WASM_GET_LOCAL ( b ) ) ) , <nl> + WASM_SET_LOCAL ( simd1 , <nl> + WASM_SIMD_MATERIALIZE_BOOLS ( <nl> + 8x16 , WASM_SIMD_BINOP ( simd_op , WASM_GET_LOCAL ( simd0 ) , <nl> + WASM_GET_LOCAL ( simd1 ) ) ) ) , <nl> + WASM_SIMD_CHECK_SPLAT16 ( I8x16 , simd1 , I32 , expected ) , WASM_ONE ) ; <nl> + <nl> + FOR_INT8_INPUTS ( i ) { <nl> + FOR_INT8_INPUTS ( j ) { CHECK_EQ ( 1 , r . Call ( * i , * j , expected_op ( * i , * j ) ) ) ; } <nl> + } <nl> + } <nl> + <nl> + WASM_EXEC_TEST ( I8x16Equal ) { RunI8x16CompareOpTest ( kExprI8x16Eq , Equal ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I8x16NotEqual ) { RunI8x16CompareOpTest ( kExprI8x16Ne , NotEqual ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I8x16Greater ) { RunI8x16CompareOpTest ( kExprI8x16GtS , Greater ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I8x16GreaterEqual ) { <nl> + RunI8x16CompareOpTest ( kExprI8x16GeS , GreaterEqual ) ; <nl> + } <nl> + <nl> + WASM_EXEC_TEST ( I8x16Less ) { RunI8x16CompareOpTest ( kExprI8x16LtS , Less ) ; } <nl> + <nl> + WASM_EXEC_TEST ( I8x16LessEqual ) { <nl> + RunI8x16CompareOpTest ( kExprI8x16LeS , LessEqual ) ; <nl> + } <nl> + <nl> WASM_EXEC_TEST ( Ui8x16Greater ) { <nl> - RunI8x16BinOpTest ( kExprI8x16GtU , UnsignedGreater ) ; <nl> + RunI8x16CompareOpTest ( kExprI8x16GtU , UnsignedGreater ) ; <nl> } <nl> <nl> WASM_EXEC_TEST ( Ui8x16GreaterEqual ) { <nl> - RunI8x16BinOpTest ( kExprI8x16GeU , UnsignedGreaterEqual ) ; <nl> + RunI8x16CompareOpTest ( kExprI8x16GeU , UnsignedGreaterEqual ) ; <nl> } <nl> <nl> - WASM_EXEC_TEST ( Ui8x16Less ) { RunI8x16BinOpTest ( kExprI8x16LtU , UnsignedLess ) ; } <nl> + WASM_EXEC_TEST ( Ui8x16Less ) { <nl> + RunI8x16CompareOpTest ( kExprI8x16LtU , UnsignedLess ) ; <nl> + } <nl> <nl> WASM_EXEC_TEST ( Ui8x16LessEqual ) { <nl> - RunI8x16BinOpTest ( kExprI8x16LeU , UnsignedLessEqual ) ; <nl> + RunI8x16CompareOpTest ( kExprI8x16LeU , UnsignedLessEqual ) ; <nl> } <nl> <nl> void RunI8x16ShiftOpTest ( WasmOpcode simd_op , Int8ShiftOp expected_op , <nl> WASM_EXEC_TEST ( I8x16ShrU ) { <nl> RunI8x16ShiftOpTest ( kExprI8x16ShrU , LogicalShiftRight , 1 ) ; <nl> } <nl> <nl> + / / Test Select by making a mask where the first two lanes are true and the rest <nl> + / / false , and comparing for non - equality with zero to materialize a bool vector . <nl> # define WASM_SIMD_SELECT_TEST ( format ) \ <nl> WASM_EXEC_TEST ( S # # format # # Select ) { \ <nl> FLAG_wasm_simd_prototype = true ; \ <nl> WasmRunner < int32_t , int32_t , int32_t > r ( kExecuteCompiled ) ; \ <nl> byte val1 = 0 ; \ <nl> byte val2 = 1 ; \ <nl> - byte mask = r . AllocateLocal ( kWasmS128 ) ; \ <nl> byte src1 = r . AllocateLocal ( kWasmS128 ) ; \ <nl> byte src2 = r . AllocateLocal ( kWasmS128 ) ; \ <nl> - BUILD ( r , WASM_SET_LOCAL ( mask , WASM_SIMD_I # # format # # _SPLAT ( WASM_ZERO ) ) , \ <nl> - WASM_SET_LOCAL ( src1 , \ <nl> - WASM_SIMD_I # # format # # _SPLAT ( WASM_GET_LOCAL ( val1 ) ) ) , \ <nl> + byte zero = r . AllocateLocal ( kWasmS128 ) ; \ <nl> + byte mask = r . AllocateLocal ( kWasmS128 ) ; \ <nl> + BUILD ( r , WASM_SET_LOCAL ( \ <nl> + src1 , WASM_SIMD_I # # format # # _SPLAT ( WASM_GET_LOCAL ( val1 ) ) ) , \ <nl> WASM_SET_LOCAL ( src2 , \ <nl> WASM_SIMD_I # # format # # _SPLAT ( WASM_GET_LOCAL ( val2 ) ) ) , \ <nl> + WASM_SET_LOCAL ( zero , WASM_SIMD_I # # format # # _SPLAT ( WASM_ZERO ) ) , \ <nl> WASM_SET_LOCAL ( mask , WASM_SIMD_I # # format # # _REPLACE_LANE ( \ <nl> - 1 , WASM_GET_LOCAL ( mask ) , WASM_I32V ( - 1 ) ) ) , \ <nl> + 1 , WASM_GET_LOCAL ( zero ) , WASM_I32V ( - 1 ) ) ) , \ <nl> WASM_SET_LOCAL ( mask , WASM_SIMD_I # # format # # _REPLACE_LANE ( \ <nl> 2 , WASM_GET_LOCAL ( mask ) , WASM_I32V ( - 1 ) ) ) , \ <nl> - WASM_SET_LOCAL ( mask , WASM_SIMD_SELECT ( format , WASM_GET_LOCAL ( mask ) , \ <nl> - WASM_GET_LOCAL ( src1 ) , \ <nl> - WASM_GET_LOCAL ( src2 ) ) ) , \ <nl> + WASM_SET_LOCAL ( \ <nl> + mask , \ <nl> + WASM_SIMD_SELECT ( format , WASM_SIMD_BINOP ( kExprI # # format # # Ne , \ <nl> + WASM_GET_LOCAL ( mask ) , \ <nl> + WASM_GET_LOCAL ( zero ) ) , \ <nl> + WASM_GET_LOCAL ( src1 ) , WASM_GET_LOCAL ( src2 ) ) ) , \ <nl> WASM_SIMD_CHECK_LANE ( I # # format , mask , I32 , val2 , 0 ) , \ <nl> WASM_SIMD_CHECK_LANE ( I # # format , mask , I32 , val1 , 1 ) , \ <nl> WASM_SIMD_CHECK_LANE ( I # # format , mask , I32 , val1 , 2 ) , \ <nl>
[ V8 ] Implement SIMD Boolean vector types to allow mask registers .
v8/v8
9fe0b4c7080daf0f52aaabf91ddaf0c6632cfbf8
2017-02-21T16:45:30Z
mmm a / tensorflow / contrib / training / python / training / hparam . py <nl> ppp b / tensorflow / contrib / training / python / training / hparam . py <nl> <nl> ( ( ? P < val > [ ^ , \ [ ] * ) # single value : " a " or None <nl> | <nl> \ [ ( ? P < vals > [ ^ \ ] ] * ) \ ] ) # list of values : None or " 1 , 2 , 3 " <nl> - ( $ | , ) " " " , re . VERBOSE ) <nl> + ( $ | , \ s * ) " " " , re . VERBOSE ) <nl> <nl> <nl> def _parse_fail ( name , var_type , value , values ) : <nl> mmm a / tensorflow / contrib / training / python / training / hparam_test . py <nl> ppp b / tensorflow / contrib / training / python / training / hparam_test . py <nl> def testSomeValues ( self ) : <nl> self . assertEqual ( 12 , hparams . aaa ) <nl> self . assertEqual ( 2 . 0 , hparams . b ) <nl> self . assertEqual ( ' relu6 ' , hparams . c_c ) <nl> - hparams . parse ( ' c_c = relu4 , b = - 2 . 0e10 ' ) <nl> + hparams . parse ( ' c_c = relu4 , b = - 2 . 0e10 ' ) <nl> self . assertDictEqual ( { <nl> ' aaa ' : 12 , <nl> ' b ' : - 2 . 0e10 , <nl>
Allow whitespace after commas in hparam strings .
tensorflow/tensorflow
25edaf3bf2e690a587f439ee0028af6aeace71a7
2018-01-22T18:39:55Z
mmm a / dlib / image_processing / scan_image_pyramid . h <nl> ppp b / dlib / image_processing / scan_image_pyramid . h <nl> namespace dlib <nl> for ( unsigned long l = 0 ; l < feats . size ( ) ; + + l ) <nl> { <nl> for ( unsigned long i = 0 ; i < saliency_images . size ( ) ; + + i ) <nl> + { <nl> saliency_images [ i ] . set_size ( feats [ l ] . nr ( ) , feats [ l ] . nc ( ) ) ; <nl> + const unsigned long offset = feats_config . get_num_dimensions ( ) * i ; <nl> <nl> - / / build saliency images for pyramid level l <nl> - for ( long r = 0 ; r < feats [ l ] . nr ( ) ; + + r ) <nl> - { <nl> - for ( long c = 0 ; c < feats [ l ] . nc ( ) ; + + c ) <nl> + / / build saliency images for pyramid level l <nl> + for ( long r = 0 ; r < feats [ l ] . nr ( ) ; + + r ) <nl> { <nl> - const typename feature_extractor_type : : descriptor_type & descriptor = feats [ l ] ( r , c ) ; <nl> - for ( unsigned long i = 0 ; i < saliency_images . size ( ) ; + + i ) <nl> + for ( long c = 0 ; c < feats [ l ] . nc ( ) ; + + c ) <nl> { <nl> - const unsigned long offset = feats_config . get_num_dimensions ( ) * i ; <nl> + const typename feature_extractor_type : : descriptor_type & descriptor = feats [ l ] ( r , c ) ; <nl> <nl> double sum = 0 ; <nl> for ( unsigned long k = 0 ; k < descriptor . size ( ) ; + + k ) <nl>
Changed code a bit to make it run faster .
davisking/dlib
6c0f5980d31e449811ab00d6866992983d2f9272
2011-12-29T20:42:08Z
mmm a / src / mongo / executor / network_interface_asio . h <nl> ppp b / src / mongo / executor / network_interface_asio . h <nl> class NetworkInterfaceASIO final : public NetworkInterface { <nl> * / <nl> class AsyncConnection { <nl> public : <nl> - AsyncConnection ( <nl> - ConnectionPool : : ConnectionPtr & & booststrapConn , <nl> - asio : : ip : : tcp : : socket & & sock ) ; <nl> + AsyncConnection ( ConnectionPool : : ConnectionPtr & & booststrapConn , <nl> + asio : : ip : : tcp : : socket & & sock ) ; <nl> <nl> asio : : ip : : tcp : : socket * sock ( ) ; <nl> <nl>
SERVER - 19156 fix lint
mongodb/mongo
871b5df1828bc6c857602f1d4d62b5b70a6702df
2015-07-02T16:00:47Z
mmm a / xbmc / lib / libPython / xbmcmodule / GUIPythonWindow . cpp <nl> ppp b / xbmc / lib / libPython / xbmcmodule / GUIPythonWindow . cpp <nl> bool CGUIPythonWindow : : OnAction ( const CAction & action ) <nl> PyXBMCAction * inf = new PyXBMCAction ; <nl> inf - > pObject = Action_FromAction ( action ) ; <nl> inf - > pCallbackWindow = pCallbackWindow ; <nl> + Py_INCREF ( pCallbackWindow ) ; <nl> <nl> / / aquire lock ? <nl> PyXBMC_AddPendingCall ( Py_XBMC_Event_OnAction , inf ) ; <nl> bool CGUIPythonWindow : : OnMessage ( CGUIMessage & message ) <nl> { <nl> / / create a new call and set it in the python queue <nl> inf - > pCallbackWindow = pCallbackWindow ; <nl> + Py_INCREF ( pCallbackWindow ) ; <nl> <nl> / / aquire lock ? <nl> PyXBMC_AddPendingCall ( Py_XBMC_Event_OnControl , inf ) ; <nl> int Py_XBMC_Event_OnControl ( void * arg ) <nl> if ( ret ) { <nl> Py_DECREF ( ret ) ; <nl> } <nl> + Py_DECREF ( action - > pCallbackWindow ) ; <nl> delete action ; <nl> } <nl> return 0 ; <nl> int Py_XBMC_Event_OnAction ( void * arg ) <nl> CLog : : Log ( LOGERROR , " Exception in python script ' s onAction " ) ; <nl> PyErr_Print ( ) ; <nl> } <nl> + Py_DECREF ( action - > pCallbackWindow ) ; <nl> delete action ; <nl> } <nl> return 0 ; <nl>
fixed : callback window for python pending calls , must not be deleted before the pending call has executed
xbmc/xbmc
3b200c7a080c0cfe33604aa88bd2d35b3c20ee85
2010-06-20T01:39:33Z
mmm a / ports / aws - sdk - cpp / CONTROL <nl> ppp b / ports / aws - sdk - cpp / CONTROL <nl> <nl> Source : aws - sdk - cpp <nl> - Version : 1 . 8 . 4 <nl> - Port - Version : 1 <nl> + Version : 1 . 8 . 83 <nl> + Port - Version : 0 <nl> Homepage : https : / / github . com / aws / aws - sdk - cpp <nl> Description : AWS SDK for C + + <nl> Build - Depends : openssl ( ! uwp & ! windows ) , curl ( ! uwp & ! windows ) , aws - c - event - stream <nl> mmm a / ports / aws - sdk - cpp / CONTROL . in <nl> ppp b / ports / aws - sdk - cpp / CONTROL . in <nl> <nl> Source : aws - sdk - cpp <nl> - Version : 1 . 8 . 4 <nl> - Port - Version : 1 <nl> + Version : 1 . 8 . 83 <nl> + Port - Version : 0 <nl> Description : AWS SDK for C + + <nl> Build - Depends : openssl ( ! uwp & ! windows ) , curl ( ! uwp & ! windows ) , aws - c - event - stream <nl> Default - Features : dynamodb , s3 , kinesis <nl> mmm a / ports / aws - sdk - cpp / portfile . cmake <nl> ppp b / ports / aws - sdk - cpp / portfile . cmake <nl> vcpkg_buildpath_length_warning ( 37 ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO aws / aws - sdk - cpp <nl> - REF 819b17b3915b1e6a9b704998efcaa51711dd1357 # 1 . 8 . 4 <nl> - SHA512 73647ca3426226236c476533d31038ebc8763d3f604b36089b10e645296c5012041cbc2c5bb8cec5d9ae593fe266edbef7bf278c924746f25186d3e6fc183158 <nl> + REF e98e5732ec7319051f162f7314ae361c85d0a8c9 # 1 . 8 . 83 <nl> + SHA512 da540db60551be833ea0315dd93241f9740ab953ed5657c1c7a8c401ae52a4e75b116758420b0a8a4ebb79358dff8377f5e052b180b36f0af27a36003f28bd56 <nl> HEAD_REF master <nl> ) <nl> <nl>
[ aws - sdk - cpp ] Update to 1 . 8 . 83 ( )
microsoft/vcpkg
254bd8fe89ba37d77718cefac6cd9a3f3446ebdd
2020-11-09T23:27:51Z
mmm a / include / swift / AST / PrintOptions . h <nl> ppp b / include / swift / AST / PrintOptions . h <nl> struct PrintOptions { <nl> bool PrintImplicitAttrs = true ; <nl> <nl> / / / List of attribute kinds that should not be printed . <nl> - std : : vector < DeclAttrKind > ExcludeAttrList = { DAK_Transparent } ; <nl> + std : : vector < DeclAttrKind > ExcludeAttrList = { DAK_Transparent , DAK_Effects } ; <nl> <nl> / / / List of attribute kinds that should be printed exclusively . <nl> / / / Empty means allow all . <nl>
[ ASTPrinter ] Avoid printing @ effects attribute by default .
apple/swift
442f34378fddcae9813da5451e286c055854dd0e
2014-09-08T16:29:56Z
mmm a / torch / utils / cpp_extension . py <nl> ppp b / torch / utils / cpp_extension . py <nl> def sanitize_flags ( flags ) : <nl> source_file = source_file . replace ( ' : ' , ' $ : ' ) <nl> object_file = object_file . replace ( ' : ' , ' $ : ' ) <nl> source_file = source_file . replace ( " " , " $ " ) <nl> + object_file = object_file . replace ( " " , " $ " ) <nl> build . append ( ' build { } : { } { } ' . format ( object_file , rule , source_file ) ) <nl> <nl> if library_target is not None : <nl>
Fix cpp extension build failure if path contains space ( )
pytorch/pytorch
4e46c95826eb59f99fbaddf46016c2d4eb8fdd03
2020-05-21T19:36:27Z
mmm a / lib / LLVMPasses / ARCEntryPointBuilder . h <nl> ppp b / lib / LLVMPasses / ARCEntryPointBuilder . h <nl> class ARCEntryPointBuilder { <nl> <nl> / / Create the call . <nl> CallInst * CI = CreateCall ( getRetain ( OrigI ) , V ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> <nl> / / Create the call . <nl> CallInst * CI = CreateCall ( getRelease ( OrigI ) , V ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> V = B . CreatePointerCast ( V , getObjectPtrTy ( ) ) ; <nl> <nl> CallInst * CI = CreateCall ( getCheckUnowned ( OrigI ) , V ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> / / Cast just to make sure that we have the right object type . <nl> V = B . CreatePointerCast ( V , getObjectPtrTy ( ) ) ; <nl> CallInst * CI = CreateCall ( getRetainN ( OrigI ) , { V , getIntConstant ( n ) } ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> / / Cast just to make sure we have the right object type . <nl> V = B . CreatePointerCast ( V , getObjectPtrTy ( ) ) ; <nl> CallInst * CI = CreateCall ( getReleaseN ( OrigI ) , { V , getIntConstant ( n ) } ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> V = B . CreatePointerCast ( V , getObjectPtrTy ( ) ) ; <nl> CallInst * CI = <nl> CreateCall ( getUnknownObjectRetainN ( OrigI ) , { V , getIntConstant ( n ) } ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> V = B . CreatePointerCast ( V , getObjectPtrTy ( ) ) ; <nl> CallInst * CI = <nl> CreateCall ( getUnknownObjectReleaseN ( OrigI ) , { V , getIntConstant ( n ) } ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> / / Cast just to make sure we have the right object type . <nl> V = B . CreatePointerCast ( V , getBridgeObjectPtrTy ( ) ) ; <nl> CallInst * CI = CreateCall ( getBridgeRetainN ( OrigI ) , { V , getIntConstant ( n ) } ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> class ARCEntryPointBuilder { <nl> / / Cast just to make sure we have the right object type . <nl> V = B . CreatePointerCast ( V , getBridgeObjectPtrTy ( ) ) ; <nl> CallInst * CI = CreateCall ( getBridgeReleaseN ( OrigI ) , { V , getIntConstant ( n ) } ) ; <nl> - CI - > setTailCall ( true ) ; <nl> return CI ; <nl> } <nl> <nl> mmm a / test / LLVMPasses / contract . ll <nl> ppp b / test / LLVMPasses / contract . ll <nl> entry : <nl> ; CHECK : entry : <nl> ; CHECK - NEXT : br i1 undef <nl> ; CHECK : bb1 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractRetainN ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> bb3 : <nl> ; CHECK : entry : <nl> ; CHECK - NEXT : br i1 undef <nl> ; CHECK : bb1 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : % 1 = bitcast % swift . refcounted * % A to % swift . refcounted * <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractRetainNWithRCIdentity ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> % 1 = bitcast % swift . refcounted * % A to % swift . refcounted * <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % 1 ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % 1 ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> bb3 : <nl> ; CHECK - NEXT : br i1 undef <nl> ; CHECK : bb1 : <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call void @ swift_release ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call void @ swift_release ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractReleaseN ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> bb3 : <nl> ; CHECK - NEXT : br i1 undef <nl> ; CHECK : bb1 : <nl> ; CHECK - NEXT : % 0 = bitcast % swift . refcounted * % A to % swift . refcounted * <nl> - ; CHECK - NEXT : tail call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> - ; CHECK - NEXT : tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call void @ swift_release ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call void @ swift_release ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractReleaseNWithRCIdentity ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> % 0 = bitcast % swift . refcounted * % A to % swift . refcounted * <nl> - tail call void @ swift_release ( % swift . refcounted * % 0 ) <nl> + call void @ swift_release ( % swift . refcounted * % 0 ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> ; But do make sure that we can form retainN , releaseN in between such uses <nl> ; CHECK - LABEL : define { { ( protected ) ? } } % swift . refcounted * @ swift_contractRetainNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> ; CHECK : bb1 : <nl> - ; CHECK : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 3 ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 3 ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb2 : <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractRetainNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> ; CHECK - LABEL : define { { ( protected ) ? } } % swift . refcounted * @ swift_contractRetainReleaseNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> ; CHECK : bb1 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> - ; CHECK - NEXT : tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_retain_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_release ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_release_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> bb3 : <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call void @ swift_release ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractRetainReleaseNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_retain ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_release ( % swift . refcounted * % A ) <nl> + call void @ swift_release ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> ; CHECK - LABEL : define { { ( protected ) ? } } % swift . refcounted * @ swift_contractUnknownObjectRetainNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> ; CHECK : bb1 : <nl> - ; CHECK : tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + ; CHECK : call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain_n ( % swift . refcounted * % A , i32 3 ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain_n ( % swift . refcounted * % A , i32 3 ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb2 : <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractUnknownObjectRetainNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> ; CHECK - LABEL : define { { ( protected ) ? } } % swift . refcounted * @ swift_contractUnknownObjectRetainReleaseNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> ; CHECK : bb1 : <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_unknownObjectRelease_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_unknownObjectRelease_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call % swift . refcounted * @ swift_unknownObjectRetain_n ( % swift . refcounted * % A , i32 2 ) <nl> - ; CHECK - NEXT : tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call % swift . refcounted * @ swift_unknownObjectRetain_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : call void @ noread_user ( % swift . refcounted * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_unknownObjectRelease_n ( % swift . refcounted * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_unknownObjectRelease_n ( % swift . refcounted * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> bb3 : <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + ; CHECK - NEXT : call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> ; CHECK - NEXT : ret % swift . refcounted * % A <nl> define % swift . refcounted * @ swift_contractUnknownObjectRetainReleaseNInterleavedWithUnknown ( % swift . refcounted * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> - tail call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call % swift . refcounted * @ swift_unknownObjectRetain ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ noread_user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user ( % swift . refcounted * % A ) <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> call void @ user ( % swift . refcounted * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> + call void @ swift_unknownObjectRelease ( % swift . refcounted * % A ) <nl> ret % swift . refcounted * % A <nl> } <nl> <nl> <nl> ; CHECK - LABEL : define { { ( protected ) ? } } % swift . bridge * @ swift_contractBridgeRetainWithBridge ( % swift . bridge * % A ) { <nl> ; CHECK : bb1 : <nl> - ; CHECK - NEXT : [ [ RET0 : % . + ] ] = tail call % swift . bridge * @ swift_bridgeObjectRetain_n ( % swift . bridge * % A , i32 2 ) <nl> - ; CHECK - NEXT : tail call void @ swift_bridgeObjectRelease ( % swift . bridge * [ [ RET0 : % . + ] ] ) <nl> - ; CHECK - NEXT : tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + ; CHECK - NEXT : [ [ RET0 : % . + ] ] = call % swift . bridge * @ swift_bridgeObjectRetain_n ( % swift . bridge * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_bridgeObjectRelease ( % swift . bridge * [ [ RET0 : % . + ] ] ) <nl> + ; CHECK - NEXT : call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : ret % swift . bridge * % A <nl> define % swift . bridge * @ swift_contractBridgeRetainWithBridge ( % swift . bridge * % A ) { <nl> bb1 : <nl> - % 0 = tail call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> - % 1 = tail call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % 1 ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + % 0 = call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> + % 1 = call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % 1 ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> ret % swift . bridge * % A <nl> } <nl> <nl> ; CHECK - LABEL : define { { ( protected ) ? } } % swift . bridge * @ swift_contractBridgeRetainReleaseNInterleavedWithBridge ( % swift . bridge * % A ) { <nl> ; CHECK : bb1 : <nl> - ; CHECK - NEXT : [ [ RET0 : % . + ] ] = tail call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> + ; CHECK - NEXT : [ [ RET0 : % . + ] ] = call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : call void @ user_bridged ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : call void @ noread_user_bridged ( % swift . bridge * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_bridgeObjectRelease_n ( % swift . bridge * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_bridgeObjectRelease_n ( % swift . bridge * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user_bridged ( % swift . bridge * % A ) <nl> - ; CHECK - NEXT : [ [ RET1 : % . + ] ] = tail call % swift . bridge * @ swift_bridgeObjectRetain_n ( % swift . bridge * % A , i32 2 ) <nl> - ; CHECK - NEXT : tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + ; CHECK - NEXT : [ [ RET1 : % . + ] ] = call % swift . bridge * @ swift_bridgeObjectRetain_n ( % swift . bridge * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : call void @ user_bridged ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : call void @ noread_user_bridged ( % swift . bridge * % A ) <nl> - ; CHECK - NEXT : tail call void @ swift_bridgeObjectRelease_n ( % swift . bridge * % A , i32 2 ) <nl> + ; CHECK - NEXT : call void @ swift_bridgeObjectRelease_n ( % swift . bridge * % A , i32 2 ) <nl> ; CHECK - NEXT : call void @ user_bridged ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : br label % bb3 <nl> ; CHECK : bb2 : <nl> bb1 : <nl> ; CHECK - NEXT : br label % bb3 <nl> <nl> ; CHECK : bb3 : <nl> - ; CHECK - NEXT : tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + ; CHECK - NEXT : call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> ; CHECK - NEXT : ret % swift . bridge * % A <nl> define % swift . bridge * @ swift_contractBridgeRetainReleaseNInterleavedWithBridge ( % swift . bridge * % A ) { <nl> entry : <nl> br i1 undef , label % bb1 , label % bb2 <nl> <nl> bb1 : <nl> - tail call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> + call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> call void @ user_bridged ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> call void @ noread_user_bridged ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> call void @ user_bridged ( % swift . bridge * % A ) <nl> - tail call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> - tail call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> + call % swift . bridge * @ swift_bridgeObjectRetain ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> call void @ user_bridged ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> call void @ noread_user_bridged ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> call void @ user_bridged ( % swift . bridge * % A ) <nl> br label % bb3 <nl> <nl> bb2 : <nl> call void @ user_bridged ( % swift . bridge * % A ) <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> call void @ user_bridged ( % swift . bridge * % A ) <nl> br label % bb3 <nl> <nl> bb3 : <nl> - tail call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> + call void @ swift_bridgeObjectRelease ( % swift . bridge * % A ) <nl> ret % swift . bridge * % A <nl> } <nl> <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
4473b97f4c52a30f47c9fb7aa5437e8c7555a343
2019-03-22T04:49:58Z
mmm a / dbms / src / Client / MultiplexedConnections . h <nl> ppp b / dbms / src / Client / MultiplexedConnections . h <nl> class MultiplexedConnections final : private boost : : noncopyable <nl> / / / Get packet from any replica . <nl> Connection : : Packet receivePacket ( ) ; <nl> <nl> - / / / Get information about the last received package . <nl> + / / / Get information about the last received packet . <nl> BlockExtraInfo getBlockExtraInfo ( ) const ; <nl> <nl> / / / Break all active connections . <nl> mmm a / dbms / src / DataStreams / RemoteBlockInputStream . cpp <nl> ppp b / dbms / src / DataStreams / RemoteBlockInputStream . cpp <nl> void RemoteBlockInputStream : : readSuffixImpl ( ) <nl> / / / Send the request to abort the execution of the request , if not already sent . <nl> tryCancel ( " Cancelling query because enough data has been read " ) ; <nl> <nl> - / / / Get the remaining packages so that there is no out of sync in the connections to the replicas . <nl> + / / / Get the remaining packets so that there is no out of sync in the connections to the replicas . <nl> Connection : : Packet packet = multiplexed_connections - > drain ( ) ; <nl> switch ( packet . type ) <nl> { <nl> mmm a / dbms / src / Server / TCPHandler . cpp <nl> ppp b / dbms / src / Server / TCPHandler . cpp <nl> void TCPHandler : : processOrdinaryQuery ( ) <nl> { <nl> if ( isQueryCancelled ( ) ) <nl> { <nl> - / / / A package was received requesting to stop execution of the request . <nl> + / / / A packet was received requesting to stop execution of the request . <nl> async_in . cancel ( ) ; <nl> break ; <nl> } <nl>
Fixed awful translation [ # CLICKHOUSE - 2 ] .
ClickHouse/ClickHouse
dc5eca0bebf41bf91b88ec3bcc24e664e5d22f3d
2017-09-10T02:06:16Z
mmm a / tensorflow / core / profiler / convert / op_stats_to_overview_page . cc <nl> ppp b / tensorflow / core / profiler / convert / op_stats_to_overview_page . cc <nl> OverviewPage ConvertOpStatsToOverviewPage ( const OpStats & op_stats , <nl> bottleneck . input_classification ( ) , bottleneck . input_statement ( ) , " " , <nl> hardware_type , TfFunctionRecommendationHtml ( op_stats . tf_function_db ( ) ) , <nl> overview_page . mutable_recommendation ( ) ) ; <nl> - * overview_page . mutable_errors ( ) = op_stats . errors ( ) ; <nl> + SetOverviewPageErrorMessage ( op_stats , & overview_page ) ; <nl> return overview_page ; <nl> } <nl> <nl> void SetRemarks ( const OpStats & op_stats , OverviewPageAnalysis * analysis ) { <nl> } <nl> } <nl> <nl> + void SetOverviewPageErrorMessage ( const OpStats & op_stats , <nl> + OverviewPage * overview_page ) { <nl> + * overview_page - > mutable_errors ( ) = op_stats . errors ( ) ; <nl> + absl : : c_sort ( * overview_page - > mutable_errors ( ) ) ; <nl> + if ( overview_page - > errors ( ) . empty ( ) ) { <nl> + / / Shows run - environment error only if there is no other existing error . <nl> + if ( op_stats . run_environment ( ) . device_type ( ) ! = " CPU " & & <nl> + op_stats . run_environment ( ) . device_core_count ( ) < = 0 ) { <nl> + * overview_page - > add_errors ( ) = std : : string ( kNoDeviceTraceCollected ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> } / / namespace profiler <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / profiler / convert / op_stats_to_overview_page . h <nl> ppp b / tensorflow / core / profiler / convert / op_stats_to_overview_page . h <nl> OverviewPageAnalysis ComputeAnalysisResult ( const OpStats & op_stats ) ; <nl> OverviewPageRunEnvironment ComputeRunEnvironment ( <nl> const RunEnvironment & run_environment ) ; <nl> <nl> + void SetOverviewPageErrorMessage ( const OpStats & op_stats , <nl> + OverviewPage * overview_page ) ; <nl> + <nl> OverviewPage ConvertOpStatsToOverviewPage ( const OpStats & op_stats , <nl> HardwareType hardware_type ) ; <nl> <nl> mmm a / tensorflow / core / profiler / utils / errors . cc <nl> ppp b / tensorflow / core / profiler / utils / errors . cc <nl> const absl : : string_view kErrorNoStepMarker = <nl> " than the step time . For ( 1 ) , you need to add step instrumentation ; " <nl> " for ( 2 ) , you may try to profile longer . " ; <nl> <nl> + const absl : : string_view kNoDeviceTraceCollected = <nl> + " No device trace was collected . This might happen if your job hadn ' t been " <nl> + " run on the device when sampling was turned on . You could try the sampling " <nl> + " again later . " ; <nl> + <nl> } / / namespace profiler <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / profiler / utils / errors . h <nl> ppp b / tensorflow / core / profiler / utils / errors . h <nl> ABSL_CONST_INIT extern const absl : : string_view kErrorIncompleteStep ; <nl> / / step info . <nl> ABSL_CONST_INIT extern const absl : : string_view kErrorNoStepMarker ; <nl> <nl> + ABSL_CONST_INIT extern const absl : : string_view kNoDeviceTraceCollected ; <nl> + <nl> } / / namespace profiler <nl> } / / namespace tensorflow <nl> <nl>
Add overview errors to gviz . Move the RunEnvironmentErrorMessage processing to OpStatsToOverviewPage . This way , overview_page to gviz is a simple datable insert .
tensorflow/tensorflow
692e52c10fef03cf02f667eac4d2526416b98597
2020-05-27T04:09:21Z
mmm a / include / osquery / config . h <nl> ppp b / include / osquery / config . h <nl> class Config : private boost : : noncopyable { <nl> / * * <nl> * @ brief Calculate the hash of the osquery config <nl> * <nl> - * @ return The MD5 of the osquery config <nl> + * @ return The SHA1 hash of the osquery config <nl> * / <nl> - Status getMD5 ( std : : string & hash ) ; <nl> + Status genHash ( std : : string & hash ) ; <nl> <nl> / * * <nl> * @ brief Hash a source ' s config data <nl> mmm a / include / osquery / sdk . h <nl> ppp b / include / osquery / sdk . h <nl> <nl> # include < osquery / extensions . h > <nl> # include < osquery / filesystem . h > <nl> # include < osquery / flags . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / logger . h > <nl> # include < osquery / registry . h > <nl> # include < osquery / sql . h > <nl> REGISTER_INTERNAL ( ExternalSQLPlugin , " sql " , " sql " ) ; <nl> # undef CREATE_LAZY_REGISTRY <nl> # define CREATE_LAZY_REGISTRY " Do not CREATE_LAZY_REGISTRY in the osquery SDK " <nl> } <nl> - <nl> mmm a / osquery / CMakeLists . txt <nl> ppp b / osquery / CMakeLists . txt <nl> if ( NOT WINDOWS ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " crypto " ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " libpthread " ) <nl> <nl> - ADD_OSQUERY_LINK_CORE ( " crypto " ) <nl> - <nl> # Linenoise will be used when compiling osqueryi . <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " linenoise " ) <nl> endif ( ) <nl> mmm a / osquery / config / config . cpp <nl> ppp b / osquery / config / config . cpp <nl> <nl> # include < osquery / database . h > <nl> # include < osquery / filesystem . h > <nl> # include < osquery / flags . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / logger . h > <nl> # include < osquery / packs . h > <nl> # include < osquery / registry . h > <nl> void Config : : getPerformanceStats ( <nl> <nl> void Config : : hashSource ( const std : : string & source , const std : : string & content ) { <nl> WriteLock wlock ( config_hash_mutex_ ) ; <nl> - hash_ [ source ] = <nl> - hashFromBuffer ( HASH_TYPE_MD5 , & ( content . c_str ( ) ) [ 0 ] , content . size ( ) ) ; <nl> + hash_ [ source ] = getBufferSHA1 ( content . c_str ( ) , content . size ( ) ) ; <nl> } <nl> <nl> - Status Config : : getMD5 ( std : : string & hash ) { <nl> + Status Config : : genHash ( std : : string & hash ) { <nl> if ( ! valid_ ) { <nl> return Status ( 1 , " Current config is not valid " ) ; <nl> } <nl> Status Config : : getMD5 ( std : : string & hash ) { <nl> for ( const auto & it : hash_ ) { <nl> add ( it . second ) ; <nl> } <nl> + hash = getBufferSHA1 ( buffer . data ( ) , buffer . size ( ) ) ; <nl> <nl> - hash = hashFromBuffer ( HASH_TYPE_MD5 , & buffer [ 0 ] , buffer . size ( ) ) ; <nl> return Status ( 0 , " OK " ) ; <nl> } <nl> <nl> mmm a / osquery / config / packs . cpp <nl> ppp b / osquery / config / packs . cpp <nl> <nl> # include < random > <nl> <nl> # include < osquery / core . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / logger . h > <nl> # include < osquery / packs . h > <nl> # include < osquery / sql . h > <nl> size_t getMachineShard ( const std : : string & hostname = " " , bool force = false ) { <nl> <nl> / / An optional input hostname may override hostname detection for testing . <nl> auto hn = ( hostname . empty ( ) ) ? getHostname ( ) : hostname ; <nl> - auto hn_hash = hashFromBuffer ( HASH_TYPE_MD5 , hn . c_str ( ) , hn . size ( ) ) ; <nl> + auto hn_hash = getBufferSHA1 ( hn . c_str ( ) , hn . size ( ) ) ; <nl> + <nl> if ( hn_hash . size ( ) > = 2 ) { <nl> long hn_char ; <nl> if ( safeStrtol ( hn_hash . substr ( 0 , 2 ) , 16 , hn_char ) ) { <nl> mmm a / osquery / config / plugins / tests / tls_config_tests . cpp <nl> ppp b / osquery / config / plugins / tests / tls_config_tests . cpp <nl> TEST_F ( TLSConfigTests , test_retrieve_config ) { <nl> c . load ( ) ; <nl> <nl> const auto & hashes = c . hash_ ; <nl> - EXPECT_EQ ( " c109cd4fc0a928dba787384a89f9d03d " , hashes . at ( " tls_plugin " ) ) ; <nl> + EXPECT_EQ ( " b7718020a76ced2eda82336bd15165009603d4fb " , <nl> + hashes . at ( " tls_plugin " ) ) ; <nl> <nl> / / Configure the plugin to use the node API . <nl> Flag : : updateValue ( " tls_node_api " , " 1 " ) ; <nl> mmm a / osquery / core / CMakeLists . txt <nl> ppp b / osquery / core / CMakeLists . txt <nl> ADD_OSQUERY_LIBRARY ( TRUE osquery_core <nl> $ { OS_CORE_SOURCE } <nl> tables . cpp <nl> flags . cpp <nl> - hash . cpp <nl> watcher . cpp <nl> process_shared . cpp <nl> ) <nl> mmm a / osquery / core / conversions . cpp <nl> ppp b / osquery / core / conversions . cpp <nl> <nl> * <nl> * / <nl> <nl> + # include < iomanip > <nl> # include < sstream > <nl> <nl> # include < boost / algorithm / string . hpp > <nl> - # include < boost / archive / iterators / transform_width . hpp > <nl> - # include < boost / archive / iterators / binary_from_base64 . hpp > <nl> # include < boost / archive / iterators / base64_from_binary . hpp > <nl> + # include < boost / archive / iterators / binary_from_base64 . hpp > <nl> + # include < boost / archive / iterators / transform_width . hpp > <nl> + # include < boost / uuid / sha1 . hpp > <nl> <nl> # include " osquery / core / conversions . h " <nl> <nl> std : : vector < std : : string > split ( const std : : string & s , <nl> std : : string join ( const std : : vector < std : : string > & s , const std : : string & tok ) { <nl> return boost : : algorithm : : join ( s , tok ) ; <nl> } <nl> + <nl> + std : : string getBufferSHA1 ( const char * buffer , size_t size ) { <nl> + / / SHA1 produces 160 - bit digests , so allocate ( 5 * 32 ) bits . <nl> + uint32_t digest [ 5 ] = { 0 } ; <nl> + boost : : uuids : : detail : : sha1 sha1 ; <nl> + sha1 . process_bytes ( buffer , size ) ; <nl> + sha1 . get_digest ( digest ) ; <nl> + <nl> + / / Convert digest to desired hex string representation . <nl> + std : : stringstream result ; <nl> + result < < std : : hex < < std : : setfill ( ' 0 ' ) ; <nl> + for ( size_t i = 0 ; i < 5 ; + + i ) { <nl> + result < < std : : setw ( sizeof ( uint32_t ) * 2 ) < < digest [ i ] ; <nl> + } <nl> + return result . str ( ) ; <nl> + } <nl> } <nl> mmm a / osquery / core / conversions . h <nl> ppp b / osquery / core / conversions . h <nl> inline size_t utf8StringSize ( const std : : string & str ) { <nl> return res ; <nl> } <nl> <nl> + / * <nl> + * @ brief Request a SHA1 hash from the contents of a buffer . <nl> + * <nl> + * @ param buffer A caller - controlled buffer ( already allocated ) . <nl> + * @ param size The length of the controlled buffer . <nl> + * @ return A string ( hex ) representation of the hash digest . <nl> + * / <nl> + std : : string getBufferSHA1 ( const char * buffer , size_t size ) ; <nl> + <nl> # ifdef DARWIN <nl> / * * <nl> * @ brief Convert a CFStringRef to a std : : string . <nl> mmm a / osquery / core / tests / conversions_tests . cpp <nl> ppp b / osquery / core / tests / conversions_tests . cpp <nl> TEST_F ( ConversionsTests , test_split_occurences ) { <nl> } ; <nl> EXPECT_EQ ( split ( content , " : " , 1 ) , expected ) ; <nl> } <nl> + <nl> + TEST_F ( ConversionsTests , test_buffer_sha1 ) { <nl> + std : : string test = " test \ n " ; <nl> + EXPECT_EQ ( " 4e1243bd22c66e76c2ba9eddc1f91394e57f9f83 " , <nl> + getBufferSHA1 ( test . c_str ( ) , test . size ( ) ) ) ; <nl> + } <nl> } <nl> deleted file mode 100644 <nl> index 0c3cd68eb1 . . 0000000000 <nl> mmm a / osquery / core / tests / hash_tests . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - * Copyright ( c ) 2014 - present , Facebook , Inc . <nl> - * All rights reserved . <nl> - * <nl> - * This source code is licensed under the BSD - style license found in the <nl> - * LICENSE file in the root directory of this source tree . An additional grant <nl> - * of patent rights can be found in the PATENTS file in the same directory . <nl> - * <nl> - * / <nl> - <nl> - # include < gtest / gtest . h > <nl> - <nl> - # include < osquery / hash . h > <nl> - <nl> - # include " osquery / tests / test_util . h " <nl> - <nl> - namespace osquery { <nl> - <nl> - class HashTests : public testing : : Test { } ; <nl> - <nl> - TEST_F ( HashTests , test_algorithms ) { <nl> - const unsigned char buffer [ 1 ] = { ' 0 ' } ; <nl> - <nl> - auto digest = hashFromBuffer ( HASH_TYPE_MD5 , buffer , 1 ) ; <nl> - EXPECT_EQ ( digest , " cfcd208495d565ef66e7dff9f98764da " ) ; <nl> - <nl> - digest = hashFromBuffer ( HASH_TYPE_SHA1 , buffer , 1 ) ; <nl> - EXPECT_EQ ( digest , " b6589fc6ab0dc82cf12099d1c2d40ab994e8410c " ) ; <nl> - <nl> - digest = hashFromBuffer ( HASH_TYPE_SHA256 , buffer , 1 ) ; <nl> - EXPECT_EQ ( digest , <nl> - " 5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9 " ) ; <nl> - } <nl> - <nl> - TEST_F ( HashTests , test_update ) { <nl> - const unsigned char buffer [ 1 ] = { ' 0 ' } ; <nl> - <nl> - Hash hash ( HASH_TYPE_MD5 ) ; <nl> - hash . update ( buffer , 1 ) ; <nl> - hash . update ( buffer , 1 ) ; <nl> - auto digest = hash . digest ( ) ; <nl> - EXPECT_EQ ( digest , " b4b147bc522828731f1a016bfa72c073 " ) ; <nl> - } <nl> - <nl> - TEST_F ( HashTests , test_file_hashing ) { <nl> - auto digest = hashFromFile ( HASH_TYPE_MD5 , kTestDataPath + " test_hashing . bin " ) ; <nl> - EXPECT_EQ ( digest , " 88ee11f2aa7903f34b8b8785d92208b1 " ) ; <nl> - } <nl> - } <nl> mmm a / osquery / tables / events / event_utils . cpp <nl> ppp b / osquery / tables / events / event_utils . cpp <nl> <nl> * / <nl> <nl> # include < osquery / events . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / sql . h > <nl> <nl> # include " osquery / tables / events / event_utils . h " <nl> + # include " osquery / tables / system / hash . h " <nl> <nl> namespace osquery { <nl> <nl> mmm a / osquery / tables / forensic / sleuthkit . cpp <nl> ppp b / osquery / tables / forensic / sleuthkit . cpp <nl> <nl> # include < tsk / libtsk . h > <nl> <nl> # include < osquery / filesystem . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / logger . h > <nl> # include < osquery / tables . h > <nl> <nl> # include " osquery / core / conversions . h " <nl> + # include " osquery / tables / system / hash . h " <nl> <nl> namespace fs = boost : : filesystem ; <nl> <nl> mmm a / osquery / tables / system / darwin / acpi_tables . cpp <nl> ppp b / osquery / tables / system / darwin / acpi_tables . cpp <nl> <nl> # include < CoreFoundation / CoreFoundation . h > <nl> # include < IOKit / IOKitLib . h > <nl> <nl> - # include < osquery / hash . h > <nl> # include < osquery / tables . h > <nl> <nl> # include " osquery / core / conversions . h " <nl> + # include " osquery / tables / system / hash . h " <nl> <nl> namespace osquery { <nl> namespace tables { <nl> namespace tables { <nl> # define kIOACPIClassName_ " AppleACPIPlatformExpert " <nl> # define kIOACPIPropertyName_ " ACPI Tables " <nl> <nl> - void genACPITable ( const void * key , const void * value , void * results ) { <nl> + void genACPITable ( const void * key , const void * value , void * results ) { <nl> Row r ; <nl> - <nl> - r [ " name " ] = stringFromCFString ( ( CFStringRef ) key ) ; <nl> - <nl> auto data = ( CFDataRef ) value ; <nl> auto length = CFDataGetLength ( data ) ; <nl> + <nl> + r [ " name " ] = stringFromCFString ( ( CFStringRef ) key ) ; <nl> r [ " size " ] = INTEGER ( length ) ; <nl> - r [ " md5 " ] = <nl> - osquery : : hashFromBuffer ( HASH_TYPE_MD5 , CFDataGetBytePtr ( data ) , length ) ; <nl> + r [ " md5 " ] = hashFromBuffer ( HASH_TYPE_MD5 , CFDataGetBytePtr ( data ) , length ) ; <nl> <nl> - ( ( QueryData * ) results ) - > push_back ( r ) ; <nl> + ( ( QueryData * ) results ) - > push_back ( r ) ; <nl> } <nl> <nl> QueryData genACPITables ( QueryContext & context ) { <nl> mmm a / osquery / tables / system / darwin / ad_config . cpp <nl> ppp b / osquery / tables / system / darwin / ad_config . cpp <nl> <nl> * / <nl> <nl> # include < osquery / filesystem . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / sql . h > <nl> # include < osquery / tables . h > <nl> <nl> mmm a / osquery / tables / system / darwin / kernel_info . cpp <nl> ppp b / osquery / tables / system / darwin / kernel_info . cpp <nl> <nl> # include < boost / uuid / uuid . hpp > <nl> # include < boost / uuid / uuid_io . hpp > <nl> <nl> - # include < osquery / hash . h > <nl> # include < osquery / logger . h > <nl> # include < osquery / tables . h > <nl> <nl> mmm a / osquery / tables / system / darwin / keychain_utils . cpp <nl> ppp b / osquery / tables / system / darwin / keychain_utils . cpp <nl> <nl> # include < boost / lexical_cast . hpp > <nl> <nl> # include < osquery / filesystem . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / core . h > <nl> <nl> # include " osquery / tables / system / darwin / keychain . h " <nl> + # include " osquery / tables / system / hash . h " <nl> <nl> namespace osquery { <nl> namespace tables { <nl> mmm a / osquery / tables / system / darwin / packages . cpp <nl> ppp b / osquery / tables / system / darwin / packages . cpp <nl> <nl> <nl> # include < osquery / filesystem . h > <nl> # include < osquery / logger . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / sql . h > <nl> # include < osquery / tables . h > <nl> <nl> similarity index 56 % <nl> rename from osquery / core / hash . cpp <nl> rename to osquery / tables / system / hash . cpp <nl> mmm a / osquery / core / hash . cpp <nl> ppp b / osquery / tables / system / hash . cpp <nl> <nl> # include < sstream > <nl> # include < vector > <nl> <nl> + # include < boost / filesystem . hpp > <nl> + <nl> # include < osquery / filesystem . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / logger . h > <nl> + # include < osquery / tables . h > <nl> + <nl> + # include " osquery / tables / system / hash . h " <nl> <nl> namespace osquery { <nl> <nl> namespace osquery { <nl> # import < CommonCrypto / CommonDigest . h > <nl> # define __HASH_API ( name ) CC_ # # name <nl> # else <nl> - # include < openssl / sha . h > <nl> # include < openssl / md5 . h > <nl> + # include < openssl / sha . h > <nl> # define __HASH_API ( name ) name <nl> <nl> # define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH <nl> std : : string hashFromFile ( HashType hash_type , const std : : string & path ) { <nl> return hashes . sha256 ; <nl> } <nl> } <nl> + <nl> + namespace tables { <nl> + <nl> + void genHashForFile ( const std : : string & path , <nl> + const std : : string & dir , <nl> + QueryContext & context , <nl> + QueryData & results ) { <nl> + / / Must provide the path , filename , directory separate from boost path - > string <nl> + / / helpers to match any explicit ( query - parsed ) predicate constraints . <nl> + Row r ; <nl> + if ( context . isCached ( path ) ) { <nl> + r = context . getCache ( path ) ; <nl> + } else { <nl> + auto hashes = hashMultiFromFile ( <nl> + HASH_TYPE_MD5 | HASH_TYPE_SHA1 | HASH_TYPE_SHA256 , path ) ; <nl> + <nl> + r [ " path " ] = path ; <nl> + r [ " directory " ] = dir ; <nl> + r [ " md5 " ] = std : : move ( hashes . md5 ) ; <nl> + r [ " sha1 " ] = std : : move ( hashes . sha1 ) ; <nl> + r [ " sha256 " ] = std : : move ( hashes . sha256 ) ; <nl> + context . setCache ( path , r ) ; <nl> + } <nl> + results . push_back ( r ) ; <nl> + } <nl> + <nl> + QueryData genHash ( QueryContext & context ) { <nl> + QueryData results ; <nl> + boost : : system : : error_code ec ; <nl> + <nl> + / / The query must provide a predicate with constraints including path or <nl> + / / directory . We search for the parsed predicate constraints with the equals <nl> + / / operator . <nl> + auto paths = context . constraints [ " path " ] . getAll ( EQUALS ) ; <nl> + context . expandConstraints ( <nl> + " path " , <nl> + LIKE , <nl> + paths , <nl> + ( [ & ] ( const std : : string & pattern , std : : set < std : : string > & out ) { <nl> + std : : vector < std : : string > patterns ; <nl> + auto status = <nl> + resolveFilePattern ( pattern , patterns , GLOB_ALL | GLOB_NO_CANON ) ; <nl> + if ( status . ok ( ) ) { <nl> + for ( const auto & resolved : patterns ) { <nl> + out . insert ( resolved ) ; <nl> + } <nl> + } <nl> + return status ; <nl> + } ) ) ; <nl> + <nl> + / / Iterate through the file paths , adding the hash results <nl> + for ( const auto & path_string : paths ) { <nl> + boost : : filesystem : : path path = path_string ; <nl> + if ( ! boost : : filesystem : : is_regular_file ( path , ec ) ) { <nl> + continue ; <nl> + } <nl> + <nl> + genHashForFile ( path_string , path . parent_path ( ) . string ( ) , context , results ) ; <nl> + } <nl> + <nl> + / / Now loop through constraints using the directory column constraint . <nl> + auto directories = context . constraints [ " directory " ] . getAll ( EQUALS ) ; <nl> + context . expandConstraints ( <nl> + " directory " , <nl> + LIKE , <nl> + directories , <nl> + ( [ & ] ( const std : : string & pattern , std : : set < std : : string > & out ) { <nl> + std : : vector < std : : string > patterns ; <nl> + auto status = <nl> + resolveFilePattern ( pattern , patterns , GLOB_FOLDERS | GLOB_NO_CANON ) ; <nl> + if ( status . ok ( ) ) { <nl> + for ( const auto & resolved : patterns ) { <nl> + out . insert ( resolved ) ; <nl> + } <nl> + } <nl> + return status ; <nl> + } ) ) ; <nl> + <nl> + / / Iterate over the directory paths <nl> + for ( const auto & directory_string : directories ) { <nl> + boost : : filesystem : : path directory = directory_string ; <nl> + if ( ! boost : : filesystem : : is_directory ( directory , ec ) ) { <nl> + continue ; <nl> + } <nl> + <nl> + / / Iterate over the directory files and generate a hash for each regular <nl> + / / file . <nl> + boost : : filesystem : : directory_iterator begin ( directory ) , end ; <nl> + for ( ; begin ! = end ; + + begin ) { <nl> + if ( boost : : filesystem : : is_regular_file ( begin - > path ( ) , ec ) ) { <nl> + genHashForFile ( <nl> + begin - > path ( ) . string ( ) , directory_string , context , results ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + return results ; <nl> + } <nl> + } <nl> } <nl> similarity index 86 % <nl> rename from include / osquery / hash . h <nl> rename to osquery / tables / system / hash . h <nl> mmm a / include / osquery / hash . h <nl> ppp b / osquery / tables / system / hash . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < boost / noncopyable . hpp > <nl> - <nl> # include < string > <nl> <nl> + # include < boost / noncopyable . hpp > <nl> + <nl> namespace osquery { <nl> <nl> / * * <nl> class Hash : private boost : : noncopyable { <nl> } ; <nl> <nl> / * * <nl> - * @ brief Compute a hash digest from an already allocated buffer . <nl> + * @ brief Compute a hash digest from the file content at a path . <nl> * <nl> * @ param hash_type The osquery - supported hash algorithm . <nl> - * @ param buffer A caller - controlled buffer . <nl> - * @ param size The length of buffer in bytes . <nl> + * @ param path Filesystem path ( the hash target ) . <nl> * @ return A string ( hex ) representation of the hash digest . <nl> * / <nl> - std : : string hashFromBuffer ( HashType hash_type , const void * buffer , size_t size ) ; <nl> + std : : string hashFromFile ( HashType hash_type , const std : : string & path ) ; <nl> <nl> / * * <nl> - * @ brief Compute a hash digest from the file content at a path . <nl> + * @ brief Compute multiple hashes from a files contents simultaneously . <nl> * <nl> + * @ param mask Bitmask specifying target osquery - supported algorithms . <nl> + * @ param path Filesystem path ( the hash target ) . <nl> + * @ return A struct containing string ( hex ) representations <nl> + * of the hash digests . <nl> + * / <nl> + MultiHashes hashMultiFromFile ( int mask , const std : : string & path ) ; <nl> + <nl> + / * * <nl> + * @ brief Compute a hash digest from the contents of a buffer . <nl> * <nl> * @ param hash_type The osquery - supported hash algorithm . <nl> - * @ param path Filesystem path , the hash target . <nl> + * @ param buffer A caller - controlled buffer ( already allocated ) . <nl> + * @ param size The length of buffer in bytes . <nl> * @ return A string ( hex ) representation of the hash digest . <nl> * / <nl> - std : : string hashFromFile ( HashType hash_type , const std : : string & path ) ; <nl> - <nl> - / / / Get multiple hashes from a file simultaneously . <nl> - MultiHashes hashMultiFromFile ( int mask , const std : : string & path ) ; <nl> + std : : string hashFromBuffer ( HashType hash_type , const void * buffer , size_t size ) ; <nl> } <nl> mmm a / osquery / tables / system / linux / acpi_tables . cpp <nl> ppp b / osquery / tables / system / linux / acpi_tables . cpp <nl> <nl> <nl> # include < osquery / core . h > <nl> # include < osquery / filesystem . h > <nl> - # include < osquery / hash . h > <nl> # include < osquery / tables . h > <nl> <nl> + # include " osquery / tables / system / hash . h " <nl> + <nl> namespace fs = boost : : filesystem ; <nl> <nl> namespace osquery { <nl> void genACPITable ( const std : : string & table , QueryData & results ) { <nl> r [ " size " ] = INTEGER ( - 1 ) ; <nl> } else { <nl> r [ " size " ] = INTEGER ( table_content . size ( ) ) ; <nl> - r [ " md5 " ] = osquery : : hashFromBuffer ( <nl> + r [ " md5 " ] = hashFromBuffer ( <nl> HASH_TYPE_MD5 , table_content . c_str ( ) , table_content . length ( ) ) ; <nl> } <nl> <nl> mmm a / osquery / tables / system / posix / smbios_utils . cpp <nl> ppp b / osquery / tables / system / posix / smbios_utils . cpp <nl> <nl> * <nl> * / <nl> <nl> - # include < osquery / hash . h > <nl> - <nl> # include " osquery / tables / system / smbios_utils . h " <nl> + # include " osquery / tables / system / hash . h " <nl> <nl> namespace osquery { <nl> namespace tables { <nl> deleted file mode 100644 <nl> index 63f32fb235 . . 0000000000 <nl> mmm a / osquery / tables / utility / hash . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - * Copyright ( c ) 2014 - present , Facebook , Inc . <nl> - * All rights reserved . <nl> - * <nl> - * This source code is licensed under the BSD - style license found in the <nl> - * LICENSE file in the root directory of this source tree . An additional grant <nl> - * of patent rights can be found in the PATENTS file in the same directory . <nl> - * <nl> - * / <nl> - <nl> - # include < boost / filesystem . hpp > <nl> - <nl> - # include < osquery / filesystem . h > <nl> - # include < osquery / hash . h > <nl> - # include < osquery / tables . h > <nl> - <nl> - namespace fs = boost : : filesystem ; <nl> - <nl> - namespace osquery { <nl> - namespace tables { <nl> - <nl> - void genHashForFile ( const std : : string & path , <nl> - const std : : string & dir , <nl> - QueryContext & context , <nl> - QueryData & results ) { <nl> - / / Must provide the path , filename , directory separate from boost path - > string <nl> - / / helpers to match any explicit ( query - parsed ) predicate constraints . <nl> - Row r ; <nl> - if ( context . isCached ( path ) ) { <nl> - r = context . getCache ( path ) ; <nl> - } else { <nl> - auto hashes = hashMultiFromFile ( <nl> - HASH_TYPE_MD5 | HASH_TYPE_SHA1 | HASH_TYPE_SHA256 , path ) ; <nl> - <nl> - r [ " path " ] = path ; <nl> - r [ " directory " ] = dir ; <nl> - r [ " md5 " ] = std : : move ( hashes . md5 ) ; <nl> - r [ " sha1 " ] = std : : move ( hashes . sha1 ) ; <nl> - r [ " sha256 " ] = std : : move ( hashes . sha256 ) ; <nl> - context . setCache ( path , r ) ; <nl> - } <nl> - results . push_back ( r ) ; <nl> - } <nl> - <nl> - QueryData genHash ( QueryContext & context ) { <nl> - QueryData results ; <nl> - boost : : system : : error_code ec ; <nl> - <nl> - / / The query must provide a predicate with constraints including path or <nl> - / / directory . We search for the parsed predicate constraints with the equals <nl> - / / operator . <nl> - auto paths = context . constraints [ " path " ] . getAll ( EQUALS ) ; <nl> - context . expandConstraints ( <nl> - " path " , <nl> - LIKE , <nl> - paths , <nl> - ( [ & ] ( const std : : string & pattern , std : : set < std : : string > & out ) { <nl> - std : : vector < std : : string > patterns ; <nl> - auto status = <nl> - resolveFilePattern ( pattern , patterns , GLOB_ALL | GLOB_NO_CANON ) ; <nl> - if ( status . ok ( ) ) { <nl> - for ( const auto & resolved : patterns ) { <nl> - out . insert ( resolved ) ; <nl> - } <nl> - } <nl> - return status ; <nl> - } ) ) ; <nl> - <nl> - / / Iterate through the file paths , adding the hash results <nl> - for ( const auto & path_string : paths ) { <nl> - boost : : filesystem : : path path = path_string ; <nl> - if ( ! boost : : filesystem : : is_regular_file ( path , ec ) ) { <nl> - continue ; <nl> - } <nl> - <nl> - genHashForFile ( path_string , path . parent_path ( ) . string ( ) , context , results ) ; <nl> - } <nl> - <nl> - / / Now loop through constraints using the directory column constraint . <nl> - auto directories = context . constraints [ " directory " ] . getAll ( EQUALS ) ; <nl> - context . expandConstraints ( <nl> - " directory " , <nl> - LIKE , <nl> - directories , <nl> - ( [ & ] ( const std : : string & pattern , std : : set < std : : string > & out ) { <nl> - std : : vector < std : : string > patterns ; <nl> - auto status = <nl> - resolveFilePattern ( pattern , patterns , GLOB_FOLDERS | GLOB_NO_CANON ) ; <nl> - if ( status . ok ( ) ) { <nl> - for ( const auto & resolved : patterns ) { <nl> - out . insert ( resolved ) ; <nl> - } <nl> - } <nl> - return status ; <nl> - } ) ) ; <nl> - <nl> - / / Iterate over the directory paths <nl> - for ( const auto & directory_string : directories ) { <nl> - boost : : filesystem : : path directory = directory_string ; <nl> - if ( ! boost : : filesystem : : is_directory ( directory , ec ) ) { <nl> - continue ; <nl> - } <nl> - <nl> - / / Iterate over the directory files and generate a hash for each regular <nl> - / / file . <nl> - boost : : filesystem : : directory_iterator begin ( directory ) , end ; <nl> - for ( ; begin ! = end ; + + begin ) { <nl> - if ( boost : : filesystem : : is_regular_file ( begin - > path ( ) , ec ) ) { <nl> - genHashForFile ( <nl> - begin - > path ( ) . string ( ) , directory_string , context , results ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - return results ; <nl> - } <nl> - } <nl> - } <nl> mmm a / osquery / tables / utility / osquery . cpp <nl> ppp b / osquery / tables / utility / osquery . cpp <nl> QueryData genOsqueryInfo ( QueryContext & context ) { <nl> r [ " version " ] = kVersion ; <nl> <nl> std : : string hash_string ; <nl> - auto s = Config : : getInstance ( ) . getMD5 ( hash_string ) ; <nl> + auto s = Config : : getInstance ( ) . genHash ( hash_string ) ; <nl> r [ " config_hash " ] = ( s . ok ( ) ) ? hash_string : " " ; <nl> r [ " config_valid " ] = Config : : getInstance ( ) . isValid ( ) ? INTEGER ( 1 ) : INTEGER ( 0 ) ; <nl> r [ " extensions " ] = <nl> similarity index 89 % <nl> rename from specs / utility / hash . table <nl> rename to specs / hash . table <nl> mmm a / specs / utility / hash . table <nl> ppp b / specs / hash . table <nl> schema ( [ <nl> Column ( " sha1 " , TEXT , " SHA1 hash of provided filesystem data " ) , <nl> Column ( " sha256 " , TEXT , " SHA256 hash of provided filesystem data " ) , <nl> ] ) <nl> - attributes ( utility = True ) <nl> - implementation ( " utility / hash @ genHash " ) <nl> + implementation ( " hash @ genHash " ) <nl> examples ( [ <nl> " select * from hash where path = ' / etc / passwd ' " , <nl> " select * from hash where directory = ' / etc / ' " , <nl>
[ Fix ] Remove OpenSSL link dependency for osquery core ( )
osquery/osquery
383e07e5be0d4c36bc3780c680ba6d858ae2ea5e
2016-12-22T08:37:59Z
mmm a / hphp / hack / src / hhbc / emit_param . ml <nl> ppp b / hphp / hack / src / hhbc / emit_param . ml <nl> open Core <nl> open Emit_type_hint <nl> open Instruction_sequence <nl> <nl> - let from_ast tparams p = <nl> + let from_ast tparams p = if p . Ast . param_is_variadic then None else <nl> let param_name = snd p . A . param_id in <nl> let param_type_info = Option . map p . Ast . param_hint <nl> ( hint_to_type_info ~ always_extended : false tparams ) in <nl> let param_default_value = Option . map p . Ast . param_expr <nl> ~ f : ( fun e - > Label . next_default_arg ( ) , e ) <nl> in <nl> - Hhas_param . make param_name p . A . param_is_reference <nl> - param_type_info param_default_value <nl> + Some ( Hhas_param . make param_name p . A . param_is_reference <nl> + param_type_info param_default_value ) <nl> <nl> let from_asts tparams params = <nl> - List . map params ( from_ast tparams ) <nl> + List . filter_map params ( from_ast tparams ) <nl> <nl> let emit_param_default_value_setter params = <nl> let setters = List . filter_map params ( fun p - > <nl>
Add support for variadic argument functions
facebook/hhvm
ed1bd82dceb20044ea0796ccb4b64c5f960c9328
2017-04-11T17:39:32Z
mmm a / folly / Makefile . am <nl> ppp b / folly / Makefile . am <nl> nobase_follyinclude_HEADERS = \ <nl> experimental / FunctionScheduler . h \ <nl> experimental / FutureDAG . h \ <nl> experimental / io / FsUtil . h \ <nl> + experimental / JemallocNodumpAllocator . h \ <nl> experimental / JSONSchema . h \ <nl> experimental / LockFreeRingBuffer . h \ <nl> experimental / NestedCommandLineApp . h \ <nl> libfolly_la_SOURCES = \ <nl> experimental / DynamicParser . cpp \ <nl> experimental / FunctionScheduler . cpp \ <nl> experimental / io / FsUtil . cpp \ <nl> + experimental / JemallocNodumpAllocator . cpp \ <nl> experimental / JSONSchema . cpp \ <nl> experimental / NestedCommandLineApp . cpp \ <nl> experimental / observer / detail / Core . cpp \ <nl> new file mode 100644 <nl> index 00000000000 . . 6286d1bf71e <nl> mmm / dev / null <nl> ppp b / folly / experimental / JemallocNodumpAllocator . cpp <nl> <nl> + / * <nl> + * Copyright 2016 Facebook , Inc . <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 < folly / experimental / JemallocNodumpAllocator . h > <nl> + <nl> + # include < folly / Conv . h > <nl> + # include < folly / Malloc . h > <nl> + # include < folly / String . h > <nl> + # include < glog / logging . h > <nl> + <nl> + namespace folly { <nl> + <nl> + JemallocNodumpAllocator : : JemallocNodumpAllocator ( State state ) { <nl> + if ( state = = State : : ENABLED & & extend_and_setup_arena ( ) ) { <nl> + LOG ( INFO ) < < " Set up arena : " < < arena_index_ ; <nl> + } <nl> + } <nl> + <nl> + bool JemallocNodumpAllocator : : extend_and_setup_arena ( ) { <nl> + # ifdef FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + if ( mallctl = = nullptr ) { <nl> + / / Not linked with jemalloc . <nl> + return false ; <nl> + } <nl> + <nl> + size_t len = sizeof ( arena_index_ ) ; <nl> + if ( auto ret = mallctl ( " arenas . extend " , & arena_index_ , & len , nullptr , 0 ) ) { <nl> + LOG ( FATAL ) < < " Unable to extend arena : " < < errnoStr ( ret ) ; <nl> + } <nl> + flags_ = MALLOCX_ARENA ( arena_index_ ) | MALLOCX_TCACHE_NONE ; <nl> + <nl> + / / Set the custom alloc hook <nl> + const auto key = <nl> + folly : : to < std : : string > ( " arena . " , arena_index_ , " . chunk_hooks " ) ; <nl> + chunk_hooks_t hooks ; <nl> + len = sizeof ( hooks ) ; <nl> + / / Read the existing hooks <nl> + if ( auto ret = mallctl ( key . c_str ( ) , & hooks , & len , nullptr , 0 ) ) { <nl> + LOG ( FATAL ) < < " Unable to get the hooks : " < < errnoStr ( ret ) ; <nl> + } <nl> + if ( original_chunk_alloc_ = = nullptr ) { <nl> + original_chunk_alloc_ = hooks . alloc ; <nl> + } else { <nl> + DCHECK_EQ ( original_chunk_alloc_ , hooks . alloc ) ; <nl> + } <nl> + <nl> + / / Set the custom hook <nl> + hooks . alloc = & JemallocNodumpAllocator : : chunk_alloc ; <nl> + if ( auto ret = <nl> + mallctl ( key . c_str ( ) , nullptr , nullptr , & hooks , sizeof ( hooks ) ) ) { <nl> + LOG ( FATAL ) < < " Unable to set the hooks : " < < errnoStr ( ret ) ; <nl> + } <nl> + <nl> + return true ; <nl> + # else / / FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + return false ; <nl> + # endif / / FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + } <nl> + <nl> + void * JemallocNodumpAllocator : : allocate ( size_t size ) { <nl> + return mallocx ! = nullptr ? mallocx ( size , flags_ ) : malloc ( size ) ; <nl> + } <nl> + <nl> + void * JemallocNodumpAllocator : : reallocate ( void * p , size_t size ) { <nl> + return rallocx ! = nullptr ? rallocx ( p , size , flags_ ) : realloc ( p , size ) ; <nl> + } <nl> + <nl> + # ifdef FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + <nl> + chunk_alloc_t * JemallocNodumpAllocator : : original_chunk_alloc_ = nullptr ; <nl> + <nl> + void * JemallocNodumpAllocator : : chunk_alloc ( <nl> + void * chunk , <nl> + size_t size , <nl> + size_t alignment , <nl> + bool * zero , <nl> + bool * commit , <nl> + unsigned arena_ind ) { <nl> + void * result = <nl> + original_chunk_alloc_ ( chunk , size , alignment , zero , commit , arena_ind ) ; <nl> + if ( result ! = nullptr ) { <nl> + if ( auto ret = madvise ( result , size , MADV_DONTDUMP ) ) { <nl> + VLOG ( 1 ) < < " Unable to madvise ( MADV_DONTDUMP ) : " < < errnoStr ( ret ) ; <nl> + } <nl> + } <nl> + <nl> + return result ; <nl> + } <nl> + <nl> + # endif / / FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + <nl> + void JemallocNodumpAllocator : : deallocate ( void * p ) { <nl> + dallocx ! = nullptr ? dallocx ( p , flags_ ) : free ( p ) ; <nl> + } <nl> + <nl> + void JemallocNodumpAllocator : : deallocate ( void * p , void * userData ) { <nl> + const uint64_t flags = reinterpret_cast < uint64_t > ( userData ) ; <nl> + dallocx ! = nullptr ? dallocx ( p , flags ) : free ( p ) ; <nl> + } <nl> + <nl> + JemallocNodumpAllocator & globalJemallocNodumpAllocator ( ) { <nl> + static auto instance = new JemallocNodumpAllocator ( ) ; <nl> + return * instance ; <nl> + } <nl> + <nl> + } / / folly <nl> new file mode 100644 <nl> index 00000000000 . . e12454c3733 <nl> mmm / dev / null <nl> ppp b / folly / experimental / JemallocNodumpAllocator . h <nl> <nl> + / * <nl> + * Copyright 2016 Facebook , Inc . <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> + / / http : / / www . canonware . com / download / jemalloc / jemalloc - latest / doc / jemalloc . html <nl> + <nl> + # pragma once <nl> + <nl> + # include < folly / folly - config . h > <nl> + <nl> + # ifdef FOLLY_HAVE_LIBJEMALLOC <nl> + <nl> + # include < folly / portability / SysMman . h > <nl> + # include < jemalloc / jemalloc . h > <nl> + <nl> + # if ( JEMALLOC_VERSION_MAJOR > 3 ) & & defined ( MADV_DONTDUMP ) <nl> + # define FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED 1 <nl> + # endif <nl> + <nl> + # endif / / FOLLY_HAVE_LIBJEMALLOC <nl> + <nl> + # include < cstddef > <nl> + <nl> + namespace folly { <nl> + <nl> + / * * <nl> + * An allocator which uses Jemalloc to create an dedicated arena to allocate <nl> + * memory from . The only special property set on the allocated memory is that <nl> + * the memory is not dump - able . <nl> + * <nl> + * This is done by setting MADV_DONTDUMP using the ` madvise ` system call . A <nl> + * custom hook installed which is called when allocating a new chunk of memory . <nl> + * All it does is call the original jemalloc hook to allocate the memory and <nl> + * then set the advise on it before returning the pointer to the allocated <nl> + * memory . Jemalloc does not use allocated chunks across different arenas , <nl> + * without ` munmap ` - ing them first , and the advises are not sticky i . e . they are <nl> + * unset if ` munmap ` is done . Also this arena can ' t be used by any other part of <nl> + * the code by just calling ` malloc ` . <nl> + * <nl> + * If target system doesn ' t support MADV_DONTDUMP or jemalloc doesn ' t support <nl> + * custom arena hook , JemallocNodumpAllocator would fall back to using malloc / <nl> + * free . Such behavior can be identified by using <nl> + * ! defined ( FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED ) . <nl> + * <nl> + * Similarly , if binary isn ' t linked with jemalloc , the logic would fall back to <nl> + * malloc / free . <nl> + * / <nl> + class JemallocNodumpAllocator { <nl> + public : <nl> + enum class State { <nl> + ENABLED , <nl> + DISABLED , <nl> + } ; <nl> + <nl> + / / To be used as IOBuf : : FreeFunction , userData should be set to <nl> + / / reinterpret_cast < void * > ( getFlags ( ) ) . <nl> + static void deallocate ( void * p , void * userData ) ; <nl> + <nl> + explicit JemallocNodumpAllocator ( State state = State : : ENABLED ) ; <nl> + <nl> + void * allocate ( size_t size ) ; <nl> + void * reallocate ( void * p , size_t size ) ; <nl> + void deallocate ( void * p ) ; <nl> + <nl> + unsigned getArenaIndex ( ) const { return arena_index_ ; } <nl> + int getFlags ( ) const { return flags_ ; } <nl> + <nl> + private : <nl> + # ifdef FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + static chunk_alloc_t * original_chunk_alloc_ ; <nl> + static void * chunk_alloc ( void * chunk , <nl> + size_t size , <nl> + size_t alignment , <nl> + bool * zero , <nl> + bool * commit , <nl> + unsigned arena_ind ) ; <nl> + # endif / / FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + <nl> + bool extend_and_setup_arena ( ) ; <nl> + <nl> + unsigned arena_index_ { 0 } ; <nl> + int flags_ { 0 } ; <nl> + } ; <nl> + <nl> + / * * <nl> + * JemallocNodumpAllocator singleton . <nl> + * / <nl> + JemallocNodumpAllocator & globalJemallocNodumpAllocator ( ) ; <nl> + <nl> + } / / folly <nl> new file mode 100644 <nl> index 00000000000 . . 008a640c8e3 <nl> mmm / dev / null <nl> ppp b / folly / experimental / test / JemallocNodumpAllocatorTest . cpp <nl> <nl> + / * <nl> + * Copyright 2016 Facebook , Inc . <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 < folly / experimental / JemallocNodumpAllocator . h > <nl> + <nl> + # include < folly / Malloc . h > <nl> + # include < folly / io / IOBuf . h > <nl> + # include < folly / portability / GTest . h > <nl> + <nl> + TEST ( JemallocNodumpAllocatorTest , Basic ) { <nl> + folly : : JemallocNodumpAllocator jna ; <nl> + <nl> + # ifdef FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + if ( folly : : usingJEMalloc ( ) ) { <nl> + EXPECT_NE ( 0 , jna . getArenaIndex ( ) ) ; <nl> + } <nl> + # endif / / FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + <nl> + auto ptr = jna . allocate ( 1024 ) ; <nl> + EXPECT_NE ( nullptr , ptr ) ; <nl> + jna . deallocate ( ptr ) ; <nl> + } <nl> + <nl> + TEST ( JemallocNodumpAllocatorTest , IOBuf ) { <nl> + folly : : JemallocNodumpAllocator jna ; <nl> + <nl> + # ifdef FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + if ( folly : : usingJEMalloc ( ) ) { <nl> + EXPECT_NE ( 0 , jna . getArenaIndex ( ) ) ; <nl> + } <nl> + # endif / / FOLLY_JEMALLOC_NODUMP_ALLOCATOR_SUPPORTED <nl> + <nl> + const size_t size { 1024 } ; <nl> + void * ptr = jna . allocate ( size ) ; <nl> + EXPECT_NE ( nullptr , ptr ) ; <nl> + folly : : IOBuf ioBuf ( folly : : IOBuf : : TAKE_OWNERSHIP , ptr , size ) ; <nl> + EXPECT_EQ ( size , ioBuf . capacity ( ) ) ; <nl> + EXPECT_EQ ( ptr , ioBuf . data ( ) ) ; <nl> + uint8_t * data = ioBuf . writableData ( ) ; <nl> + EXPECT_EQ ( ptr , data ) ; <nl> + for ( auto i = 0u ; i < ioBuf . capacity ( ) ; + + i ) { <nl> + data [ i ] = ' A ' ; <nl> + } <nl> + uint8_t * p = static_cast < uint8_t * > ( ptr ) ; <nl> + for ( auto i = 0u ; i < size ; + + i ) { <nl> + EXPECT_EQ ( ' A ' , p [ i ] ) ; <nl> + } <nl> + } <nl>
move JemallocNodumpAllocator to folly / experimental
facebook/folly
ab1bf6715e09c7826389f6d927ef39c86e1156ed
2016-12-13T10:03:09Z
mmm a / scripting / javascript / bindings / generated <nl> ppp b / scripting / javascript / bindings / generated <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 3827b45e5f8a0adc6154c57f9469796af43abbcd <nl> + Subproject commit 71562d8f336df63d6d2dc01fbe0d04e8619ecf62 <nl>
[ AUTO ] : updating submodule reference to latest autogenerated bindings
cocos2d/cocos2d-x
8c6d6e9ef8ad3bdc9dc7370d93995e95b66ec97e
2013-06-05T13:01:25Z
mmm a / tensorflow / core / grappler / optimizers / data / autotune_buffer_sizes . cc <nl> ppp b / tensorflow / core / grappler / optimizers / data / autotune_buffer_sizes . cc <nl> namespace grappler { <nl> namespace { <nl> <nl> constexpr char kLegacyAutotune [ ] = " legacy_autotune " ; <nl> + constexpr char kBufferSizeMin [ ] = " buffer_size_min " ; <nl> constexpr char kPrefetchDataset [ ] = " PrefetchDataset " ; <nl> <nl> constexpr std : : array < const char * , 7 > kAsyncDatasetOps = { <nl> Status AutotuneBufferSizes : : OptimizeAndCollectStats ( Cluster * cluster , <nl> } <nl> MutableGraphView graph ( output ) ; <nl> <nl> + / / Add a const node with value kAutotune <nl> + NodeDef * autotune_value = <nl> + graph_utils : : AddScalarConstNode ( data : : model : : kAutotune , & graph ) ; <nl> + <nl> + absl : : flat_hash_set < string > already_prefetched ; <nl> + <nl> + / / 1 ) Collect about all existing ` PrefetchDataset ` nodes , replacing <nl> + / / ` prefetch ( N ) ` with ` prefetch ( AUTOTUNE , buffer_size_min = N ) ` for all N ! = - 1 . <nl> + for ( NodeDef & node : * output - > mutable_node ( ) ) { <nl> + if ( node . op ( ) = = kPrefetchDataset ) { <nl> + NodeDef * buffer_size_node = graph . GetNode ( node . input ( 1 ) ) ; <nl> + / / We only consider to rewrite if ` buffer_size ` is constant . <nl> + if ( buffer_size_node - > op ( ) = = " Const " ) { <nl> + int64 initial_buffer_size = <nl> + buffer_size_node - > attr ( ) . at ( " value " ) . tensor ( ) . int64_val ( 0 ) ; <nl> + if ( initial_buffer_size ! = data : : model : : kAutotune ) { <nl> + TF_RETURN_IF_ERROR ( graph . UpdateFanin ( node . name ( ) , <nl> + { buffer_size_node - > name ( ) , 0 } , <nl> + { autotune_value - > name ( ) , 0 } ) ) ; <nl> + node . mutable_attr ( ) - > at ( kBufferSizeMin ) . set_i ( initial_buffer_size ) ; <nl> + stats - > num_changes + + ; <nl> + } <nl> + } else { <nl> + return errors : : FailedPrecondition ( <nl> + " The autotune_buffer_sizes rewrite does not currently support " <nl> + " non - constant buffer_size input . " ) ; <nl> + } <nl> + NodeDef * prefetched_node = graph_utils : : GetInputNode ( node , graph ) ; <nl> + if ( prefetched_node ) { <nl> + already_prefetched . insert ( prefetched_node - > name ( ) ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> std : : vector < const NodeDef * > async_datasets ; <nl> + / / 2 ) Insert ` prefetch ( AUTOTUNE ) ` after all asynchronous transformations that <nl> + / / are not followed by a ` prefetch ` yet . <nl> for ( const NodeDef & node : item . graph . node ( ) ) { <nl> + if ( already_prefetched . find ( node . name ( ) ) ! = already_prefetched . end ( ) ) { <nl> + continue ; <nl> + } <nl> for ( const auto & async_dataset_op : kAsyncDatasetOps ) { <nl> if ( node . op ( ) = = async_dataset_op ) { <nl> async_datasets . push_back ( & node ) ; <nl> Status AutotuneBufferSizes : : OptimizeAndCollectStats ( Cluster * cluster , <nl> <nl> if ( async_datasets . empty ( ) ) return Status : : OK ( ) ; <nl> <nl> - / / Add a const node with value kAutotune <nl> - NodeDef * autotune_value = <nl> - graph_utils : : AddScalarConstNode ( data : : model : : kAutotune , & graph ) ; <nl> - <nl> for ( const NodeDef * async_dataset_node : async_datasets ) { <nl> NodeDef prefetch_node ; <nl> graph_utils : : SetUniqueGraphNodeName ( <nl> mmm a / tensorflow / core / grappler / optimizers / data / autotune_buffer_sizes . h <nl> ppp b / tensorflow / core / grappler / optimizers / data / autotune_buffer_sizes . h <nl> namespace grappler { <nl> <nl> constexpr char kAutotune [ ] = " autotune " ; <nl> <nl> - / / This optimization adds ` prefetch ( AUTOTUNE ) ` after all asynchronous tf . data <nl> - / / transformations ( e . g . parallel map , parallel interleave , and map + batch ) . <nl> + / / This optimization does the following : <nl> + / / <nl> + / / 1 . Adds ` prefetch ( AUTOTUNE ) ` after all asynchronous tf . data transformations <nl> + / / ( e . g . parallel map , parallel interleave , and map + batch ) if they are not <nl> + / / followed by a ` prefetch ` yet . <nl> + / / <nl> + / / 2 . If there exists any ` prefetch ( buffer_size = N ) ` for ` N > = 0 ` , it will replace <nl> + / / the transformation with autotunable version of ` prefetch ` which uses N as <nl> + / / the minimum size of the buffer . <nl> class AutotuneBufferSizes : public TFDataOptimizerBase { <nl> public : <nl> AutotuneBufferSizes ( ) = default ; <nl> mmm a / tensorflow / core / grappler / optimizers / data / autotune_buffer_sizes_test . cc <nl> ppp b / tensorflow / core / grappler / optimizers / data / autotune_buffer_sizes_test . cc <nl> TEST_P ( AutotuneSetting , AutotuneBufferSizesTest ) { <nl> autotune ) ; <nl> } <nl> <nl> + class MultipleNodes : public : : testing : : TestWithParam < std : : tuple < bool , int64 > > { <nl> + } ; <nl> + <nl> + TEST_P ( MultipleNodes , AutotuneBufferSizesTest ) { <nl> + const bool legacy_autotune = std : : get < 0 > ( GetParam ( ) ) ; <nl> + const int64 initial_buffer_size = std : : get < 1 > ( GetParam ( ) ) ; <nl> + <nl> + GrapplerItem item ; <nl> + MutableGraphView graph ( & item . graph ) ; <nl> + <nl> + NodeDef * start_val = graph_utils : : AddScalarConstNode < int64 > ( 0 , & graph ) ; <nl> + NodeDef * stop_val = graph_utils : : AddScalarConstNode < int64 > ( 10 , & graph ) ; <nl> + NodeDef * step_val = graph_utils : : AddScalarConstNode < int64 > ( 1 , & graph ) ; <nl> + <nl> + std : : vector < string > range_inputs ( 3 ) ; <nl> + range_inputs [ 0 ] = start_val - > name ( ) ; <nl> + range_inputs [ 1 ] = stop_val - > name ( ) ; <nl> + range_inputs [ 2 ] = step_val - > name ( ) ; <nl> + std : : vector < std : : pair < string , AttrValue > > range_attrs ; <nl> + NodeDef * range_node = graph_utils : : AddNode ( " range " , " RangeDataset " , <nl> + range_inputs , range_attrs , & graph ) ; <nl> + <nl> + NodeDef * parallelism_val = graph_utils : : AddScalarConstNode < int64 > ( 1 , & graph ) ; <nl> + std : : vector < string > map_inputs1 ( 2 ) ; <nl> + map_inputs1 [ 0 ] = range_node - > name ( ) ; <nl> + map_inputs1 [ 1 ] = parallelism_val - > name ( ) ; <nl> + std : : vector < std : : pair < string , AttrValue > > map_attrs ( 4 ) ; <nl> + AttrValue attr_val ; <nl> + SetAttrValue ( " value " , & attr_val ) ; <nl> + map_attrs [ 0 ] = std : : make_pair ( " f " , attr_val ) ; <nl> + map_attrs [ 1 ] = std : : make_pair ( " Targuments " , attr_val ) ; <nl> + map_attrs [ 2 ] = std : : make_pair ( " output_types " , attr_val ) ; <nl> + map_attrs [ 3 ] = std : : make_pair ( " output_shapes " , attr_val ) ; <nl> + NodeDef * map_node1 = graph_utils : : AddNode ( " map1 " , " ParallelMapDatasetV2 " , <nl> + map_inputs1 , map_attrs , & graph ) ; <nl> + <nl> + NodeDef * buffer_size_val = <nl> + graph_utils : : AddScalarConstNode < int64 > ( initial_buffer_size , & graph ) ; <nl> + std : : vector < string > prefetch_inputs ( 2 ) ; <nl> + prefetch_inputs [ 0 ] = map_node1 - > name ( ) ; <nl> + prefetch_inputs [ 1 ] = buffer_size_val - > name ( ) ; <nl> + std : : vector < std : : pair < string , AttrValue > > prefetch_attrs ( 4 ) ; <nl> + AttrValue legacy_autotune_attr ; <nl> + SetAttrValue ( legacy_autotune , & legacy_autotune_attr ) ; <nl> + AttrValue buffer_size_min_attr ; <nl> + SetAttrValue ( 0 , & buffer_size_min_attr ) ; <nl> + prefetch_attrs [ 0 ] = std : : make_pair ( " legacy_autotune " , legacy_autotune_attr ) ; <nl> + prefetch_attrs [ 1 ] = std : : make_pair ( " buffer_size_min " , buffer_size_min_attr ) ; <nl> + prefetch_attrs [ 2 ] = std : : make_pair ( " output_types " , attr_val ) ; <nl> + prefetch_attrs [ 3 ] = std : : make_pair ( " output_shapes " , attr_val ) ; <nl> + NodeDef * prefetch_node = graph_utils : : AddNode ( <nl> + " prefetch " , " PrefetchDataset " , prefetch_inputs , prefetch_attrs , & graph ) ; <nl> + <nl> + std : : vector < string > map_inputs2 ( 2 ) ; <nl> + map_inputs2 [ 0 ] = prefetch_node - > name ( ) ; <nl> + map_inputs2 [ 1 ] = parallelism_val - > name ( ) ; <nl> + NodeDef * map_node2 = graph_utils : : AddNode ( " map2 " , " ParallelMapDatasetV2 " , <nl> + map_inputs2 , map_attrs , & graph ) ; <nl> + <nl> + std : : vector < string > map_inputs3 ( 1 ) ; <nl> + map_inputs3 [ 0 ] = map_node2 - > name ( ) ; <nl> + graph_utils : : AddNode ( " map3 " , " MapDataset " , map_inputs3 , map_attrs , & graph ) ; <nl> + <nl> + GraphDef output ; <nl> + TF_ASSERT_OK ( OptimizeWithAutotuneBufferSizes ( item , & output , true ) ) ; <nl> + <nl> + std : : vector < int > prefetch_indices = <nl> + graph_utils : : FindAllGraphNodesWithOp ( " PrefetchDataset " , output ) ; <nl> + EXPECT_EQ ( prefetch_indices . size ( ) , 2 ) ; <nl> + <nl> + NodeDef new_map_node3 = <nl> + output . node ( graph_utils : : FindGraphNodeWithName ( " map3 " , output ) ) ; <nl> + <nl> + NodeDef new_prefetch_node2 = output . node ( <nl> + graph_utils : : FindGraphNodeWithName ( new_map_node3 . input ( 0 ) , output ) ) ; <nl> + EXPECT_EQ ( new_prefetch_node2 . op ( ) , " PrefetchDataset " ) ; <nl> + EXPECT_EQ ( new_prefetch_node2 . input_size ( ) , 2 ) ; <nl> + EXPECT_TRUE ( new_prefetch_node2 . attr ( ) . find ( " legacy_autotune " ) = = <nl> + new_prefetch_node2 . attr ( ) . end ( ) ) ; <nl> + EXPECT_TRUE ( new_prefetch_node2 . attr ( ) . find ( " buffer_size_min " ) = = <nl> + new_prefetch_node2 . attr ( ) . end ( ) ) ; <nl> + NodeDef new_buffer_size_val2 = output . node ( <nl> + graph_utils : : FindGraphNodeWithName ( new_prefetch_node2 . input ( 1 ) , output ) ) ; <nl> + EXPECT_EQ ( new_buffer_size_val2 . attr ( ) . at ( " value " ) . tensor ( ) . int64_val ( 0 ) , - 1 ) ; <nl> + <nl> + NodeDef new_map_node2 = output . node ( <nl> + graph_utils : : FindGraphNodeWithName ( new_prefetch_node2 . input ( 0 ) , output ) ) ; <nl> + EXPECT_EQ ( new_map_node2 . name ( ) , " map2 " ) ; <nl> + <nl> + NodeDef new_prefetch_node1 = output . node ( <nl> + graph_utils : : FindGraphNodeWithName ( new_map_node2 . input ( 0 ) , output ) ) ; <nl> + EXPECT_EQ ( new_prefetch_node1 . op ( ) , " PrefetchDataset " ) ; <nl> + EXPECT_EQ ( new_prefetch_node1 . input_size ( ) , 2 ) ; <nl> + EXPECT_EQ ( new_prefetch_node1 . attr ( ) . at ( " legacy_autotune " ) . b ( ) , <nl> + legacy_autotune ) ; <nl> + EXPECT_EQ ( new_prefetch_node1 . attr ( ) . at ( " buffer_size_min " ) . i ( ) , <nl> + ( initial_buffer_size = = - 1 ? 0 : initial_buffer_size ) ) ; <nl> + NodeDef new_buffer_size_val1 = output . node ( <nl> + graph_utils : : FindGraphNodeWithName ( new_prefetch_node1 . input ( 1 ) , output ) ) ; <nl> + EXPECT_EQ ( new_buffer_size_val1 . attr ( ) . at ( " value " ) . tensor ( ) . int64_val ( 0 ) , - 1 ) ; <nl> + <nl> + NodeDef new_map_node1 = output . node ( <nl> + graph_utils : : FindGraphNodeWithName ( new_prefetch_node1 . input ( 0 ) , output ) ) ; <nl> + EXPECT_EQ ( new_map_node1 . name ( ) , " map1 " ) ; <nl> + } <nl> + <nl> + INSTANTIATE_TEST_SUITE_P ( Test , MultipleNodes , <nl> + : : testing : : Combine ( : : testing : : Values ( true , false ) , <nl> + : : testing : : Values ( - 1 , 3 ) ) ) ; <nl> + <nl> INSTANTIATE_TEST_SUITE_P ( Test , AutotuneSetting , : : testing : : Values ( false , true ) ) ; <nl> <nl> } / / namespace <nl> mmm a / tensorflow / core / kernels / data / prefetch_autotuner . cc <nl> ppp b / tensorflow / core / kernels / data / prefetch_autotuner . cc <nl> limitations under the License . <nl> namespace tensorflow { <nl> namespace data { <nl> <nl> - PrefetchAutotuner : : PrefetchAutotuner ( int64 initial_buffer_size ) <nl> + PrefetchAutotuner : : PrefetchAutotuner ( int64 initial_buffer_size , <nl> + int64 buffer_size_min ) <nl> : buffer_limit_ ( initial_buffer_size ) { <nl> if ( initial_buffer_size = = model : : kAutotune ) { <nl> mode_ = Mode : : kUpswing ; <nl> - buffer_limit_ = 1 ; <nl> + buffer_limit_ = std : : max ( int64 { 1 } , buffer_size_min ) ; <nl> } <nl> } <nl> <nl> mmm a / tensorflow / core / kernels / data / prefetch_autotuner . h <nl> ppp b / tensorflow / core / kernels / data / prefetch_autotuner . h <nl> namespace data { <nl> / / PrefetchAutotuner is NOT thread safe . <nl> class PrefetchAutotuner { <nl> public : <nl> - explicit PrefetchAutotuner ( int64 initial_buffer_size ) ; <nl> + explicit PrefetchAutotuner ( int64 initial_buffer_size , int64 buffer_size_min ) ; <nl> <nl> int64 buffer_limit ( ) const { return buffer_limit_ ; } <nl> <nl> mmm a / tensorflow / core / kernels / data / prefetch_autotuner_test . cc <nl> ppp b / tensorflow / core / kernels / data / prefetch_autotuner_test . cc <nl> namespace data { <nl> namespace { <nl> <nl> TEST ( PrefetchAutotuner , Disabled ) { <nl> - PrefetchAutotuner t ( 2 ) ; <nl> + PrefetchAutotuner t ( 2 , 0 ) ; <nl> EXPECT_EQ ( 2 , t . buffer_limit ( ) ) ; <nl> t . RecordConsumption ( 0 ) ; <nl> t . RecordConsumption ( 2 ) ; <nl> TEST ( PrefetchAutotuner , Disabled ) { <nl> } <nl> <nl> TEST ( PrefetchAutotuner , Enabled ) { <nl> - PrefetchAutotuner t ( model : : kAutotune ) ; <nl> + PrefetchAutotuner t ( model : : kAutotune , 0 ) ; <nl> EXPECT_EQ ( 1 , t . buffer_limit ( ) ) ; <nl> t . RecordConsumption ( 0 ) ; / / Expect buffer limit to stay the same . <nl> EXPECT_EQ ( 1 , t . buffer_limit ( ) ) ; <nl> TEST ( PrefetchAutotuner , Enabled ) { <nl> } <nl> <nl> TEST ( PrefetchAutotuner , EnabledSteady ) { <nl> - PrefetchAutotuner t ( model : : kAutotune ) ; <nl> + PrefetchAutotuner t ( model : : kAutotune , 0 ) ; <nl> EXPECT_EQ ( 1 , t . buffer_limit ( ) ) ; <nl> t . RecordConsumption ( 0 ) ; / / Expect buffer limit to stay the same ! <nl> EXPECT_EQ ( 1 , t . buffer_limit ( ) ) ; <nl> TEST ( PrefetchAutotuner , EnabledSteady ) { <nl> } <nl> } <nl> <nl> + TEST ( PrefetchAutotuner , StartWithMin ) { <nl> + PrefetchAutotuner t ( model : : kAutotune , 2 ) ; <nl> + EXPECT_EQ ( 2 , t . buffer_limit ( ) ) ; <nl> + t . RecordConsumption ( 0 ) ; / / Expect buffer limit to stay the same ! <nl> + EXPECT_EQ ( 2 , t . buffer_limit ( ) ) ; <nl> + t . RecordConsumption ( 2 ) ; / / Expect buffer limit to stay the same ! <nl> + EXPECT_EQ ( 2 , t . buffer_limit ( ) ) ; <nl> + t . RecordConsumption ( 0 ) ; / / Expect buffer limit to increase . <nl> + EXPECT_EQ ( 4 , t . buffer_limit ( ) ) ; <nl> + t . RecordConsumption ( 4 ) ; / / Expect buffer limit to stay the same ! <nl> + EXPECT_EQ ( 4 , t . buffer_limit ( ) ) ; <nl> + t . RecordConsumption ( 0 ) ; / / Expect buffer limit to increase . <nl> + EXPECT_EQ ( 8 , t . buffer_limit ( ) ) ; <nl> + <nl> + / / Never reach zero again . <nl> + std : : vector < size_t > consumption_values = { 3 , 5 , 7 , 1 , 4 , 6 , 8 , 3 , 5 , 1 , 2 , 4 } ; <nl> + for ( int i = 0 ; i < consumption_values . size ( ) ; + + i ) { <nl> + t . RecordConsumption ( consumption_values [ i ] ) ; <nl> + EXPECT_EQ ( 8 , t . buffer_limit ( ) ) <nl> + < < " Failed at index " < < i < < " with value : " < < consumption_values [ i ] ; <nl> + } <nl> + } <nl> + <nl> } / / namespace <nl> } / / namespace data <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / kernels / data / prefetch_dataset_op . cc <nl> ppp b / tensorflow / core / kernels / data / prefetch_dataset_op . cc <nl> namespace data { <nl> / * static * / constexpr const char * const PrefetchDatasetOp : : kOutputShapes ; <nl> / * static * / constexpr const char * const PrefetchDatasetOp : : kSlackPeriod ; <nl> / * static * / constexpr const char * const PrefetchDatasetOp : : kLegacyAutotune ; <nl> + / * static * / constexpr const char * const PrefetchDatasetOp : : kBufferSizeMin ; <nl> <nl> namespace { <nl> <nl> constexpr char kErrorMessageSuffix [ ] = " . error_message " ; <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> public : <nl> Dataset ( OpKernelContext * ctx , const DatasetBase * input , int64 buffer_size , <nl> - int64 slack_period , bool legacy_autotune ) <nl> + int64 slack_period , bool legacy_autotune , int64 buffer_size_min ) <nl> : DatasetBase ( DatasetContext ( ctx ) ) , <nl> input_ ( input ) , <nl> buffer_size_ ( buffer_size ) , <nl> slack_period_ ( slack_period ) , <nl> - legacy_autotune_ ( legacy_autotune ) { <nl> + legacy_autotune_ ( legacy_autotune ) , <nl> + buffer_size_min_ ( buffer_size_min ) { <nl> input_ - > Ref ( ) ; <nl> } <nl> <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> b - > BuildAttrValue ( slack_period_ , & slack_period_attr ) ; <nl> AttrValue legacy_autotune_attr ; <nl> b - > BuildAttrValue ( legacy_autotune_ , & legacy_autotune_attr ) ; <nl> + AttrValue buffer_size_min_attr ; <nl> + b - > BuildAttrValue ( buffer_size_min_ , & buffer_size_min_attr ) ; <nl> + <nl> TF_RETURN_IF_ERROR ( <nl> b - > AddDataset ( this , { input_graph_node , buffer_size } , <nl> { std : : make_pair ( kSlackPeriod , slack_period_attr ) , <nl> - std : : make_pair ( kLegacyAutotune , legacy_autotune_attr ) } , <nl> + std : : make_pair ( kLegacyAutotune , legacy_autotune_attr ) , <nl> + std : : make_pair ( kBufferSizeMin , buffer_size_min_attr ) } , <nl> output ) ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> : DatasetIterator < Dataset > ( params ) , <nl> mu_ ( std : : make_shared < mutex > ( ) ) , <nl> cond_var_ ( std : : make_shared < condition_variable > ( ) ) , <nl> - auto_tuner_ ( params . dataset - > buffer_size_ ) , <nl> + buffer_size_min_ ( params . dataset - > buffer_size_min_ ) , <nl> + auto_tuner_ ( params . dataset - > buffer_size_ , buffer_size_min_ ) , <nl> legacy_autotune_ ( params . dataset - > legacy_autotune_ ) , <nl> + / / If ` legacy_autotune_ ` , initialize the ` buffer_size_ ` value to be 0 <nl> + / / to avoid the created node to be collected as tunable nodes in the <nl> + / / autotuning optimization . <nl> buffer_size_ ( std : : make_shared < model : : SharedState > ( <nl> legacy_autotune_ ? 0 : params . dataset - > buffer_size_ , mu_ , <nl> cond_var_ ) ) { <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> Status Initialize ( IteratorContext * ctx ) override { <nl> mutex_lock l ( * mu_ ) ; <nl> if ( buffer_size_ - > value = = model : : kAutotune ) { <nl> - buffer_size_ - > value = 0 ; <nl> + buffer_size_ - > value = buffer_size_min_ ; <nl> } <nl> TF_RETURN_IF_ERROR ( RegisterCancellationCallback ( <nl> ctx - > cancellation_manager ( ) , [ this ] ( ) { CancelThreads ( ) ; } , <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> return model : : MakeAsyncKnownRatioNode ( <nl> std : : move ( args ) , <nl> / * ratio = * / 1 , <nl> - { model : : MakeParameter ( kBufferSize , buffer_size_ , / * min = * / 0 , <nl> + { model : : MakeParameter ( kBufferSize , buffer_size_ , <nl> + / * min = * / buffer_size_min_ , <nl> / * max = * / std : : numeric_limits < int64 > : : max ( ) ) } ) ; <nl> } <nl> <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> mutex input_mu_ TF_ACQUIRED_BEFORE ( * mu_ ) ; <nl> std : : unique_ptr < IteratorBase > input_impl_ TF_GUARDED_BY ( input_mu_ ) ; <nl> const std : : shared_ptr < condition_variable > cond_var_ ; <nl> + const int64 buffer_size_min_ ; <nl> PrefetchAutotuner auto_tuner_ TF_GUARDED_BY ( * mu_ ) ; <nl> std : : deque < BufferElement > buffer_ TF_GUARDED_BY ( * mu_ ) ; <nl> std : : unique_ptr < Thread > prefetch_thread_ TF_GUARDED_BY ( * mu_ ) ; <nl> class PrefetchDatasetOp : : Dataset : public DatasetBase { <nl> / / Determines whether legacy autotuning should be used . <nl> const bool legacy_autotune_ = true ; <nl> <nl> + / / If autotune is enabled , determines the minimal value of ` buffer_size ` <nl> + / / parameter . <nl> + const int64 buffer_size_min_ = 0 ; <nl> + <nl> TraceMeMetadata traceme_metadata_ ; <nl> } ; <nl> <nl> PrefetchDatasetOp : : PrefetchDatasetOp ( OpKernelConstruction * ctx ) <nl> if ( ctx - > HasAttr ( kLegacyAutotune ) ) { <nl> OP_REQUIRES_OK ( ctx , ctx - > GetAttr ( kLegacyAutotune , & legacy_autotune_ ) ) ; <nl> } <nl> + if ( ctx - > HasAttr ( kBufferSizeMin ) ) { <nl> + OP_REQUIRES_OK ( ctx , ctx - > GetAttr ( kBufferSizeMin , & buffer_size_min_ ) ) ; <nl> + } <nl> } <nl> <nl> void PrefetchDatasetOp : : MakeDataset ( OpKernelContext * ctx , DatasetBase * input , <nl> void PrefetchDatasetOp : : MakeDataset ( OpKernelContext * ctx , DatasetBase * input , <nl> metrics : : RecordTFDataAutotune ( kDatasetType ) ; <nl> } <nl> <nl> - * output = <nl> - new Dataset ( ctx , input , buffer_size , slack_period_ , legacy_autotune_ ) ; <nl> + * output = new Dataset ( ctx , input , buffer_size , slack_period_ , <nl> + legacy_autotune_ , buffer_size_min_ ) ; <nl> } <nl> <nl> namespace { <nl> mmm a / tensorflow / core / kernels / data / prefetch_dataset_op . h <nl> ppp b / tensorflow / core / kernels / data / prefetch_dataset_op . h <nl> class PrefetchDatasetOp : public UnaryDatasetOpKernel { <nl> static constexpr const char * const kOutputShapes = " output_shapes " ; <nl> static constexpr const char * const kSlackPeriod = " slack_period " ; <nl> static constexpr const char * const kLegacyAutotune = " legacy_autotune " ; <nl> + static constexpr const char * const kBufferSizeMin = " buffer_size_min " ; <nl> <nl> explicit PrefetchDatasetOp ( OpKernelConstruction * ctx ) ; <nl> <nl> class PrefetchDatasetOp : public UnaryDatasetOpKernel { <nl> class Dataset ; <nl> int64 slack_period_ = 0 ; <nl> bool legacy_autotune_ = true ; <nl> + int64 buffer_size_min_ = 0 ; <nl> } ; <nl> <nl> } / / namespace data <nl> mmm a / tensorflow / core / kernels / data / prefetch_dataset_op_test . cc <nl> ppp b / tensorflow / core / kernels / data / prefetch_dataset_op_test . cc <nl> class PrefetchDatasetParams : public DatasetParams { <nl> attr_vector - > emplace_back ( PrefetchDatasetOp : : kSlackPeriod , slack_period_ ) ; <nl> attr_vector - > emplace_back ( PrefetchDatasetOp : : kLegacyAutotune , <nl> legacy_autotune_ ) ; <nl> - attr_vector - > emplace_back ( " buffer_size_min " , buffer_size_min_ ) ; <nl> + attr_vector - > emplace_back ( PrefetchDatasetOp : : kBufferSizeMin , <nl> + buffer_size_min_ ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> mmm a / tensorflow / python / data / experimental / kernel_tests / optimization / autotune_buffer_sizes_test . py <nl> ppp b / tensorflow / python / data / experimental / kernel_tests / optimization / autotune_buffer_sizes_test . py <nl> def testChainedParallelDatasets ( self ) : <nl> ] ) ) <nl> dataset = dataset . map ( <nl> lambda x : x + 1 , num_parallel_calls = dataset_ops . AUTOTUNE ) <nl> + dataset = dataset . prefetch ( buffer_size = 3 ) <nl> dataset = dataset . map ( <nl> lambda x : x + 1 , num_parallel_calls = dataset_ops . AUTOTUNE ) <nl> dataset = dataset . map ( <nl> lambda x : x + 1 , num_parallel_calls = dataset_ops . AUTOTUNE ) <nl> + dataset = dataset . prefetch ( buffer_size = dataset_ops . AUTOTUNE ) <nl> dataset = dataset . interleave ( <nl> lambda x : dataset_ops . Dataset . from_tensors ( x + 1 ) , <nl> num_parallel_calls = dataset_ops . AUTOTUNE ) <nl>
[ tf . data ] Modify the optimization ` autotune_buffer_sizes ` so that it will inject autotuned PrefetchDatasets after non - prefetched asynchronous datasets . The optimization will also rewrite those existing non - autotuned PrefetchDatasets into autotuned with fixed start value and minimal value for the tunable parameter ` buffer_size ` .
tensorflow/tensorflow
6c838fcbf8224149de759896cbefa82a793b7461
2020-11-13T23:22:13Z
mmm a / osquery / core / init . cpp <nl> ppp b / osquery / core / init . cpp <nl> enum { <nl> <nl> namespace osquery { <nl> CLI_FLAG ( uint64 , alarm_timeout , 4 , " Seconds to wait for a graceful shutdown " ) ; <nl> + CLI_FLAG ( bool , <nl> + enable_signal_handler , <nl> + false , <nl> + " Enable custom osquery signals handler instead of default one " ) ; <nl> } <nl> <nl> namespace { <nl> Initializer : : Initializer ( int & argc , <nl> initWorkDirectories ( ) ; <nl> } <nl> <nl> - std : : signal ( SIGABRT , signalHandler ) ; <nl> - std : : signal ( SIGUSR1 , signalHandler ) ; <nl> + if ( FLAGS_enable_signal_handler ) { <nl> + std : : signal ( SIGABRT , signalHandler ) ; <nl> + std : : signal ( SIGUSR1 , signalHandler ) ; <nl> <nl> - / / All tools handle the same set of signals . <nl> - / / If a daemon process is a watchdog the signal is passed to the worker , <nl> - / / unless the worker has not yet started . <nl> - if ( ! isPlatform ( PlatformType : : TYPE_WINDOWS ) ) { <nl> - std : : signal ( SIGTERM , signalHandler ) ; <nl> - std : : signal ( SIGINT , signalHandler ) ; <nl> - std : : signal ( SIGHUP , signalHandler ) ; <nl> - std : : signal ( SIGALRM , signalHandler ) ; <nl> + / / All tools handle the same set of signals . <nl> + / / If a daemon process is a watchdog the signal is passed to the worker , <nl> + / / unless the worker has not yet started . <nl> + if ( ! isPlatform ( PlatformType : : TYPE_WINDOWS ) ) { <nl> + std : : signal ( SIGTERM , signalHandler ) ; <nl> + std : : signal ( SIGINT , signalHandler ) ; <nl> + std : : signal ( SIGHUP , signalHandler ) ; <nl> + std : : signal ( SIGALRM , signalHandler ) ; <nl> + } <nl> } <nl> <nl> / / If the caller is checking configuration , disable the watchdog / worker . <nl> void Initializer : : requestShutdown ( int retcode ) { <nl> } <nl> <nl> / / Stop thrift services / clients / and their thread pools . <nl> - if ( std : : this_thread : : get_id ( ) ! = kMainThreadId ) { <nl> + if ( std : : this_thread : : get_id ( ) ! = kMainThreadId & & <nl> + FLAGS_enable_signal_handler ) { <nl> raise ( SIGUSR1 ) ; <nl> } else { <nl> / / The main thread is requesting a shutdown , meaning in almost every case <nl>
Switch off signal handling by default in osquery ( in order to remove it later ) ( )
osquery/osquery
645e2531dc53f59320ab05bf2c976699b0212d01
2019-03-20T17:43:36Z
mmm a / src / openalpr / textdetection / characteranalysis . cpp <nl> ppp b / src / openalpr / textdetection / characteranalysis . cpp <nl> void CharacterAnalysis : : analyze ( ) <nl> LineFinder lf ( pipeline_data ) ; <nl> vector < vector < Point > > linePolygons = lf . findLines ( pipeline_data - > crop_gray , bestContours ) ; <nl> <nl> - <nl> + vector < TextLine > tempTextLines ; <nl> for ( uint i = 0 ; i < linePolygons . size ( ) ; i + + ) <nl> { <nl> vector < Point > linePolygon = linePolygons [ i ] ; <nl> void CharacterAnalysis : : analyze ( ) <nl> <nl> TextLine textLine ( textArea , linePolygon ) ; <nl> <nl> - pipeline_data - > textLines . push_back ( textLine ) ; <nl> + tempTextLines . push_back ( textLine ) ; <nl> } <nl> <nl> cout < < " Good contours inverted left : " < < bestContours . getGoodIndicesCount ( ) < < endl ; <nl> <nl> - filterBetweenLines ( bestThreshold , bestContours , pipeline_data - > textLines ) ; <nl> + filterBetweenLines ( bestThreshold , bestContours , tempTextLines ) ; <nl> <nl> - for ( uint i = 0 ; i < pipeline_data - > textLines . size ( ) ; i + + ) <nl> + / / Now that we ' ve filtered a few more contours , re - do the text area . <nl> + for ( uint i = 0 ; i < tempTextLines . size ( ) ; i + + ) <nl> { <nl> + vector < Point > updatedTextArea = getCharArea ( tempTextLines [ i ] . topLine , tempTextLines [ i ] . bottomLine ) ; <nl> + vector < Point > linePolygon = tempTextLines [ i ] . linePolygon ; <nl> + pipeline_data - > textLines . push_back ( TextLine ( updatedTextArea , linePolygon ) ) ; <nl> + <nl> + <nl> cout < < " Test1 " < < endl ; <nl> Mat debugImage = pipeline_data - > textLines [ i ] . drawDebugImage ( bestThreshold ) ; <nl> <nl> void CharacterAnalysis : : filterBetweenLines ( Mat img , TextContours & textContours , <nl> if ( textContours . goodIndices [ i ] = = false ) <nl> continue ; <nl> <nl> - textContours . goodIndices [ i ] = false ; / / Set it to not included unless it proves <nl> - <nl> float percentInsideMask = getContourAreaPercentInsideMask ( outerMask , <nl> textContours . contours , <nl> textContours . hierarchy , <nl> void CharacterAnalysis : : filterBetweenLines ( Mat img , TextContours & textContours , <nl> / / Not enough area is inside the lines . <nl> if ( config - > debugCharAnalysis ) <nl> cout < < " Rejecting due to insufficient area " < < endl ; <nl> + textContours . goodIndices [ i ] = false ; <nl> + <nl> continue ; <nl> } <nl> <nl> - textContours . goodIndices [ i ] = true ; <nl> <nl> / / now check to make sure that the top and bottom of the contour are near enough to the lines <nl> <nl> void CharacterAnalysis : : filterBetweenLines ( Mat img , TextContours & textContours , <nl> cout < < " Distances : " < < absTopDistance < < " : " < < maxDistance < < " - " < < absBottomDistance < < " : " < < maxDistance < < endl ; <nl> if ( absTopDistance < maxDistance & & absBottomDistance < maxDistance ) <nl> { <nl> - textContours . goodIndices [ i ] = true ; <nl> + / / It ' s ok , leave it as - is . <nl> } <nl> - else if ( config - > debugCharAnalysis ) <nl> + else <nl> { <nl> + <nl> + textContours . goodIndices [ i ] = false ; <nl> + if ( config - > debugCharAnalysis ) <nl> cout < < " Rejecting due to top / bottom points that are out of range " < < endl ; <nl> } <nl> } <nl>
Using filter between lines before adding to TextLine array
openalpr/openalpr
8c6cd5723df26cc130b943110fe730ac83890260
2014-10-19T23:39:57Z
mmm a / samples / python / tutorial_code / imgProc / match_template / match_template . py <nl> ppp b / samples / python / tutorial_code / imgProc / match_template / match_template . py <nl> <nl> <nl> def main ( argv ) : <nl> <nl> - if ( len ( sys . argv ) < 3 ) : <nl> - print ' Not enough parameters ' <nl> - print ' Usage : \ nmatch_template_demo . py < image_name > < template_name > [ < mask_name > ] ' <nl> - return - 1 <nl> - <nl> - # # [ load_image ] <nl> - global img <nl> - global templ <nl> - img = cv2 . imread ( sys . argv [ 1 ] , cv2 . IMREAD_COLOR ) <nl> - templ = cv2 . imread ( sys . argv [ 2 ] , cv2 . IMREAD_COLOR ) <nl> - <nl> - if ( len ( sys . argv ) > 3 ) : <nl> - global use_mask <nl> - use_mask = True <nl> - global mask <nl> - mask = cv2 . imread ( sys . argv [ 3 ] , cv2 . IMREAD_COLOR ) <nl> - <nl> - if ( ( img is None ) or ( templ is None ) or ( use_mask and ( mask is None ) ) ) : <nl> - print ' Can \ ' t read one of the images ' <nl> - return - 1 <nl> - # # [ load_image ] <nl> - <nl> - # # [ create_windows ] <nl> - cv2 . namedWindow ( image_window , cv2 . WINDOW_AUTOSIZE ) <nl> - cv2 . namedWindow ( result_window , cv2 . WINDOW_AUTOSIZE ) <nl> - # # [ create_windows ] <nl> - <nl> - # # [ create_trackbar ] <nl> - trackbar_label = ' Method : \ n 0 : SQDIFF \ n 1 : SQDIFF NORMED \ n 2 : TM CCORR \ n 3 : TM CCORR NORMED \ n 4 : TM COEFF \ n 5 : TM COEFF NORMED ' <nl> - cv2 . createTrackbar ( trackbar_label , image_window , match_method , max_Trackbar , MatchingMethod ) <nl> - # # [ create_trackbar ] <nl> - <nl> - MatchingMethod ( match_method ) <nl> - <nl> - # # [ wait_key ] <nl> - cv2 . waitKey ( 0 ) <nl> - return 0 <nl> - # # [ wait_key ] <nl> + if ( len ( sys . argv ) < 3 ) : <nl> + print ' Not enough parameters ' <nl> + print ' Usage : \ nmatch_template_demo . py < image_name > < template_name > [ < mask_name > ] ' <nl> + return - 1 <nl> + <nl> + # # [ load_image ] <nl> + global img <nl> + global templ <nl> + img = cv2 . imread ( sys . argv [ 1 ] , cv2 . IMREAD_COLOR ) <nl> + templ = cv2 . imread ( sys . argv [ 2 ] , cv2 . IMREAD_COLOR ) <nl> + <nl> + if ( len ( sys . argv ) > 3 ) : <nl> + global use_mask <nl> + use_mask = True <nl> + global mask <nl> + mask = cv2 . imread ( sys . argv [ 3 ] , cv2 . IMREAD_COLOR ) <nl> + <nl> + if ( ( img is None ) or ( templ is None ) or ( use_mask and ( mask is None ) ) ) : <nl> + print ' Can \ ' t read one of the images ' <nl> + return - 1 <nl> + # # [ load_image ] <nl> + <nl> + # # [ create_windows ] <nl> + cv2 . namedWindow ( image_window , cv2 . WINDOW_AUTOSIZE ) <nl> + cv2 . namedWindow ( result_window , cv2 . WINDOW_AUTOSIZE ) <nl> + # # [ create_windows ] <nl> + <nl> + # # [ create_trackbar ] <nl> + trackbar_label = ' Method : \ n 0 : SQDIFF \ n 1 : SQDIFF NORMED \ n 2 : TM CCORR \ n 3 : TM CCORR NORMED \ n 4 : TM COEFF \ n 5 : TM COEFF NORMED ' <nl> + cv2 . createTrackbar ( trackbar_label , image_window , match_method , max_Trackbar , MatchingMethod ) <nl> + # # [ create_trackbar ] <nl> + <nl> + MatchingMethod ( match_method ) <nl> + <nl> + # # [ wait_key ] <nl> + cv2 . waitKey ( 0 ) <nl> + return 0 <nl> + # # [ wait_key ] <nl> <nl> def MatchingMethod ( param ) : <nl> <nl> - global match_method <nl> - match_method = param <nl> - <nl> - # # [ copy_source ] <nl> - img_display = img . copy ( ) <nl> - # # [ copy_source ] <nl> - # # [ match_template ] <nl> - method_accepts_mask = ( cv2 . TM_SQDIFF = = match_method or match_method = = cv2 . TM_CCORR_NORMED ) <nl> - if ( use_mask and method_accepts_mask ) : <nl> - result = cv2 . matchTemplate ( img , templ , match_method , None , mask ) <nl> - else : <nl> - result = cv2 . matchTemplate ( img , templ , match_method ) <nl> - # # [ match_template ] <nl> - <nl> - # # [ normalize ] <nl> - cv2 . normalize ( result , result , 0 , 1 , cv2 . NORM_MINMAX , - 1 ) <nl> - # # [ normalize ] <nl> - # # [ best_match ] <nl> - minVal , maxVal , minLoc , maxLoc = cv2 . minMaxLoc ( result , None ) <nl> - # # [ best_match ] <nl> - <nl> - # # [ match_loc ] <nl> - if ( match_method = = cv2 . TM_SQDIFF or match_method = = cv2 . TM_SQDIFF_NORMED ) : <nl> - matchLoc = minLoc <nl> - else : <nl> - matchLoc = maxLoc <nl> - # # [ match_loc ] <nl> - <nl> - # # [ imshow ] <nl> - cv2 . rectangle ( img_display , matchLoc , ( matchLoc [ 0 ] + templ . shape [ 0 ] , matchLoc [ 1 ] + templ . shape [ 1 ] ) , ( 0 , 0 , 0 ) , 2 , 8 , 0 ) <nl> - cv2 . rectangle ( result , matchLoc , ( matchLoc [ 0 ] + templ . shape [ 0 ] , matchLoc [ 1 ] + templ . shape [ 1 ] ) , ( 0 , 0 , 0 ) , 2 , 8 , 0 ) <nl> - cv2 . imshow ( image_window , img_display ) <nl> - cv2 . imshow ( result_window , result ) <nl> - # # [ imshow ] <nl> - pass <nl> + global match_method <nl> + match_method = param <nl> + <nl> + # # [ copy_source ] <nl> + img_display = img . copy ( ) <nl> + # # [ copy_source ] <nl> + # # [ match_template ] <nl> + method_accepts_mask = ( cv2 . TM_SQDIFF = = match_method or match_method = = cv2 . TM_CCORR_NORMED ) <nl> + if ( use_mask and method_accepts_mask ) : <nl> + result = cv2 . matchTemplate ( img , templ , match_method , None , mask ) <nl> + else : <nl> + result = cv2 . matchTemplate ( img , templ , match_method ) <nl> + # # [ match_template ] <nl> + <nl> + # # [ normalize ] <nl> + cv2 . normalize ( result , result , 0 , 1 , cv2 . NORM_MINMAX , - 1 ) <nl> + # # [ normalize ] <nl> + # # [ best_match ] <nl> + _minVal , _maxVal , minLoc , maxLoc = cv2 . minMaxLoc ( result , None ) <nl> + # # [ best_match ] <nl> + <nl> + # # [ match_loc ] <nl> + if ( match_method = = cv2 . TM_SQDIFF or match_method = = cv2 . TM_SQDIFF_NORMED ) : <nl> + matchLoc = minLoc <nl> + else : <nl> + matchLoc = maxLoc <nl> + # # [ match_loc ] <nl> + <nl> + # # [ imshow ] <nl> + cv2 . rectangle ( img_display , matchLoc , ( matchLoc [ 0 ] + templ . shape [ 0 ] , matchLoc [ 1 ] + templ . shape [ 1 ] ) , ( 0 , 0 , 0 ) , 2 , 8 , 0 ) <nl> + cv2 . rectangle ( result , matchLoc , ( matchLoc [ 0 ] + templ . shape [ 0 ] , matchLoc [ 1 ] + templ . shape [ 1 ] ) , ( 0 , 0 , 0 ) , 2 , 8 , 0 ) <nl> + cv2 . imshow ( image_window , img_display ) <nl> + cv2 . imshow ( result_window , result ) <nl> + # # [ imshow ] <nl> + pass <nl> <nl> if __name__ = = " __main__ " : <nl> - main ( sys . argv [ 1 : ] ) <nl> + main ( sys . argv [ 1 : ] ) <nl>
Merge pull request from Cartucho : improve_match_template_py
opencv/opencv
717b2f496f6fd0e7535a63c40783ccc1dc7790e0
2017-08-24T19:51:09Z
mmm a / docs - translations / es / README . md <nl> ppp b / docs - translations / es / README . md <nl> <nl> <nl> # # Tutoriales <nl> <nl> - * [ Introducción ] ( . . / . . / docs / tutorial / quick - start . md ) <nl> - * [ Integración con el entorno de escritorio ] ( . . / . . / docs / tutorial / desktop - environment - integration . md ) <nl> - * [ Detección del evento en línea / fuera de línea ] ( . . / . . / docs / tutorial / online - offline - events . md ) <nl> + * [ Introducción ] ( tutorial / quick - start . md ) <nl> + * [ Integración con el entorno de escritorio ] ( tutorial / desktop - environment - integration . md ) <nl> + * [ Detección del evento en línea / fuera de línea ] ( tutorial / online - offline - events . md ) <nl> <nl> # # API <nl> <nl> - * [ Sinopsis ] ( . . / . . / docs / api / synopsis . md ) <nl> - * [ Proceso ] ( . . / . . / docs / api / process . md ) <nl> - * [ Parámetros CLI soportados ( Chrome ) ] ( . . / . . / docs / api / chrome - command - line - switches . md ) <nl> + * [ Sinopsis ] ( api / synopsis . md ) <nl> + * [ Proceso ] ( api / process . md ) <nl> + * [ Parámetros CLI soportados ( Chrome ) ] ( api / chrome - command - line - switches . md ) <nl> <nl> Elementos DOM customizados : <nl> <nl> new file mode 100644 <nl> index 000000000000 . . c063869adf95 <nl> mmm / dev / null <nl> ppp b / docs - translations / es / api / chrome - command - line - switches . md <nl> <nl> + # Parámetros CLI soportados ( Chrome ) <nl> + <nl> + Esta página lista las líneas de comandos usadas por el navegador Chrome que también son <nl> + soportadas por Electron . Puedes usar [ app . commandLine . appendSwitch ] [ append - switch ] para <nl> + anexarlas en el script principal de tu aplicación antes de que el evento [ ready ] [ ready ] del <nl> + modulo [ app ] [ app ] sea emitido : <nl> + <nl> + ` ` ` javascript <nl> + var app = require ( ' app ' ) ; <nl> + app . commandLine . appendSwitch ( ' remote - debugging - port ' , ' 8315 ' ) ; <nl> + app . commandLine . appendSwitch ( ' host - rules ' , ' MAP * 127 . 0 . 0 . 1 ' ) ; <nl> + <nl> + app . on ( ' ready ' , function ( ) { <nl> + / / Your code here <nl> + } ) ; <nl> + ` ` ` <nl> + <nl> + # # - - client - certificate = ` path ` <nl> + <nl> + Establece el ` path ` del archivo de certificado del cliente . <nl> + <nl> + # # - - ignore - connections - limit = ` domains ` <nl> + <nl> + Ignora el límite de conexiones para la lista de ` domains ` separados por ` , ` . <nl> + <nl> + # # - - disable - http - cache <nl> + <nl> + Deshabilita la cacheé del disco para las peticiones HTTP . <nl> + <nl> + # # - - remote - debugging - port = ` port ` <nl> + <nl> + Habilita la depuración remota a través de HTTP en el puerto especificado . <nl> + <nl> + # # - - proxy - server = ` address : port ` <nl> + <nl> + Usa un servidor proxy especificado , que sobreescribe la configuración del sistema . <nl> + Este cambio solo afecta peticiones HTTP y HTTPS . <nl> + <nl> + # # - - proxy - pac - url = ` url ` <nl> + <nl> + Utiliza el script PAC en la ` url ` especificada . <nl> + <nl> + # # - - no - proxy - server <nl> + <nl> + No usa un servidor proxy y siempre establece conexiones directas . Anula cualquier <nl> + otra bandera de servidor proxy bandera que se pase . <nl> + <nl> + # # - - host - rules = ` rules ` <nl> + <nl> + Una lista separada por comas de ` rules ` ( reglas ) que controlan cómo se asignan los <nl> + nombres de host . <nl> + <nl> + Por ejemplo : <nl> + <nl> + * ` MAP * 127 . 0 . 0 . 1 ` Obliga a todos los nombres de host a ser asignados a 127 . 0 . 0 . 1 <nl> + * ` MAP * . google . com proxy ` Obliga todos los subdominios google . com a resolverse con <nl> + " proxy " . <nl> + * ` MAP test . com [ : : 1 ] : 77 ` Obliga a resolver " test . com " con un bucle invertido de IPv6 . <nl> + También obligará a que el puerto de la dirección respuesta sea 77 . <nl> + * ` MAP * baz , EXCLUDE www . google . com ` Reasigna todo a " baz " , excepto a " www . google . com " . <nl> + <nl> + Estas asignaciones especifican el host final en una petición de red ( Anfitrión de la conexión TCP <nl> + y de resolución de conexión directa , y el ` CONNECT ` en una conexión proxy HTTP , y el host final de <nl> + la conexión proxy ` SOCKS ` ) . <nl> + <nl> + # # - - host - resolver - rules = ` rules ` <nl> + <nl> + Como ` - - host - rules ` pero estas ` rules ` solo se aplican al solucionador . <nl> + <nl> + [ app ] : app . md <nl> + [ append - switch ] : app . md # appcommandlineappendswitchswitch - value <nl> + [ ready ] : app . md # event - ready <nl> + <nl> + # # - - ignore - certificate - errors <nl> + <nl> + Ignora errores de certificado relacionados . <nl> + <nl> + # # - - ppapi - flash - path = ` path ` <nl> + <nl> + Asigna la ruta ` path ` del pepper flash plugin . <nl> + <nl> + # # - - ppapi - flash - version = ` version ` <nl> + <nl> + Asigna la versión ` version ` del pepper flash plugin . <nl> + <nl> + # # - - log - net - log = ` path ` <nl> + <nl> + Permite guardar y escribir eventos de registros de red en ` path ` . <nl> + <nl> + # # - - ssl - version - fallback - min = ` version ` <nl> + <nl> + Establece la versión mínima de SSL / TLS ( " tls1 " , " tls1 . 1 " o " tls1 . 2 " ) que <nl> + el repliegue de TLC aceptará . <nl> + <nl> + # # - - enable - logging <nl> + <nl> + Imprime el registro de Chromium en consola . <nl> + <nl> + Este cambio no puede ser usado en ` app . commandLine . appendSwitch ` ya que se analiza antes de que la <nl> + aplicación del usuario este cargada . <nl> + <nl> + # # - - v = ` log_level ` <nl> + <nl> + Da el maximo nivel activo de V - logging por defecto ; 0 es el predeterminado . Valores positivos <nl> + son normalmente usados para los niveles de V - logging . <nl> + <nl> + Este modificador sólo funciona cuando también se pasa ` - - enable - logging ` . <nl> + <nl> + # # - - vmodule = ` pattern ` <nl> + <nl> + Da los niveles máximos de V - logging por módulo para sobreescribir el valor dado por <nl> + ` - - v ` . Ej . ` my_module = 2 , foo * = 3 ` cambiaria el nivel de registro para todo el código <nl> + el archivos de origen ` my_module . * ` y ` foo * . * ` . <nl> + <nl> + Cualquier patron que contiene un slash o un slash invertido será probado contra toda la ruta <nl> + y no sólo con el módulo . Ej . ` * / foo / bar / * = 2 ` cambiaría el nivel de registro para todo el código <nl> + en los archivos origen bajo un directorio ` foo / bar ` . <nl> + <nl> + Este modificador sólo funciona cuando también se pasa ` - - enable - logging ` . <nl> new file mode 100644 <nl> index 000000000000 . . e03ef5fa1c36 <nl> mmm / dev / null <nl> ppp b / docs - translations / es / api / process . md <nl> <nl> + # process <nl> + <nl> + El objeto ` process ` en Electron tiene las siguientes diferencias con respecto <nl> + al node convencional : <nl> + <nl> + * ` process . type ` String - El tipo del proceso puede ser ` browser ` ( ej . proceso <nl> + principal ) o ` renderer ` . <nl> + * ` process . versions [ ' electron ' ] ` String - Versión de Electron . <nl> + * ` process . versions [ ' chrome ' ] ` String - Versión de Chromium . <nl> + * ` process . resourcesPath ` String - Ruta al código fuente JavaScript . <nl> + <nl> + # # Events <nl> + <nl> + # # # Event : ' loaded ' <nl> + <nl> + Se emite cuando Electron ha cargado su script de inicialización interna y <nl> + está comenzando a cargar la página web o el script principal . <nl> + <nl> + Puede ser usado por el script precargado para añadir de nuevo los símbolos globales <nl> + de Node eliminados , al alcance global cuando la integración de Node está apagada : <nl> + <nl> + ` ` ` js <nl> + / / preload . js <nl> + var _setImmediate = setImmediate ; <nl> + var _clearImmediate = clearImmediate ; <nl> + process . once ( ' loaded ' , function ( ) { <nl> + global . setImmediate = _setImmediate ; <nl> + global . clearImmediate = _clearImmediate ; <nl> + } ) ; <nl> + ` ` ` <nl> + <nl> + # # Methods <nl> + <nl> + El objeto ` process ` tiene los siguientes métodos : <nl> + <nl> + # # # ` process . hang ` <nl> + <nl> + Interrumpe el hilo principal del proceso actual . <nl> + <nl> + <nl> + # # # process . setFdLimit ( maxDescriptors ) _OS X_ _Linux_ <nl> + <nl> + * ` maxDescriptors ` Integer <nl> + <nl> + Establece el límite dinámico del descriptor del archivo en ` maxDescriptors ` <nl> + o en el límite estricto del Sistema Operativo , el que sea menor para el <nl> + proceso actual . <nl> new file mode 100644 <nl> index 000000000000 . . 0da368dea459 <nl> mmm / dev / null <nl> ppp b / docs - translations / es / api / synopsis . md <nl> <nl> + # Synopsis <nl> + <nl> + Todos los [ Módulos integrados de Node . js ] ( http : / / nodejs . org / api / ) se encuentran <nl> + disponibles en Electron y módulos de terceros son támbien totalmente compatibles <nl> + ( incluyendo los [ módulos nativos ] ( . . / tutorial / using - native - node - modules . md ) ) . <nl> + <nl> + Electron también provee algunos módulos integrados adicionales para desarrollar <nl> + aplicaciones nativas de escritorio . Algunos módulos sólo se encuentran disponibles <nl> + en el proceso principal , algunos sólo en el proceso renderer ( pagina web ) , y <nl> + algunos pueden ser usados en ambos procesos . <nl> + <nl> + La regla básica es : Si un módulo es <nl> + [ GUI ] ( https : / / es . wikipedia . org / wiki / Interfaz_gráfica_de_usuario ) o de bajo nivel , <nl> + entonces solo estará disponible en el proceso principal . Necesitas familiarizarte <nl> + con el concepto de [ scripts para proceso principal vs scripts para proceso renderer ] <nl> + ( . . / tutorial / quick - start . md # the - main - process ) para ser capaz de usar esos módulos . <nl> + <nl> + El script del proceso principal es como un script normal de Node . js : <nl> + <nl> + ` ` ` javascript <nl> + var app = require ( ' app ' ) ; <nl> + var BrowserWindow = require ( ' browser - window ' ) ; <nl> + <nl> + var window = null ; <nl> + <nl> + app . on ( ' ready ' , function ( ) { <nl> + window = new BrowserWindow ( { width : 800 , height : 600 } ) ; <nl> + window . loadUrl ( ' https : / / github . com ' ) ; <nl> + } ) ; <nl> + ` ` ` <nl> + <nl> + El proceso renderer no es diferente de una página web normal , excepto por la <nl> + capacidad extra de utilizar módulos de node : <nl> + <nl> + ` ` ` html <nl> + < ! DOCTYPE html > <nl> + < html > <nl> + < body > <nl> + < script > <nl> + var remote = require ( ' remote ' ) ; <nl> + console . log ( remote . require ( ' app ' ) . getVersion ( ) ) ; <nl> + < / script > <nl> + < / body > <nl> + < / html > <nl> + ` ` ` <nl> + <nl> + Para ejecutar tu aplicación , lee [ Ejecutar la aplicación ] ( . . / tutorial / quick - start . md # run - your - app ) . <nl> \ No newline at end of file <nl>
Merge pull request from Meyito / API - es
electron/electron
55715bec23f2834bc12f62a57e5d42fe25decb05
2015-10-08T01:37:21Z
mmm a / dbms / src / Storages / PartitionCommands . cpp <nl> ppp b / dbms / src / Storages / PartitionCommands . cpp <nl> std : : optional < PartitionCommand > PartitionCommand : : parse ( const ASTAlterCommand * <nl> else <nl> return { } ; <nl> } <nl> + <nl> } <nl> mmm a / dbms / src / Storages / PartitionCommands . h <nl> ppp b / dbms / src / Storages / PartitionCommands . h <nl> struct PartitionCommand <nl> TABLE , <nl> } ; <nl> <nl> - MoveDestinationType move_destination_type ; <nl> + std : : optional < MoveDestinationType > move_destination_type ; <nl> + <nl> <nl> String move_destination_name ; <nl> <nl> mmm a / dbms / src / Storages / StorageMergeTree . cpp <nl> ppp b / dbms / src / Storages / StorageMergeTree . cpp <nl> bool StorageMergeTree : : tryMutatePart ( ) <nl> } <nl> } <nl> <nl> - if ( commands_for_size_validation . size ( ) ) <nl> + if ( ! commands_for_size_validation . empty ( ) ) <nl> { <nl> MutationsInterpreter interpreter ( shared_from_this ( ) , commands_for_size_validation , global_context , false ) ; <nl> commands_size + = interpreter . evaluateCommandsSize ( ) ; <nl> void StorageMergeTree : : alterPartition ( const ASTPtr & query , const PartitionComma <nl> <nl> case PartitionCommand : : MOVE_PARTITION : <nl> { <nl> - switch ( command . move_destination_type ) <nl> + switch ( * command . move_destination_type ) <nl> { <nl> case PartitionCommand : : MoveDestinationType : : DISK : <nl> movePartitionToDisk ( command . partition , command . move_destination_name , command . part , context ) ; <nl> mmm a / dbms / src / Storages / StorageReplicatedMergeTree . cpp <nl> ppp b / dbms / src / Storages / StorageReplicatedMergeTree . cpp <nl> void StorageReplicatedMergeTree : : alterPartition ( const ASTPtr & query , const Part <nl> break ; <nl> case PartitionCommand : : MOVE_PARTITION : <nl> { <nl> - switch ( command . move_destination_type ) <nl> + switch ( * command . move_destination_type ) <nl> { <nl> case PartitionCommand : : MoveDestinationType : : DISK : <nl> movePartitionToDisk ( command . partition , command . move_destination_name , command . part , query_context ) ; <nl>
Fix build errors
ClickHouse/ClickHouse
17e505da0fbc57b7040406c6ea6fede992551bfc
2020-03-17T17:22:41Z
mmm a / tools / cocos2d - console <nl> ppp b / tools / cocos2d - console <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 5ccdb9c59b9c8ce0ba9d6b15d0edb90a90c33559 <nl> + Subproject commit 04ade20dec5508d3865c89191e2f88dd21972456 <nl>
cocos command use clang
cocos2d/cocos2d-x
88bb8a4974dd54b95c20448c506b57443bad5b82
2016-06-02T06:34:10Z
mmm a / modules / stitching / exposure_compensate . cpp <nl> ppp b / modules / stitching / exposure_compensate . cpp <nl> <nl> <nl> using namespace std ; <nl> using namespace cv ; <nl> + using namespace cv : : gpu ; <nl> <nl> <nl> Ptr < ExposureCompensator > ExposureCompensator : : createDefault ( int type ) <nl> Ptr < ExposureCompensator > ExposureCompensator : : createDefault ( int type ) <nl> return new NoExposureCompensator ( ) ; <nl> if ( type = = OVERLAP ) <nl> return new OverlapExposureCompensator ( ) ; <nl> + if ( type = = SEGMENT ) <nl> + return new SegmentExposureCompensator ( ) ; <nl> CV_Error ( CV_StsBadArg , " unsupported exposure compensation method " ) ; <nl> return NULL ; <nl> } <nl> Ptr < ExposureCompensator > ExposureCompensator : : createDefault ( int type ) <nl> void OverlapExposureCompensator : : feed ( const vector < Point > & corners , const vector < Mat > & images , <nl> const vector < Mat > & masks ) <nl> { <nl> + CV_Assert ( corners . size ( ) = = images . size ( ) & & images . size ( ) = = masks . size ( ) ) ; <nl> + <nl> const int num_images = static_cast < int > ( images . size ( ) ) ; <nl> Mat_ < int > N ( num_images , num_images ) ; N . setTo ( 0 ) ; <nl> Mat_ < double > I ( num_images , num_images ) ; I . setTo ( 0 ) ; <nl> <nl> Rect dst_roi = resultRoi ( corners , images ) ; <nl> Mat subimg1 , subimg2 ; <nl> - Mat_ < uchar > submask1 , submask2 , overlap ; <nl> + Mat_ < uchar > submask1 , submask2 , intersect ; <nl> <nl> for ( int i = 0 ; i < num_images ; + + i ) <nl> { <nl> void OverlapExposureCompensator : : feed ( const vector < Point > & corners , const vector <nl> <nl> submask1 = masks [ i ] ( Rect ( roi . tl ( ) - corners [ i ] , roi . br ( ) - corners [ i ] ) ) ; <nl> submask2 = masks [ j ] ( Rect ( roi . tl ( ) - corners [ j ] , roi . br ( ) - corners [ j ] ) ) ; <nl> - overlap = submask1 & submask2 ; <nl> + intersect = submask1 & submask2 ; <nl> <nl> - N ( i , j ) = N ( j , i ) = countNonZero ( overlap ) ; <nl> + N ( i , j ) = N ( j , i ) = countNonZero ( intersect ) ; <nl> <nl> double Isum1 = 0 , Isum2 = 0 ; <nl> for ( int y = 0 ; y < roi . height ; + + y ) <nl> void OverlapExposureCompensator : : feed ( const vector < Point > & corners , const vector <nl> const Point3_ < uchar > * r2 = subimg2 . ptr < Point3_ < uchar > > ( y ) ; <nl> for ( int x = 0 ; x < roi . width ; + + x ) <nl> { <nl> - if ( overlap ( y , x ) ) <nl> + if ( intersect ( y , x ) ) <nl> { <nl> Isum1 + = sqrt ( static_cast < double > ( sqr ( r1 [ x ] . x ) + sqr ( r1 [ x ] . y ) + sqr ( r1 [ x ] . z ) ) ) ; <nl> Isum2 + = sqrt ( static_cast < double > ( sqr ( r2 [ x ] . x ) + sqr ( r2 [ x ] . y ) + sqr ( r2 [ x ] . z ) ) ) ; <nl> void OverlapExposureCompensator : : feed ( const vector < Point > & corners , const vector <nl> } <nl> } <nl> <nl> - solve ( A , b , gains_ , DECOMP_SVD ) ; <nl> + solve ( A , b , gains_ ) ; <nl> } <nl> <nl> <nl> void OverlapExposureCompensator : : apply ( int index , Point / * corner * / , Mat & image , <nl> { <nl> image * = gains_ ( index , 0 ) ; <nl> } <nl> + <nl> + <nl> + void SegmentExposureCompensator : : feed ( const vector < Point > & / * corners * / , const vector < Mat > & / * images * / , <nl> + const vector < Mat > & / * masks * / ) <nl> + { <nl> + } <nl> + <nl> + <nl> + void SegmentExposureCompensator : : apply ( int / * index * / , Point / * corner * / , Mat & / * image * / , const Mat & / * mask * / ) <nl> + { <nl> + } <nl> \ No newline at end of file <nl> mmm a / modules / stitching / exposure_compensate . hpp <nl> ppp b / modules / stitching / exposure_compensate . hpp <nl> <nl> class ExposureCompensator <nl> { <nl> public : <nl> - enum { NO , OVERLAP } ; <nl> + enum { NO , OVERLAP , SEGMENT } ; <nl> static cv : : Ptr < ExposureCompensator > createDefault ( int type ) ; <nl> <nl> virtual void feed ( const std : : vector < cv : : Point > & corners , const std : : vector < cv : : Mat > & images , <nl> class OverlapExposureCompensator : public ExposureCompensator <nl> } ; <nl> <nl> <nl> + class SegmentExposureCompensator : public ExposureCompensator <nl> + { <nl> + public : <nl> + void feed ( const std : : vector < cv : : Point > & corners , const std : : vector < cv : : Mat > & images , <nl> + const std : : vector < cv : : Mat > & masks ) ; <nl> + void apply ( int index , cv : : Point corner , cv : : Mat & image , const cv : : Mat & mask ) ; <nl> + } ; <nl> + <nl> # endif / / __OPENCV_EXPOSURE_COMPENSATE_HPP__ <nl> \ No newline at end of file <nl> mmm a / modules / stitching / main . cpp <nl> ppp b / modules / stitching / main . cpp <nl> void printUsage ( ) <nl> < < " \ t [ - - wavecorrect ( no | yes ) ] \ n " <nl> < < " \ t [ - - warp ( plane | cylindrical | spherical ) ] \ n " <nl> < < " \ t [ - - exposcomp ( no | overlap ) ] \ n " <nl> - < < " \ t [ - - seam ( no | voronoi | graphcut ) ] \ n " <nl> + < < " \ t [ - - seam ( no | voronoi | gc_color | gc_colorgrad ) ] \ n " <nl> < < " \ t [ - - blend ( no | feather | multiband ) ] \ n " <nl> < < " \ t [ - - numbands < int > ] \ n " <nl> < < " \ t [ - - output < result_img > ] \ n \ n " ; <nl> int warp_type = Warper : : SPHERICAL ; <nl> int expos_comp_type = ExposureCompensator : : OVERLAP ; <nl> bool user_match_conf = false ; <nl> float match_conf = 0 . 6f ; <nl> - int seam_find_type = SeamFinder : : GRAPH_CUT ; <nl> + int seam_find_type = SeamFinder : : GC_COLOR ; <nl> int blend_type = Blender : : MULTI_BAND ; <nl> int numbands = 5 ; <nl> string result_name = " result . png " ; <nl> int parseCmdArgs ( int argc , char * * argv ) <nl> expos_comp_type = ExposureCompensator : : NO ; <nl> else if ( string ( argv [ i + 1 ] ) = = " overlap " ) <nl> expos_comp_type = ExposureCompensator : : OVERLAP ; <nl> + else if ( string ( argv [ i + 1 ] ) = = " segment " ) <nl> + expos_comp_type = ExposureCompensator : : SEGMENT ; <nl> else <nl> { <nl> cout < < " Bad exposure compensation method \ n " ; <nl> int parseCmdArgs ( int argc , char * * argv ) <nl> seam_find_type = SeamFinder : : NO ; <nl> else if ( string ( argv [ i + 1 ] ) = = " voronoi " ) <nl> seam_find_type = SeamFinder : : VORONOI ; <nl> - else if ( string ( argv [ i + 1 ] ) = = " graphcut " ) <nl> - seam_find_type = SeamFinder : : GRAPH_CUT ; <nl> + else if ( string ( argv [ i + 1 ] ) = = " gc_color " ) <nl> + seam_find_type = SeamFinder : : GC_COLOR ; <nl> + else if ( string ( argv [ i + 1 ] ) = = " gc_colorgrad " ) <nl> + seam_find_type = SeamFinder : : GC_COLOR_GRAD ; <nl> else <nl> { <nl> cout < < " Bad seam finding method \ n " ; <nl> mmm a / modules / stitching / matchers . cpp <nl> ppp b / modules / stitching / matchers . cpp <nl> namespace <nl> class CpuSurfFeaturesFinder : public FeaturesFinder <nl> { <nl> public : <nl> - inline CpuSurfFeaturesFinder ( double hess_thresh , int num_octaves , int num_layers , <nl> - int num_octaves_descr , int num_layers_descr ) <nl> + CpuSurfFeaturesFinder ( double hess_thresh , int num_octaves , int num_layers , <nl> + int num_octaves_descr , int num_layers_descr ) <nl> { <nl> detector_ = new SurfFeatureDetector ( hess_thresh , num_octaves , num_layers ) ; <nl> extractor_ = new SurfDescriptorExtractor ( num_octaves_descr , num_layers_descr ) ; <nl> namespace <nl> Ptr < DescriptorExtractor > extractor_ ; <nl> } ; <nl> <nl> - void CpuSurfFeaturesFinder : : find ( const Mat & image , ImageFeatures & features ) <nl> - { <nl> - Mat gray_image ; <nl> - CV_Assert ( image . depth ( ) = = CV_8U ) ; <nl> - cvtColor ( image , gray_image , CV_BGR2GRAY ) ; <nl> - detector_ - > detect ( gray_image , features . keypoints ) ; <nl> - extractor_ - > compute ( gray_image , features . keypoints , features . descriptors ) ; <nl> - } <nl> - <nl> + <nl> class GpuSurfFeaturesFinder : public FeaturesFinder <nl> { <nl> public : <nl> - inline GpuSurfFeaturesFinder ( double hess_thresh , int num_octaves , int num_layers , <nl> - int num_octaves_descr , int num_layers_descr ) <nl> + GpuSurfFeaturesFinder ( double hess_thresh , int num_octaves , int num_layers , <nl> + int num_octaves_descr , int num_layers_descr ) <nl> { <nl> surf_ . keypointsRatio = 0 . 1f ; <nl> surf_ . hessianThreshold = hess_thresh ; <nl> namespace <nl> int num_octaves_descr_ , num_layers_descr_ ; <nl> } ; <nl> <nl> + <nl> + void CpuSurfFeaturesFinder : : find ( const Mat & image , ImageFeatures & features ) <nl> + { <nl> + Mat gray_image ; <nl> + CV_Assert ( image . depth ( ) = = CV_8U ) ; <nl> + cvtColor ( image , gray_image , CV_BGR2GRAY ) ; <nl> + detector_ - > detect ( gray_image , features . keypoints ) ; <nl> + extractor_ - > compute ( gray_image , features . keypoints , features . descriptors ) ; <nl> + } <nl> + <nl> + <nl> void GpuSurfFeaturesFinder : : find ( const Mat & image , ImageFeatures & features ) <nl> { <nl> GpuMat gray_image ; <nl> namespace <nl> <nl> d_descriptors . download ( features . descriptors ) ; <nl> } <nl> - } <nl> + } / / anonymous namespace <nl> + <nl> <nl> SurfFeaturesFinder : : SurfFeaturesFinder ( bool try_use_gpu , double hess_thresh , int num_octaves , int num_layers , <nl> int num_octaves_descr , int num_layers_descr ) <nl> mmm a / modules / stitching / seam_finders . cpp <nl> ppp b / modules / stitching / seam_finders . cpp <nl> Ptr < SeamFinder > SeamFinder : : createDefault ( int type ) <nl> return new NoSeamFinder ( ) ; <nl> if ( type = = VORONOI ) <nl> return new VoronoiSeamFinder ( ) ; <nl> - if ( type = = GRAPH_CUT ) <nl> - return new GraphCutSeamFinder ( ) ; <nl> + if ( type = = GC_COLOR ) <nl> + return new GraphCutSeamFinder ( GraphCutSeamFinder : : COST_COLOR ) ; <nl> + if ( type = = GC_COLOR_GRAD ) <nl> + return new GraphCutSeamFinder ( GraphCutSeamFinder : : COST_COLOR_GRAD ) ; <nl> CV_Error ( CV_StsBadArg , " unsupported seam finding method " ) ; <nl> return NULL ; <nl> } <nl> void PairwiseSeamFinder : : find ( const vector < Mat > & src , const vector < Point > & corne <nl> { <nl> if ( src . size ( ) = = 0 ) <nl> return ; <nl> + <nl> + images_ = src ; <nl> + corners_ = corners ; <nl> + masks_ = masks ; <nl> + <nl> for ( size_t i = 0 ; i < src . size ( ) - 1 ; + + i ) <nl> { <nl> for ( size_t j = i + 1 ; j < src . size ( ) ; + + j ) <nl> { <nl> Rect roi ; <nl> if ( overlapRoi ( corners [ i ] , corners [ j ] , src [ i ] . size ( ) , src [ j ] . size ( ) , roi ) ) <nl> - findInPair ( src [ i ] , src [ j ] , corners [ i ] , corners [ j ] , roi , masks [ i ] , masks [ j ] ) ; <nl> + findInPair ( i , j , roi ) ; <nl> } <nl> } <nl> } <nl> <nl> <nl> - void VoronoiSeamFinder : : findInPair ( const Mat & img1 , const Mat & img2 , Point tl1 , Point tl2 , <nl> - Rect roi , Mat & mask1 , Mat & mask2 ) <nl> + void VoronoiSeamFinder : : findInPair ( size_t first , size_t second , Rect roi ) <nl> { <nl> const int gap = 10 ; <nl> Mat submask1 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_8U ) ; <nl> Mat submask2 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_8U ) ; <nl> <nl> + Mat img1 = images_ [ first ] , img2 = images_ [ second ] ; <nl> + Mat mask1 = masks_ [ first ] , mask2 = masks_ [ second ] ; <nl> + Point tl1 = corners_ [ first ] , tl2 = corners_ [ second ] ; <nl> + <nl> / / Cut submasks with some gap <nl> for ( int y = - gap ; y < roi . height + gap ; + + y ) <nl> { <nl> void VoronoiSeamFinder : : findInPair ( const Mat & img1 , const Mat & img2 , Point tl1 , <nl> } <nl> <nl> <nl> - class GraphCutSeamFinder : : Impl <nl> + class GraphCutSeamFinder : : Impl : public PairwiseSeamFinder <nl> { <nl> public : <nl> Impl ( int cost_type , float terminal_cost , float bad_region_penalty ) <nl> : cost_type_ ( cost_type ) , terminal_cost_ ( terminal_cost ) , bad_region_penalty_ ( bad_region_penalty ) { } <nl> <nl> - void findInPair ( const Mat & img1 , const Mat & img2 , Point tl1 , Point tl2 , <nl> - Rect roi , Mat & mask1 , Mat & mask2 ) ; <nl> + void find ( const vector < Mat > & src , const vector < Point > & corners , vector < Mat > & masks ) ; <nl> + void findInPair ( size_t first , size_t second , Rect roi ) ; <nl> <nl> private : <nl> - void setGraphWeightsColor ( const Mat & img1 , const Mat & img2 , const Mat & mask1 , const Mat & mask2 , <nl> - GCGraph < float > & graph ) ; <nl> + void setGraphWeightsColor ( const Mat & img1 , const Mat & img2 , <nl> + const Mat & mask1 , const Mat & mask2 , GCGraph < float > & graph ) ; <nl> + void setGraphWeightsColorGrad ( const Mat & img1 , const Mat & img2 , const Mat & dx1 , const Mat & dx2 , <nl> + const Mat & dy1 , const Mat & dy2 , const Mat & mask1 , const Mat & mask2 , <nl> + GCGraph < float > & graph ) ; <nl> <nl> + vector < Mat > dx_ , dy_ ; <nl> int cost_type_ ; <nl> float terminal_cost_ ; <nl> float bad_region_penalty_ ; <nl> } ; <nl> <nl> <nl> - void GraphCutSeamFinder : : Impl : : setGraphWeightsColor ( const Mat & img1 , const Mat & img2 , const Mat & mask1 , const Mat & mask2 , <nl> - GCGraph < float > & graph ) <nl> + void GraphCutSeamFinder : : Impl : : find ( const vector < Mat > & src , const vector < Point > & corners , <nl> + vector < Mat > & masks ) <nl> + { <nl> + / / Compute gradients <nl> + dx_ . resize ( src . size ( ) ) ; <nl> + dy_ . resize ( src . size ( ) ) ; <nl> + Mat dx , dy ; <nl> + for ( size_t i = 0 ; i < src . size ( ) ; + + i ) <nl> + { <nl> + CV_Assert ( src [ i ] . channels ( ) = = 3 ) ; <nl> + Sobel ( src [ i ] , dx , CV_32F , 1 , 0 ) ; <nl> + Sobel ( src [ i ] , dy , CV_32F , 0 , 1 ) ; <nl> + dx_ [ i ] . create ( src [ i ] . size ( ) , CV_32F ) ; <nl> + dy_ [ i ] . create ( src [ i ] . size ( ) , CV_32F ) ; <nl> + for ( int y = 0 ; y < src [ i ] . rows ; + + y ) <nl> + { <nl> + const Point3f * dx_row = dx . ptr < Point3f > ( y ) ; <nl> + const Point3f * dy_row = dy . ptr < Point3f > ( y ) ; <nl> + float * dx_row_ = dx_ [ i ] . ptr < float > ( y ) ; <nl> + float * dy_row_ = dy_ [ i ] . ptr < float > ( y ) ; <nl> + for ( int x = 0 ; x < src [ i ] . cols ; + + x ) <nl> + { <nl> + dx_row_ [ x ] = normL2 ( dx_row [ x ] ) ; <nl> + dy_row_ [ x ] = normL2 ( dy_row [ x ] ) ; <nl> + } <nl> + } <nl> + } <nl> + PairwiseSeamFinder : : find ( src , corners , masks ) ; <nl> + } <nl> + <nl> + <nl> + void GraphCutSeamFinder : : Impl : : setGraphWeightsColor ( const Mat & img1 , const Mat & img2 , <nl> + const Mat & mask1 , const Mat & mask2 , GCGraph < float > & graph ) <nl> { <nl> const Size img_size = img1 . size ( ) ; <nl> <nl> void GraphCutSeamFinder : : Impl : : setGraphWeightsColor ( const Mat & img1 , const Mat & <nl> } <nl> } <nl> <nl> - const float weight_eps = 1e - 3f ; <nl> - <nl> / / Set regular edge weights <nl> + const float weight_eps = 1e - 3f ; <nl> for ( int y = 0 ; y < img_size . height ; + + y ) <nl> { <nl> for ( int x = 0 ; x < img_size . width ; + + x ) <nl> void GraphCutSeamFinder : : Impl : : setGraphWeightsColor ( const Mat & img1 , const Mat & <nl> float weight = normL2 ( img1 . at < Point3f > ( y , x ) , img2 . at < Point3f > ( y , x ) ) + <nl> normL2 ( img1 . at < Point3f > ( y , x + 1 ) , img2 . at < Point3f > ( y , x + 1 ) ) + <nl> weight_eps ; <nl> - <nl> if ( ! mask1 . at < uchar > ( y , x ) | | ! mask1 . at < uchar > ( y , x + 1 ) | | <nl> ! mask2 . at < uchar > ( y , x ) | | ! mask2 . at < uchar > ( y , x + 1 ) ) <nl> weight + = bad_region_penalty_ ; <nl> - <nl> graph . addEdges ( v , v + 1 , weight , weight ) ; <nl> } <nl> if ( y < img_size . height - 1 ) <nl> void GraphCutSeamFinder : : Impl : : setGraphWeightsColor ( const Mat & img1 , const Mat & <nl> float weight = normL2 ( img1 . at < Point3f > ( y , x ) , img2 . at < Point3f > ( y , x ) ) + <nl> normL2 ( img1 . at < Point3f > ( y + 1 , x ) , img2 . at < Point3f > ( y + 1 , x ) ) + <nl> weight_eps ; <nl> - <nl> if ( ! mask1 . at < uchar > ( y , x ) | | ! mask1 . at < uchar > ( y + 1 , x ) | | <nl> ! mask2 . at < uchar > ( y , x ) | | ! mask2 . at < uchar > ( y + 1 , x ) ) <nl> weight + = bad_region_penalty_ ; <nl> + graph . addEdges ( v , v + img_size . width , weight , weight ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + void GraphCutSeamFinder : : Impl : : setGraphWeightsColorGrad ( <nl> + const Mat & img1 , const Mat & img2 , const Mat & dx1 , const Mat & dx2 , <nl> + const Mat & dy1 , const Mat & dy2 , const Mat & mask1 , const Mat & mask2 , <nl> + GCGraph < float > & graph ) <nl> + { <nl> + const Size img_size = img1 . size ( ) ; <nl> + <nl> + / / Set terminal weights <nl> + for ( int y = 0 ; y < img_size . height ; + + y ) <nl> + { <nl> + for ( int x = 0 ; x < img_size . width ; + + x ) <nl> + { <nl> + int v = graph . addVtx ( ) ; <nl> + graph . addTermWeights ( v , mask1 . at < uchar > ( y , x ) ? terminal_cost_ : 0 . f , <nl> + mask2 . at < uchar > ( y , x ) ? terminal_cost_ : 0 . f ) ; <nl> + } <nl> + } <nl> <nl> + / / Set regular edge weights <nl> + const float weight_eps = 1e - 3f ; <nl> + for ( int y = 0 ; y < img_size . height ; + + y ) <nl> + { <nl> + for ( int x = 0 ; x < img_size . width ; + + x ) <nl> + { <nl> + int v = y * img_size . width + x ; <nl> + if ( x < img_size . width - 1 ) <nl> + { <nl> + float grad = dx1 . at < float > ( y , x ) + dx1 . at < float > ( y , x + 1 ) + <nl> + dx2 . at < float > ( y , x ) + dx2 . at < float > ( y , x + 1 ) + weight_eps ; <nl> + float weight = ( normL2 ( img1 . at < Point3f > ( y , x ) , img2 . at < Point3f > ( y , x ) ) + <nl> + normL2 ( img1 . at < Point3f > ( y , x + 1 ) , img2 . at < Point3f > ( y , x + 1 ) ) ) / grad + <nl> + weight_eps ; <nl> + if ( ! mask1 . at < uchar > ( y , x ) | | ! mask1 . at < uchar > ( y , x + 1 ) | | <nl> + ! mask2 . at < uchar > ( y , x ) | | ! mask2 . at < uchar > ( y , x + 1 ) ) <nl> + weight + = bad_region_penalty_ ; <nl> + graph . addEdges ( v , v + 1 , weight , weight ) ; <nl> + } <nl> + if ( y < img_size . height - 1 ) <nl> + { <nl> + float grad = dy1 . at < float > ( y , x ) + dy1 . at < float > ( y + 1 , x ) + <nl> + dy2 . at < float > ( y , x ) + dy2 . at < float > ( y + 1 , x ) + weight_eps ; <nl> + float weight = ( normL2 ( img1 . at < Point3f > ( y , x ) , img2 . at < Point3f > ( y , x ) ) + <nl> + normL2 ( img1 . at < Point3f > ( y + 1 , x ) , img2 . at < Point3f > ( y + 1 , x ) ) ) / grad + <nl> + weight_eps ; <nl> + if ( ! mask1 . at < uchar > ( y , x ) | | ! mask1 . at < uchar > ( y + 1 , x ) | | <nl> + ! mask2 . at < uchar > ( y , x ) | | ! mask2 . at < uchar > ( y + 1 , x ) ) <nl> + weight + = bad_region_penalty_ ; <nl> graph . addEdges ( v , v + img_size . width , weight , weight ) ; <nl> } <nl> } <nl> void GraphCutSeamFinder : : Impl : : setGraphWeightsColor ( const Mat & img1 , const Mat & <nl> } <nl> <nl> <nl> - void GraphCutSeamFinder : : Impl : : findInPair ( const Mat & img1 , const Mat & img2 , Point tl1 , Point tl2 , <nl> - Rect roi , Mat & mask1 , Mat & mask2 ) <nl> + void GraphCutSeamFinder : : Impl : : findInPair ( size_t first , size_t second , Rect roi ) <nl> { <nl> - const int gap = 10 ; <nl> + Mat img1 = images_ [ first ] , img2 = images_ [ second ] ; <nl> + Mat dx1 = dx_ [ first ] , dx2 = dx_ [ second ] ; <nl> + Mat dy1 = dy_ [ first ] , dy2 = dy_ [ second ] ; <nl> + Mat mask1 = masks_ [ first ] , mask2 = masks_ [ second ] ; <nl> + Point tl1 = corners_ [ first ] , tl2 = corners_ [ second ] ; <nl> <nl> + const int gap = 10 ; <nl> Mat subimg1 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_32FC3 ) ; <nl> Mat subimg2 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_32FC3 ) ; <nl> Mat submask1 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_8U ) ; <nl> Mat submask2 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_8U ) ; <nl> + Mat subdx1 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_32F ) ; <nl> + Mat subdy1 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_32F ) ; <nl> + Mat subdx2 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_32F ) ; <nl> + Mat subdy2 ( roi . height + 2 * gap , roi . width + 2 * gap , CV_32F ) ; <nl> <nl> / / Cut subimages and submasks with some gap <nl> for ( int y = - gap ; y < roi . height + gap ; + + y ) <nl> void GraphCutSeamFinder : : Impl : : findInPair ( const Mat & img1 , const Mat & img2 , Poin <nl> { <nl> subimg1 . at < Point3f > ( y + gap , x + gap ) = img1 . at < Point3f > ( y1 , x1 ) ; <nl> submask1 . at < uchar > ( y + gap , x + gap ) = mask1 . at < uchar > ( y1 , x1 ) ; <nl> + subdx1 . at < float > ( y + gap , x + gap ) = dx1 . at < float > ( y1 , x1 ) ; <nl> + subdy1 . at < float > ( y + gap , x + gap ) = dy1 . at < float > ( y1 , x1 ) ; <nl> } <nl> else <nl> { <nl> subimg1 . at < Point3f > ( y + gap , x + gap ) = Point3f ( 0 , 0 , 0 ) ; <nl> submask1 . at < uchar > ( y + gap , x + gap ) = 0 ; <nl> + subdx1 . at < float > ( y + gap , x + gap ) = 0 . f ; <nl> + subdy1 . at < float > ( y + gap , x + gap ) = 0 . f ; <nl> } <nl> <nl> int y2 = roi . y - tl2 . y + y ; <nl> void GraphCutSeamFinder : : Impl : : findInPair ( const Mat & img1 , const Mat & img2 , Poin <nl> { <nl> subimg2 . at < Point3f > ( y + gap , x + gap ) = img2 . at < Point3f > ( y2 , x2 ) ; <nl> submask2 . at < uchar > ( y + gap , x + gap ) = mask2 . at < uchar > ( y2 , x2 ) ; <nl> + subdx2 . at < float > ( y + gap , x + gap ) = dx2 . at < float > ( y2 , x2 ) ; <nl> + subdy2 . at < float > ( y + gap , x + gap ) = dy2 . at < float > ( y2 , x2 ) ; <nl> } <nl> else <nl> { <nl> subimg2 . at < Point3f > ( y + gap , x + gap ) = Point3f ( 0 , 0 , 0 ) ; <nl> submask2 . at < uchar > ( y + gap , x + gap ) = 0 ; <nl> + subdx2 . at < float > ( y + gap , x + gap ) = 0 . f ; <nl> + subdy2 . at < float > ( y + gap , x + gap ) = 0 . f ; <nl> } <nl> } <nl> } <nl> void GraphCutSeamFinder : : Impl : : findInPair ( const Mat & img1 , const Mat & img2 , Poin <nl> case GraphCutSeamFinder : : COST_COLOR : <nl> setGraphWeightsColor ( subimg1 , subimg2 , submask1 , submask2 , graph ) ; <nl> break ; <nl> + case GraphCutSeamFinder : : COST_COLOR_GRAD : <nl> + setGraphWeightsColorGrad ( subimg1 , subimg2 , subdx1 , subdx2 , subdy1 , subdy2 , <nl> + submask1 , submask2 , graph ) ; <nl> + break ; <nl> default : <nl> CV_Error ( CV_StsBadArg , " unsupported pixel similarity measure " ) ; <nl> } <nl> GraphCutSeamFinder : : GraphCutSeamFinder ( int cost_type , float terminal_cost , float <nl> : impl_ ( new Impl ( cost_type , terminal_cost , bad_region_penalty ) ) { } <nl> <nl> <nl> - void GraphCutSeamFinder : : findInPair ( const Mat & img1 , const Mat & img2 , Point tl1 , Point tl2 , <nl> - Rect roi , Mat & mask1 , Mat & mask2 ) <nl> + void GraphCutSeamFinder : : find ( const vector < Mat > & src , const vector < Point > & corners , <nl> + vector < Mat > & masks ) <nl> { <nl> - impl_ - > findInPair ( img1 , img2 , tl1 , tl2 , roi , mask1 , mask2 ) ; <nl> + impl_ - > find ( src , corners , masks ) ; <nl> } <nl> mmm a / modules / stitching / seam_finders . hpp <nl> ppp b / modules / stitching / seam_finders . hpp <nl> <nl> class SeamFinder <nl> { <nl> public : <nl> - enum { NO , VORONOI , GRAPH_CUT } ; <nl> + enum { NO , VORONOI , GC_COLOR , GC_COLOR_GRAD } ; <nl> static cv : : Ptr < SeamFinder > createDefault ( int type ) ; <nl> <nl> virtual ~ SeamFinder ( ) { } <nl> class NoSeamFinder : public SeamFinder <nl> class PairwiseSeamFinder : public SeamFinder <nl> { <nl> public : <nl> - void find ( const std : : vector < cv : : Mat > & src , const std : : vector < cv : : Point > & corners , <nl> - std : : vector < cv : : Mat > & masks ) ; <nl> + virtual void find ( const std : : vector < cv : : Mat > & src , const std : : vector < cv : : Point > & corners , <nl> + std : : vector < cv : : Mat > & masks ) ; <nl> + <nl> protected : <nl> - virtual void findInPair ( const cv : : Mat & img1 , const cv : : Mat & img2 , cv : : Point tl1 , cv : : Point tl2 , <nl> - cv : : Rect roi , cv : : Mat & mask1 , cv : : Mat & mask2 ) = 0 ; <nl> + virtual void findInPair ( size_t first , size_t second , cv : : Rect roi ) = 0 ; <nl> + <nl> + std : : vector < cv : : Mat > images_ ; <nl> + std : : vector < cv : : Point > corners_ ; <nl> + std : : vector < cv : : Mat > masks_ ; <nl> } ; <nl> <nl> <nl> class VoronoiSeamFinder : public PairwiseSeamFinder <nl> { <nl> private : <nl> - void findInPair ( const cv : : Mat & img1 , const cv : : Mat & img2 , cv : : Point tl1 , cv : : Point tl2 , <nl> - cv : : Rect roi , cv : : Mat & mask1 , cv : : Mat & mask2 ) ; <nl> + void findInPair ( size_t first , size_t second , cv : : Rect roi ) ; <nl> } ; <nl> <nl> <nl> - class GraphCutSeamFinder : public PairwiseSeamFinder <nl> + class GraphCutSeamFinder : public SeamFinder <nl> { <nl> public : <nl> - / / TODO add COST_COLOR_GRAD support <nl> - enum { COST_COLOR } ; <nl> - GraphCutSeamFinder ( int cost_type = COST_COLOR , float terminal_cost = 10000 . f , <nl> + enum { COST_COLOR , COST_COLOR_GRAD } ; <nl> + GraphCutSeamFinder ( int cost_type = COST_COLOR_GRAD , float terminal_cost = 10000 . f , <nl> float bad_region_penalty = 1000 . f ) ; <nl> <nl> - private : <nl> - void findInPair ( const cv : : Mat & img1 , const cv : : Mat & img2 , cv : : Point tl1 , cv : : Point tl2 , <nl> - cv : : Rect roi , cv : : Mat & mask1 , cv : : Mat & mask2 ) ; <nl> + void find ( const std : : vector < cv : : Mat > & src , const std : : vector < cv : : Point > & corners , <nl> + std : : vector < cv : : Mat > & masks ) ; <nl> <nl> + private : <nl> class Impl ; <nl> cv : : Ptr < Impl > impl_ ; <nl> } ; <nl> mmm a / modules / stitching / util_inl . hpp <nl> ppp b / modules / stitching / util_inl . hpp <nl> B Graph : : walkBreadthFirst ( int from , B body ) const <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / Some auxiliary math functions <nl> <nl> + static inline <nl> + float normL2 ( const cv : : Point3f & a ) <nl> + { <nl> + return a . x * a . x + a . y * a . y + a . z * a . z ; <nl> + } <nl> + <nl> + <nl> static inline <nl> float normL2 ( const cv : : Point3f & a , const cv : : Point3f & b ) <nl> { <nl> - return ( a . x - b . x ) * ( a . x - b . x ) + ( a . y - b . y ) * ( a . y - b . y ) + ( a . z - b . z ) * ( a . z - b . z ) ; <nl> + return normL2 ( a - b ) ; <nl> } <nl> <nl> <nl>
added GC_COLOR_GRAD cost function type into opencv_stitching
opencv/opencv
56f7e54cce7aa0bc6e94b1cab56ffd9d95d606b0
2011-05-27T11:41:35Z
mmm a / db / dbcommands . cpp <nl> ppp b / db / dbcommands . cpp <nl> namespace mongo { <nl> class GodInsert : public Command { <nl> public : <nl> GodInsert ( ) : Command ( " godinsert " ) { } <nl> - virtual bool adminOnly ( ) const { return true ; } <nl> + virtual bool adminOnly ( ) const { return false ; } <nl> virtual bool logTheOp ( ) { return false ; } <nl> virtual bool slaveOk ( ) const { return true ; } <nl> virtual LockType locktype ( ) const { return NONE ; } <nl> namespace mongo { <nl> help < < " internal . for testing only . " ; <nl> } <nl> virtual bool run ( const string & dbname , BSONObj & cmdObj , int , string & errmsg , BSONObjBuilder & result , bool ) { <nl> + <nl> + AuthenticationInfo * ai = cc ( ) . getAuthenticationInfo ( ) ; <nl> + if ( ! ai - > isLocalHost ) { <nl> + errmsg = " godinsert only works locally " ; <nl> + return false ; <nl> + } <nl> + <nl> string coll = cmdObj [ " godinsert " ] . valuestrsafe ( ) ; <nl> log ( ) < < " test only command godinsert invoked coll : " < < coll < < endl ; <nl> uassert ( 13049 , " godinsert must specify a collection " , ! coll . empty ( ) ) ; <nl>
godinsert can ' t be admin only since it operates on a given db
mongodb/mongo
16d6cd06425e2adedff330ace6fc7f9bb8894708
2011-10-26T07:41:54Z
mmm a / ports / freetype / 0002 - Add - CONFIG_INSTALL_PATH - option . patch <nl> ppp b / ports / freetype / 0002 - Add - CONFIG_INSTALL_PATH - option . patch <nl> <nl> - + mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> - option ( FT_WITH_BZIP2 " Support bzip2 compressed fonts . " OFF ) <nl> + option ( FT_WITH_BZIP2 " Support bzip2 compressed fonts . " OFF ) <nl> option ( FT_WITH_PNG " Support PNG compressed OpenType embedded bitmaps . " OFF ) <nl> option ( FT_WITH_HARFBUZZ " Improve auto - hinting of OpenType fonts . " OFF ) <nl> <nl> + # vcpkg config install path <nl> + option ( CONFIG_INSTALL_PATH " location to install cmake config files " lib / cmake / freetype ) <nl> - + <nl> <nl> # Disallow in - source builds <nl> - if ( " $ { PROJECT_BINARY_DIR } " STREQUAL " $ { PROJECT_SOURCE_DIR } " ) <nl> - if ( NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) <nl> + if ( " $ { CMAKE_BINARY_DIR } " STREQUAL " $ { CMAKE_SOURCE_DIR } " ) <nl> + if ( NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) <nl> COMPONENT libraries ) <nl> install ( <nl> EXPORT freetype - targets <nl> - DESTINATION $ { CMAKE_INSTALL_LIBDIR } / cmake / freetype <nl> - + DESTINATION $ { CONFIG_INSTALL_PATH } <nl> + + DESTINATION $ { CONFIG_INSTALL_PATH } <nl> FILE freetype - config . cmake <nl> COMPONENT headers ) <nl> endif ( ) <nl> mmm a / ports / freetype / 0003 - Fix - UWP . patch <nl> ppp b / ports / freetype / 0003 - Fix - UWP . patch <nl> <nl> - + mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> - else ( ) <nl> + else ( ) <nl> list ( APPEND BASE_SRCS src / base / ftdebug . c ) <nl> endif ( ) <nl> <nl> list ( APPEND BASE_SRCS builds / mac / freetype - Info . plist ) <nl> endif ( ) <nl> - + mmm a / include / freetype / freetype . h <nl> ppp b / include / freetype / freetype . h <nl> - FT_BEGIN_HEADER <nl> - / * Especially for TrueType fonts see also the documentation for * / <nl> - / * @ FT_Size_Metrics . * / <nl> - / * * / <nl> - + <nl> + FT_BEGIN_HEADER <nl> + * Especially for TrueType fonts see also the documentation for <nl> + * @ FT_Size_Metrics . <nl> + * / <nl> + + <nl> + # if defined ( WINAPI_FAMILY ) & & ( WINAPI_FAMILY ! = WINAPI_FAMILY_DESKTOP_APP ) <nl> + # define generic GenericFromFreeTypeLibrary <nl> + # endif <nl> typedef struct FT_FaceRec_ <nl> { <nl> FT_Long num_faces ; <nl> - FT_BEGIN_HEADER <nl> + FT_BEGIN_HEADER <nl> <nl> } FT_GlyphSlotRec ; <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - + mmm a / src / base / ftobjs . c <nl> ppp b / src / base / ftobjs . c <nl> - <nl> + <nl> return error ; <nl> } <nl> <nl> + # if defined ( WINAPI_FAMILY ) & & ( WINAPI_FAMILY ! = WINAPI_FAMILY_DESKTOP_APP ) <nl> + # define generic GenericFromFreeTypeLibrary <nl> + # endif <nl> - + <nl> <nl> static void <nl> ft_glyphslot_clear ( FT_GlyphSlot slot ) <nl> - <nl> + <nl> FT_FREE ( face ) ; <nl> } <nl> <nl> + # if defined ( WINAPI_FAMILY ) & & ( WINAPI_FAMILY ! = WINAPI_FAMILY_DESKTOP_APP ) <nl> + # undef generic <nl> + # endif <nl> - + <nl> <nl> static void <nl> Destroy_Driver ( FT_Driver driver ) <nl> deleted file mode 100644 <nl> index 8d70b993f0c . . 00000000000 <nl> mmm a / ports / freetype / 0004 - Fix - DLL - install . patch <nl> ppp / dev / null <nl> <nl> - diff - - git a / CMakeLists . txt b / CMakeLists . txt <nl> - index fe9bc65 . . dd8a878 100644 <nl> mmm - a / CMakeLists . txt <nl> - ppp b / CMakeLists . txt <nl> - if ( NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) <nl> - EXPORT freetype - targets <nl> - LIBRARY DESTINATION $ { CMAKE_INSTALL_LIBDIR } <nl> - ARCHIVE DESTINATION $ { CMAKE_INSTALL_LIBDIR } <nl> - + # DLL is RUNTIME <nl> - + RUNTIME DESTINATION $ { CMAKE_INSTALL_BINDIR } <nl> - FRAMEWORK DESTINATION Library / Frameworks <nl> - COMPONENT libraries ) <nl> - install ( <nl> mmm a / ports / freetype / CONTROL <nl> ppp b / ports / freetype / CONTROL <nl> <nl> Source : freetype <nl> - Version : 2 . 9 . 1 - 2 <nl> + Version : 2 . 10 . 0 <nl> Build - Depends : zlib , bzip2 , libpng <nl> Homepage : https : / / www . freetype . org / <nl> Description : A library to render fonts . <nl> mmm a / ports / freetype / portfile . cmake <nl> ppp b / ports / freetype / portfile . cmake <nl> <nl> include ( vcpkg_common_functions ) <nl> <nl> - set ( FT_VERSION 2 . 9 . 1 ) <nl> + set ( FT_VERSION 2 . 10 . 0 ) <nl> vcpkg_download_distfile ( ARCHIVE <nl> URLS " https : / / download - mirror . savannah . gnu . org / releases / freetype / freetype - $ { FT_VERSION } . tar . bz2 " " https : / / downloads . sourceforge . net / project / freetype / freetype2 / $ { FT_VERSION } / freetype - $ { FT_VERSION } . tar . bz2 " <nl> FILENAME " freetype - $ { FT_VERSION } . tar . bz2 " <nl> - SHA512 856766e1f3f4c7dc8afb2b5ee991138c8b642c6a6e5e007cd2bc04ae58bde827f082557cf41bf541d97e8485f7fd064d10390d1ee597f19d1daed6c152e27708 <nl> + SHA512 dfad66f419ea9577f09932e0730c0c887bdcbdbc8152fa7477a0c39d69a5b68476761deed6864ddcc5cf18d100a7a3f728049768e24afcb04b1a74b25b6acf7e <nl> ) <nl> <nl> if ( NOT $ { VCPKG_LIBRARY_LINKAGE } STREQUAL " dynamic " ) <nl> if ( NOT $ { VCPKG_LIBRARY_LINKAGE } STREQUAL " dynamic " ) <nl> 0001 - Fix - install - command . patch <nl> 0002 - Add - CONFIG_INSTALL_PATH - option . patch <nl> 0003 - Fix - UWP . patch <nl> - 0004 - Fix - DLL - install . patch <nl> ) <nl> else ( ) <nl> vcpkg_extract_source_archive_ex ( <nl> else ( ) <nl> 0001 - Fix - install - command . patch <nl> 0002 - Add - CONFIG_INSTALL_PATH - option . patch <nl> 0003 - Fix - UWP . patch <nl> - 0004 - Fix - DLL - install . patch <nl> 0005 - Fix - DLL - EXPORTS . patch <nl> ) <nl> endif ( ) <nl>
[ freetype ] Upgrade to version 2 . 10 . 0 ( )
microsoft/vcpkg
700a3e180c88c5fbd2ded05c25e8683278a2d33b
2019-06-30T09:49:11Z
mmm a / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 93392c1af5c5febbccf50b269d46c2e092f4a34e <nl> + Subproject commit 8fdcdbbfffaab4194d85d4ae5d28e1479b04be78 <nl> mmm a / build / deps / github_hashes / facebook / wangle - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / wangle - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 2ee51dd0969476bc43f294db26d5e0f360dd19e5 <nl> + Subproject commit 676f71d0269628decacc297c748b08b311a8ce07 <nl>
Updating submodules
facebook/watchman
2adb4f0fba9ea1f4838e59948c48f18dc116316e
2020-03-10T00:59:15Z
mmm a / src / frames . cc <nl> ppp b / src / frames . cc <nl> bool JavaScriptFrame : : HasInlinedFrames ( ) const { <nl> } <nl> <nl> <nl> - int JavaScriptFrame : : GetArgumentsLength ( ) const { <nl> - / / If there is an arguments adaptor frame get the arguments length from it . <nl> - if ( has_adapted_arguments ( ) ) { <nl> - return ArgumentsAdaptorFrame : : GetLength ( caller_fp ( ) ) ; <nl> - } else { <nl> - return GetNumberOfIncomingArguments ( ) ; <nl> - } <nl> - } <nl> - <nl> - <nl> Code * JavaScriptFrame : : unchecked_code ( ) const { <nl> return function ( ) - > code ( ) ; <nl> } <nl> int ArgumentsAdaptorFrame : : GetNumberOfIncomingArguments ( ) const { <nl> return Smi : : ToInt ( GetExpression ( 0 ) ) ; <nl> } <nl> <nl> - int ArgumentsAdaptorFrame : : GetLength ( Address fp ) { <nl> - const int offset = ArgumentsAdaptorFrameConstants : : kLengthOffset ; <nl> - return Smi : : ToInt ( Memory : : Object_at ( fp + offset ) ) ; <nl> - } <nl> - <nl> Code * ArgumentsAdaptorFrame : : unchecked_code ( ) const { <nl> return isolate ( ) - > builtins ( ) - > builtin ( <nl> Builtins : : kArgumentsAdaptorTrampoline ) ; <nl> mmm a / src / frames . h <nl> ppp b / src / frames . h <nl> class JavaScriptFrame : public StandardFrame { <nl> / / actual passed arguments are available in an arguments adaptor <nl> / / frame below it on the stack . <nl> inline bool has_adapted_arguments ( ) const ; <nl> - int GetArgumentsLength ( ) const ; <nl> <nl> / / Garbage collection support . <nl> void Iterate ( RootVisitor * v ) const override ; <nl> class ArgumentsAdaptorFrame : public JavaScriptFrame { <nl> void Print ( StringStream * accumulator , PrintMode mode , <nl> int index ) const override ; <nl> <nl> - static int GetLength ( Address fp ) ; <nl> - <nl> protected : <nl> inline explicit ArgumentsAdaptorFrame ( StackFrameIteratorBase * iterator ) ; <nl> <nl> mmm a / src / runtime / runtime - scopes . cc <nl> ppp b / src / runtime / runtime - scopes . cc <nl> RUNTIME_FUNCTION ( Runtime_NewSloppyArguments ) { <nl> iterator . Advance ( ) ; <nl> JavaScriptFrame * function_frame = JavaScriptFrame : : cast ( iterator . frame ( ) ) ; <nl> DCHECK ( function_frame - > is_java_script ( ) ) ; <nl> - int argc = function_frame - > GetArgumentsLength ( ) ; <nl> + int argc = function_frame - > ComputeParametersCount ( ) ; <nl> Address fp = function_frame - > fp ( ) ; <nl> if ( function_frame - > has_adapted_arguments ( ) ) { <nl> iterator . Advance ( ) ; <nl> - fp = iterator . frame ( ) - > fp ( ) ; <nl> + ArgumentsAdaptorFrame * adaptor_frame = <nl> + ArgumentsAdaptorFrame : : cast ( iterator . frame ( ) ) ; <nl> + argc = adaptor_frame - > ComputeParametersCount ( ) ; <nl> + fp = adaptor_frame - > fp ( ) ; <nl> } <nl> <nl> Object * * parameters = reinterpret_cast < Object * * > ( <nl>
Remove obsolete { JavaScriptFrame : : GetArgumentsLength } .
v8/v8
f55286c6cd88dbc6544497fa34ce388280135d07
2017-11-29T11:56:46Z
mmm a / contrib / devtools / check - doc . py <nl> ppp b / contrib / devtools / check - doc . py <nl> <nl> REGEX_ARG = re . compile ( r ' ( ? : map ( ? : Multi ) ? Args ( ? : \ . count \ ( | \ [ ) | Get ( ? : Bool ) ? Arg \ ( ) \ " ( \ - [ ^ \ " ] + ? ) \ " ' ) <nl> REGEX_DOC = re . compile ( r ' HelpMessageOpt \ ( \ " ( \ - [ ^ \ " = ] + ? ) ( ? : = | \ " ) ' ) <nl> # list unsupported , deprecated and duplicate args as they need no documentation <nl> - SET_DOC_OPTIONAL = set ( [ ' - rpcssl ' , ' - benchmark ' , ' - h ' , ' - help ' , ' - socks ' , ' - tor ' , ' - debugnet ' , ' - whitelistalwaysrelay ' , ' - prematurewitness ' , ' - walletprematurewitness ' , ' - promiscuousmempoolflags ' , ' - blockminsize ' ] ) <nl> + SET_DOC_OPTIONAL = set ( [ ' - rpcssl ' , ' - benchmark ' , ' - h ' , ' - help ' , ' - socks ' , ' - tor ' , ' - debugnet ' , ' - whitelistalwaysrelay ' , ' - prematurewitness ' , ' - walletprematurewitness ' , ' - promiscuousmempoolflags ' , ' - blockminsize ' , ' - dbcrashratio ' ] ) <nl> <nl> def main ( ) : <nl> used = check_output ( CMD_GREP_ARGS , shell = True ) <nl> mmm a / src / txdb . cpp <nl> ppp b / src / txdb . cpp <nl> <nl> <nl> # include " chainparams . h " <nl> # include " hash . h " <nl> + # include " random . h " <nl> # include " pow . h " <nl> # include " uint256 . h " <nl> + # include " util . h " <nl> <nl> # include < stdint . h > <nl> <nl> bool CCoinsViewDB : : BatchWrite ( CCoinsMap & mapCoins , const uint256 & hashBlock ) { <nl> size_t count = 0 ; <nl> size_t changed = 0 ; <nl> size_t batch_size = ( size_t ) GetArg ( " - dbbatchsize " , nDefaultDbBatchSize ) ; <nl> - <nl> + int crash_simulate = GetArg ( " - dbcrashratio " , 0 ) ; <nl> <nl> uint256 old_tip = GetBestBlock ( ) ; <nl> if ( old_tip . IsNull ( ) ) { <nl> bool CCoinsViewDB : : BatchWrite ( CCoinsMap & mapCoins , const uint256 & hashBlock ) { <nl> LogPrint ( BCLog : : COINDB , " Writing partial batch of % . 2f MiB \ n " , batch . SizeEstimate ( ) * ( 1 . 0 / 1048576 . 0 ) ) ; <nl> db . WriteBatch ( batch ) ; <nl> batch . Clear ( ) ; <nl> + if ( crash_simulate ) { <nl> + static FastRandomContext rng ; <nl> + if ( rng . randrange ( crash_simulate ) = = 0 ) { <nl> + LogPrintf ( " Simulating a crash . Goodbye . \ n " ) ; <nl> + exit ( 0 ) ; <nl> + } <nl> + } <nl> } <nl> } <nl> <nl>
Random db flush crash simulator
bitcoin/bitcoin
eaca1b7b08b4911292d49efbce8471cbc9ca0e1c
2017-06-26T17:46:51Z
mmm a / include / swift / SIL / SILBasicBlock . h <nl> ppp b / include / swift / SIL / SILBasicBlock . h <nl> public llvm : : ilist_node < SILBasicBlock > , public SILAllocated < SILBasicBlock > { <nl> / / / This method unlinks ' self ' from the containing SILFunction and deletes it . <nl> void eraseFromParent ( ) ; <nl> <nl> - / / / This method unlinks ' self ' from the containing SILFunction . <nl> - void removeFromParent ( ) ; <nl> - <nl> / / / Returns true if this BB is the entry BB of its parent . <nl> bool isEntry ( ) const ; <nl> <nl> mmm a / lib / SIL / SILBasicBlock . cpp <nl> ppp b / lib / SIL / SILBasicBlock . cpp <nl> void SILBasicBlock : : eraseFromParent ( ) { <nl> getParent ( ) - > getBlocks ( ) . erase ( this ) ; <nl> } <nl> <nl> - / / / This method unlinks ' self ' from the containing SILFunction . <nl> - void SILBasicBlock : : removeFromParent ( ) { <nl> - getParent ( ) - > getBlocks ( ) . remove ( this ) ; <nl> - } <nl> - <nl> - <nl> / / / Replace the ith BB argument with a new one with type Ty ( and optional <nl> / / / ValueDecl D ) . <nl> SILArgument * SILBasicBlock : : replaceBBArg ( unsigned i , SILType Ty , <nl>
SIL : remove unused function removeFromParent from SILBasicBlock .
apple/swift
f2036fc836fdf01959277365a0d10ade28f82c2e
2016-04-06T21:55:47Z
mmm a / folly / futures / Future - inl . h <nl> ppp b / folly / futures / Future - inl . h <nl> Future < T > Future < T > : : thenError ( F & & func ) & & { <nl> / / Forward to onError but ensure that returned future carries the executor <nl> / / Allow for applying to future with null executor while this is still <nl> / / possible . <nl> - auto * e = this - > getExecutor ( ) ; <nl> + auto * ePtr = this - > getExecutor ( ) ; <nl> + auto e = folly : : getKeepAliveToken ( ePtr ? * ePtr : InlineExecutor : : instance ( ) ) ; <nl> return std : : move ( * this ) <nl> . onError ( [ func = std : : forward < F > ( func ) ] ( ExceptionType & ex ) mutable { <nl> return std : : forward < F > ( func ) ( ex ) ; <nl> } ) <nl> - . via ( e ? e : & InlineExecutor : : instance ( ) ) ; <nl> + . via ( std : : move ( e ) ) ; <nl> } <nl> <nl> template < class T > <nl> Future < T > Future < T > : : thenError ( F & & func ) & & { <nl> / / Forward to onError but ensure that returned future carries the executor <nl> / / Allow for applying to future with null executor while this is still <nl> / / possible . <nl> - auto * e = this - > getExecutor ( ) ; <nl> + auto * ePtr = this - > getExecutor ( ) ; <nl> + auto e = folly : : getKeepAliveToken ( ePtr ? * ePtr : InlineExecutor : : instance ( ) ) ; <nl> return std : : move ( * this ) <nl> . onError ( [ func = std : : forward < F > ( func ) ] ( <nl> folly : : exception_wrapper & & ex ) mutable { <nl> return std : : forward < F > ( func ) ( std : : move ( ex ) ) ; <nl> } ) <nl> - . via ( e ? e : & InlineExecutor : : instance ( ) ) ; <nl> + . via ( std : : move ( e ) ) ; <nl> } <nl> <nl> template < class T > <nl>
Fix Executor : : KeepAlive use in thenError
facebook/folly
0895c3afd00586e409626a10f17ce94f07a135e8
2018-11-29T07:16:40Z
mmm a / tensorflow / contrib / bayesflow / BUILD <nl> ppp b / tensorflow / contrib / bayesflow / BUILD <nl> cuda_py_test ( <nl> " / / tensorflow / python : platform_test " , <nl> " / / tensorflow / python : random_seed " , <nl> ] , <nl> + tags = [ " notsan " ] , <nl> ) <nl> <nl> cuda_py_test ( <nl>
Internal change .
tensorflow/tensorflow
31edddcc025b95fd6fec419d4372d3f3a4f89af8
2018-02-02T01:34:25Z
mmm a / dbms / src / TableFunctions / TableFunctionRemote . cpp <nl> ppp b / dbms / src / TableFunctions / TableFunctionRemote . cpp <nl> StoragePtr TableFunctionRemote : : execute ( const ASTPtr & ast_function , const Conte <nl> { <nl> ASTs & args_func = typeid_cast < ASTFunction & > ( * ast_function ) . children ; <nl> <nl> - const size_t max_args = is_cluster_function ? 3 : 5 ; <nl> - <nl> if ( args_func . size ( ) ! = 1 ) <nl> throw Exception ( help_message , ErrorCodes : : NUMBER_OF_ARGUMENTS_DOESNT_MATCH ) ; <nl> <nl> ASTs & args = typeid_cast < ASTExpressionList & > ( * args_func . at ( 0 ) ) . children ; <nl> <nl> + const size_t max_args = is_cluster_function ? 3 : 5 ; <nl> if ( args . size ( ) < 2 | | args . size ( ) > max_args ) <nl> throw Exception ( help_message , ErrorCodes : : NUMBER_OF_ARGUMENTS_DOESNT_MATCH ) ; <nl> <nl> StoragePtr TableFunctionRemote : : execute ( const ASTPtr & ast_function , const Conte <nl> if ( ASTIdentifier * id = typeid_cast < ASTIdentifier * > ( arg . get ( ) ) ) <nl> id - > kind = ASTIdentifier : : Table ; <nl> <nl> - size_t max_addresses = context . getSettingsRef ( ) . table_function_remote_max_addresses ; <nl> - <nl> ClusterPtr cluster ; <nl> if ( ! cluster_name . empty ( ) ) <nl> { <nl> StoragePtr TableFunctionRemote : : execute ( const ASTPtr & ast_function , const Conte <nl> else <nl> { <nl> / / / Create new cluster from the scratch <nl> + size_t max_addresses = context . getSettingsRef ( ) . table_function_remote_max_addresses ; <nl> std : : vector < String > shards = parseDescription ( cluster_description , 0 , cluster_description . size ( ) , ' , ' , max_addresses ) ; <nl> <nl> std : : vector < std : : vector < String > > names ; <nl>
Addition to prev revision . [ # CLICKHOUSE - 2 ]
ClickHouse/ClickHouse
ac0d1f8fbae8a71164259c743414a8e1cb78eb80
2018-02-12T20:44:59Z
mmm a / test / cctest / test - ordered - hash - table . cc <nl> ppp b / test / cctest / test - ordered - hash - table . cc <nl> void CheckIterResultObject ( Isolate * isolate , <nl> Handle < JSObject > result , <nl> Handle < Object > value , <nl> bool done ) { <nl> - CHECK ( Object : : GetProperty ( isolate , result , " value " ) . ToHandleChecked ( ) <nl> - - > SameValue ( * value ) ) ; <nl> - CHECK ( Object : : GetProperty ( isolate , result , " done " ) . ToHandleChecked ( ) <nl> - - > IsBoolean ( ) ) ; <nl> - CHECK_EQ ( Object : : GetProperty ( isolate , result , " done " ) . ToHandleChecked ( ) <nl> - - > BooleanValue ( ) , done ) ; <nl> + Handle < Object > value_object = <nl> + Object : : GetProperty ( isolate , result , " value " ) . ToHandleChecked ( ) ; <nl> + Handle < Object > done_object = <nl> + Object : : GetProperty ( isolate , result , " done " ) . ToHandleChecked ( ) ; <nl> + <nl> + CHECK_EQ ( * value_object , * value ) ; <nl> + CHECK ( done_object - > IsBoolean ( ) ) ; <nl> + CHECK_EQ ( done_object - > BooleanValue ( ) , done ) ; <nl> } <nl> <nl> <nl>
Fix breakage on V8 Linux - nosse2
v8/v8
1572115483d248c692caf94a3a5511cf7b7abe4e
2014-04-17T19:39:48Z
mmm a / THDiskFile . c <nl> ppp b / THDiskFile . c <nl> static size_t THDiskFile_readLong ( THFile * self , long * data , size_t n ) <nl> nread = fread__ ( data , 4 , n , dfself - > handle ) ; <nl> if ( ! dfself - > isNativeEncoding & & ( nread > 0 ) ) <nl> THDiskFile_reverseMemory ( data , data , 4 , nread ) ; <nl> - for ( size_t i = nread ; i > 0 ; i - - ) <nl> + size_t i ; <nl> + for ( i = nread ; i > 0 ; i - - ) <nl> data [ i - 1 ] = ( ( int * ) data ) [ i - 1 ] ; <nl> } <nl> else / * if ( dfself - > longSize = = 8 ) * / <nl> static size_t THDiskFile_readLong ( THFile * self , long * data , size_t n ) <nl> int big_endian = ! THDiskFile_isLittleEndianCPU ( ) ; <nl> int32_t * buffer = THAlloc ( 8 * n ) ; <nl> nread = fread__ ( buffer , 8 , n , dfself - > handle ) ; <nl> - for ( size_t i = nread ; i > 0 ; i - - ) <nl> + size_t i ; <nl> + for ( i = nread ; i > 0 ; i - - ) <nl> data [ i - 1 ] = buffer [ 2 * ( i - 1 ) + big_endian ] ; <nl> THFree ( buffer ) ; <nl> if ( ! dfself - > isNativeEncoding & & ( nread > 0 ) ) <nl> static size_t THDiskFile_writeLong ( THFile * self , long * data , size_t n ) <nl> } else if ( dfself - > longSize = = 4 ) <nl> { <nl> int32_t * buffer = THAlloc ( 4 * n ) ; <nl> - for ( size_t i = 0 ; i < n ; i + + ) <nl> + size_t i ; <nl> + for ( i = 0 ; i < n ; i + + ) <nl> buffer [ i ] = data [ i ] ; <nl> if ( ! dfself - > isNativeEncoding ) <nl> THDiskFile_reverseMemory ( buffer , buffer , 4 , n ) ; <nl> static size_t THDiskFile_writeLong ( THFile * self , long * data , size_t n ) <nl> { <nl> int big_endian = ! THDiskFile_isLittleEndianCPU ( ) ; <nl> int32_t * buffer = THAlloc ( 8 * n ) ; <nl> - for ( size_t i = 0 ; i < n ; i + + ) <nl> + size_t i ; <nl> + for ( i = 0 ; i < n ; i + + ) <nl> { <nl> buffer [ 2 * i + ! big_endian ] = 0 ; <nl> buffer [ 2 * i + big_endian ] = data [ i ] ; <nl> mmm a / THMemoryFile . c <nl> ppp b / THMemoryFile . c <nl> static size_t THMemoryFile_readLong ( THFile * self , long * data , size_t n ) <nl> size_t nByteRemaining = ( mfself - > position + nByte < = mfself - > size ? nByte : mfself - > size - mfself - > position ) ; <nl> int32_t * storage = ( int32_t * ) ( mfself - > storage - > data + mfself - > position ) ; <nl> nread = nByteRemaining / 4 ; <nl> - for ( size_t i = 0 ; i < nread ; i + + ) <nl> + size_t i ; <nl> + for ( i = 0 ; i < nread ; i + + ) <nl> data [ i ] = storage [ i ] ; <nl> mfself - > position + = nread * 4 ; <nl> } <nl> static size_t THMemoryFile_readLong ( THFile * self , long * data , size_t n ) <nl> int32_t * storage = ( int32_t * ) ( mfself - > storage - > data + mfself - > position ) ; <nl> size_t nByteRemaining = ( mfself - > position + nByte < = mfself - > size ? nByte : mfself - > size - mfself - > position ) ; <nl> nread = nByteRemaining / 8 ; <nl> - for ( size_t i = 0 ; i < nread ; i + + ) <nl> + size_t i ; <nl> + for ( i = 0 ; i < nread ; i + + ) <nl> data [ i ] = storage [ 2 * i + big_endian ] ; <nl> mfself - > position + = nread * 8 ; <nl> } <nl> static size_t THMemoryFile_writeLong ( THFile * self , long * data , size_t n ) <nl> size_t nByte = 4 * n ; <nl> THMemoryFile_grow ( mfself , mfself - > position + nByte ) ; <nl> int32_t * storage = ( int32_t * ) ( mfself - > storage - > data + mfself - > position ) ; <nl> - for ( size_t i = 0 ; i < n ; i + + ) <nl> + size_t i ; <nl> + for ( i = 0 ; i < n ; i + + ) <nl> storage [ i ] = data [ i ] ; <nl> mfself - > position + = nByte ; <nl> } <nl> static size_t THMemoryFile_writeLong ( THFile * self , long * data , size_t n ) <nl> size_t nByte = 8 * n ; <nl> THMemoryFile_grow ( mfself , mfself - > position + nByte ) ; <nl> int32_t * storage = ( int32_t * ) ( mfself - > storage - > data + mfself - > position ) ; <nl> - for ( size_t i = 0 ; i < n ; i + + ) <nl> + size_t i ; <nl> + for ( i = 0 ; i < n ; i + + ) <nl> { <nl> storage [ 2 * i + ! big_endian ] = 0 ; <nl> storage [ 2 * i + big_endian ] = data [ i ] ; <nl>
‘ fix compilation error : ' orr ' loop initial declarations are only allowed in C99 mode
pytorch/pytorch
6e8ed95ada952d0bc03dea37db2d44167b46cd80
2016-10-03T06:11:59Z
mmm a / src / btree / node . hpp <nl> ppp b / src / btree / node . hpp <nl> struct btree_superblock_t { <nl> repli_timestamp_t last_sync ; <nl> uint32_t replication_master_id , replication_slave_id ; <nl> <nl> + / / We are unnecessarily generous with the amount of space <nl> + / / allocated here , but there ' s nothing else to push out of the <nl> + / / way . <nl> + static const int METAINFO_BLOB_MAXREFLEN = 1500 ; <nl> + <nl> + char metainfo_blob [ METAINFO_BLOB_MAXREFLEN ] ; <nl> + <nl> static const block_magic_t expected_magic ; <nl> } ; <nl> <nl> mmm a / src / btree / operations . cc <nl> ppp b / src / btree / operations . cc <nl> <nl> + # define __STDC_LIMIT_MACROS <nl> + <nl> # include " btree / operations . hpp " <nl> <nl> + # include < stdint . h > <nl> + <nl> # include " btree / slice . hpp " <nl> <nl> real_superblock_t : : real_superblock_t ( buf_lock_t & sb_buf ) { <nl> void real_superblock_t : : set_root_block_id ( const block_id_t new_root_block ) { <nl> / / gives us const data . No way around this ( except for making set_data take a const void * again , as it used to be ) . <nl> sb_buf_ - > set_data ( const_cast < block_id_t * > ( & reinterpret_cast < const btree_superblock_t * > ( sb_buf_ . buf ( ) - > get_data_read ( ) ) - > root_block ) , & new_root_block , sizeof ( new_root_block ) ) ; <nl> } <nl> + <nl> + <nl> + bool find_superblock_metainfo_entry ( char * beg , char * end , const std : : vector < char > & key , char * * verybeg_ptr_out , uint32_t * * size_ptr_out , char * * beg_ptr_out , char * * end_ptr_out ) { <nl> + while ( beg < end ) { <nl> + char * verybeg_ptr = beg ; <nl> + <nl> + uint32_t keysize ; <nl> + rassert ( end - beg > = int ( sizeof ( keysize ) ) ) ; <nl> + if ( end - beg < int ( sizeof ( keysize ) + key . size ( ) ) ) { <nl> + return false ; <nl> + } <nl> + <nl> + keysize = * reinterpret_cast < uint32_t * > ( beg ) ; <nl> + beg + = sizeof ( keysize ) ; <nl> + <nl> + char * keybeg = beg ; <nl> + <nl> + rassert ( end - beg > = int64_t ( keysize ) ) ; <nl> + beg + = keysize ; <nl> + uint32_t valuesize ; <nl> + rassert ( end - beg > = int ( sizeof ( valuesize ) ) ) ; <nl> + uint32_t * valuesize_ptr = reinterpret_cast < uint32_t * > ( beg ) ; <nl> + valuesize = * valuesize_ptr ; <nl> + beg + = sizeof ( valuesize ) ; <nl> + rassert ( end - beg > = int64_t ( valuesize ) ) ; <nl> + char * beg_ptr = beg ; <nl> + beg + = valuesize ; <nl> + <nl> + if ( keysize = = key . size ( ) & & std : : equal ( key . data ( ) , key . data ( ) + key . size ( ) , keybeg ) ) { <nl> + * verybeg_ptr_out = verybeg_ptr ; <nl> + * size_ptr_out = valuesize_ptr ; <nl> + * beg_ptr_out = beg_ptr ; <nl> + * end_ptr_out = beg ; <nl> + <nl> + return true ; <nl> + } <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + bool get_superblock_metainfo ( transaction_t * txn , buf_t * superblock , const std : : vector < char > & key , std : : vector < char > & value_out ) { <nl> + const btree_superblock_t * data = static_cast < const btree_superblock_t * > ( superblock - > get_data_read ( ) ) ; <nl> + <nl> + / / The const cast is okay because we access the data with rwi_read <nl> + / / and don ' t write to the blob . <nl> + blob_t blob ( const_cast < char * > ( data - > metainfo_blob ) , btree_superblock_t : : METAINFO_BLOB_MAXREFLEN ) ; <nl> + <nl> + blob_acq_t acq ; <nl> + buffer_group_t group ; <nl> + blob . expose_all ( txn , rwi_read , & group , & acq ) ; <nl> + <nl> + int64_t group_size = group . get_size ( ) ; <nl> + std : : vector < char > metainfo ( group_size ) ; <nl> + <nl> + buffer_group_t group_cpy ; <nl> + group_cpy . add_buffer ( group_size , metainfo . data ( ) ) ; <nl> + <nl> + buffer_group_copy_data ( & group_cpy , const_view ( & group ) ) ; <nl> + <nl> + uint32_t * size ; <nl> + char * verybeg , * info_begin , * info_end ; <nl> + if ( find_superblock_metainfo_entry ( metainfo . data ( ) , metainfo . data ( ) + metainfo . size ( ) , key , & verybeg , & size , & info_begin , & info_end ) ) { <nl> + value_out . assign ( info_begin , info_end ) ; <nl> + return true ; <nl> + } else { <nl> + return false ; <nl> + } <nl> + } <nl> + <nl> + void set_superblock_metainfo ( transaction_t * txn , buf_t * superblock , const std : : vector < char > & key , const std : : vector < char > & value ) { <nl> + btree_superblock_t * data = static_cast < btree_superblock_t * > ( superblock - > get_data_major_write ( ) ) ; <nl> + <nl> + blob_t blob ( data - > metainfo_blob , btree_superblock_t : : METAINFO_BLOB_MAXREFLEN ) ; <nl> + <nl> + std : : vector < char > metainfo ; <nl> + <nl> + { <nl> + blob_acq_t acq ; <nl> + buffer_group_t group ; <nl> + blob . expose_all ( txn , rwi_read , & group , & acq ) ; <nl> + <nl> + int64_t group_size = group . get_size ( ) ; <nl> + metainfo . resize ( group_size ) ; <nl> + <nl> + buffer_group_t group_cpy ; <nl> + group_cpy . add_buffer ( group_size , metainfo . data ( ) ) ; <nl> + <nl> + buffer_group_copy_data ( & group_cpy , const_view ( & group ) ) ; <nl> + } <nl> + <nl> + blob . clear ( txn ) ; <nl> + <nl> + uint32_t * size ; <nl> + char * verybeg , * info_begin , * info_end ; <nl> + if ( find_superblock_metainfo_entry ( metainfo . data ( ) , metainfo . data ( ) + metainfo . size ( ) , key , & verybeg , & size , & info_begin , & info_end ) ) { <nl> + std : : vector < char > : : iterator beg = metainfo . begin ( ) + ( info_begin - metainfo . data ( ) ) ; <nl> + std : : vector < char > : : iterator end = metainfo . begin ( ) + ( info_end - metainfo . data ( ) ) ; <nl> + / / We must modify * size first because resizing the vector invalidates the pointer . <nl> + rassert ( value . size ( ) < = UINT32_MAX ) ; <nl> + * size = value . size ( ) ; <nl> + <nl> + std : : vector < char > : : iterator p = metainfo . erase ( beg , end ) ; <nl> + <nl> + metainfo . insert ( p , value . begin ( ) , value . end ( ) ) ; <nl> + } else { <nl> + union { <nl> + char x [ sizeof ( uint32_t ) ] ; <nl> + uint32_t y ; <nl> + } data ; <nl> + rassert ( value . size ( ) < UINT32_MAX ) ; <nl> + data . y = value . size ( ) ; <nl> + <nl> + metainfo . insert ( metainfo . end ( ) , data . x , data . x + sizeof ( uint32_t ) ) ; <nl> + metainfo . insert ( metainfo . end ( ) , value . begin ( ) , value . end ( ) ) ; <nl> + } <nl> + <nl> + blob . append_region ( txn , metainfo . size ( ) ) ; <nl> + <nl> + { <nl> + blob_acq_t acq ; <nl> + buffer_group_t write_group ; <nl> + blob . expose_all ( txn , rwi_write , & write_group , & acq ) ; <nl> + <nl> + buffer_group_t group_cpy ; <nl> + group_cpy . add_buffer ( metainfo . size ( ) , metainfo . data ( ) ) ; <nl> + <nl> + buffer_group_copy_data ( & write_group , const_view ( & group_cpy ) ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + <nl> + void delete_superblock_metainfo ( transaction_t * txn , buf_t * superblock , const std : : vector < char > & key ) { <nl> + btree_superblock_t * data = static_cast < btree_superblock_t * > ( superblock - > get_data_major_write ( ) ) ; <nl> + <nl> + blob_t blob ( data - > metainfo_blob , btree_superblock_t : : METAINFO_BLOB_MAXREFLEN ) ; <nl> + <nl> + std : : vector < char > metainfo ; <nl> + <nl> + { <nl> + blob_acq_t acq ; <nl> + buffer_group_t group ; <nl> + blob . expose_all ( txn , rwi_read , & group , & acq ) ; <nl> + <nl> + int64_t group_size = group . get_size ( ) ; <nl> + metainfo . resize ( group_size ) ; <nl> + <nl> + buffer_group_t group_cpy ; <nl> + group_cpy . add_buffer ( group_size , metainfo . data ( ) ) ; <nl> + <nl> + buffer_group_copy_data ( & group_cpy , const_view ( & group ) ) ; <nl> + } <nl> + <nl> + blob . clear ( txn ) ; <nl> + <nl> + uint32_t * size ; <nl> + char * verybeg , * info_begin , * info_end ; <nl> + bool found = find_superblock_metainfo_entry ( metainfo . data ( ) , metainfo . data ( ) + metainfo . size ( ) , key , & verybeg , & size , & info_begin , & info_end ) ; <nl> + <nl> + rassert ( found ) ; <nl> + <nl> + if ( found ) { <nl> + <nl> + std : : vector < char > : : iterator p = metainfo . begin ( ) + ( verybeg - metainfo . data ( ) ) ; <nl> + std : : vector < char > : : iterator q = metainfo . begin ( ) + ( info_end - metainfo . data ( ) ) ; <nl> + metainfo . erase ( p , q ) ; <nl> + <nl> + { <nl> + blob_acq_t acq ; <nl> + buffer_group_t write_group ; <nl> + blob . expose_all ( txn , rwi_write , & write_group , & acq ) ; <nl> + <nl> + buffer_group_t group_cpy ; <nl> + group_cpy . add_buffer ( metainfo . size ( ) , metainfo . data ( ) ) ; <nl> + <nl> + buffer_group_copy_data ( & write_group , const_view ( & group_cpy ) ) ; <nl> + } <nl> + } <nl> + } <nl> mmm a / src / btree / operations . hpp <nl> ppp b / src / btree / operations . hpp <nl> class fake_key_modification_callback_t : public key_modification_callback_t < Valu <nl> } ; <nl> <nl> <nl> + bool get_superblock_metainfo ( transaction_t * txn , buf_t * superblock , const std : : vector < char > & key , std : : vector < char > & value_out ) ; <nl> + <nl> + void set_superblock_metainfo ( transaction_t * txn , buf_t * superblock , const std : : vector < char > & key , const std : : vector < char > & value ) ; <nl> + <nl> + void delete_superblock_metainfo ( transaction_t * txn , buf_t * superblock , const std : : vector < char > & key ) ; <nl> + <nl> # include " btree / operations . tcc " <nl> <nl> # endif / / __BTREE_OPERATIONS_HPP__ <nl>
Allegedly implemented low level get_superblock_metainfo , set_superblock_metainfo , and delete_superblock_metainfo .
rethinkdb/rethinkdb
42e026e3c2d898a014232971bb0545a200a5ca65
2011-11-17T04:04:31Z
mmm a / src / Interpreters / InterpreterCreateQuery . cpp <nl> ppp b / src / Interpreters / InterpreterCreateQuery . cpp <nl> ASTPtr InterpreterCreateQuery : : formatConstraints ( const ConstraintsDescription & <nl> <nl> ColumnsDescription InterpreterCreateQuery : : getColumnsDescription ( const ASTExpressionList & columns_ast , const Context & context ) <nl> { <nl> - Settings set ; <nl> - <nl> / / / First , deduce implicit types . <nl> <nl> / * * all default_expressions as a single expression list , <nl> ColumnsDescription InterpreterCreateQuery : : getColumnsDescription ( const ASTExpres <nl> throw Exception { " Cant use NOT NULL with Nullable " , ErrorCodes : : EMPTY_LIST_OF_COLUMNS_PASSED } ; <nl> } <nl> <nl> - if ( set . data_type_default_nullable & & ! column_type - > isNullable ( ) ) <nl> + if ( context . getSettingsRef ( ) . data_type_default_nullable & & ! column_type - > isNullable ( ) & & ! col_decl . isNotNULL ) <nl> column_type = makeNullable ( column_type ) ; <nl> <nl> column_names_and_types . emplace_back ( col_decl . name , column_type ) ; <nl> mmm a / src / Parsers / ASTColumnDeclaration . cpp <nl> ppp b / src / Parsers / ASTColumnDeclaration . cpp <nl> ASTPtr ASTColumnDeclaration : : clone ( ) const <nl> if ( isNULL ) <nl> { <nl> res - > isNULL = isNULL ; <nl> + res - > children . push_back ( res - > isNULL ) ; <nl> } <nl> <nl> if ( isNULL ) <nl> { <nl> res - > isNotNULL = isNotNULL ; <nl> + res - > children . push_back ( res - > isNotNULL ) ; <nl> } <nl> <nl> if ( default_expression ) <nl> void ASTColumnDeclaration : : formatImpl ( const FormatSettings & settings , FormatSta <nl> type - > formatImpl ( settings , state , frame ) ; <nl> } <nl> <nl> + if ( isNULL ) <nl> + { <nl> + settings . ostr < < ' ' ; <nl> + isNULL - > formatImpl ( settings , state , frame ) ; <nl> + } <nl> + <nl> + if ( isNotNULL ) <nl> + { <nl> + settings . ostr < < ' ' ; <nl> + isNotNULL - > formatImpl ( settings , state , frame ) ; <nl> + } <nl> + <nl> if ( default_expression ) <nl> { <nl> settings . ostr < < ' ' < < ( settings . hilite ? hilite_keyword : " " ) < < default_specifier < < ( settings . hilite ? hilite_none : " " ) < < ' ' ; <nl> mmm a / src / Parsers / ASTColumnDeclaration . h <nl> ppp b / src / Parsers / ASTColumnDeclaration . h <nl> class ASTColumnDeclaration : public IAST <nl> public : <nl> String name ; <nl> ASTPtr type ; <nl> - bool isNULL ; <nl> - bool isNotNULL ; <nl> + ASTPtr isNULL ; <nl> + ASTPtr isNotNULL ; <nl> String default_specifier ; <nl> ASTPtr default_expression ; <nl> ASTPtr comment ; <nl> mmm a / src / Parsers / ParserCreateQuery . h <nl> ppp b / src / Parsers / ParserCreateQuery . h <nl> bool IParserColumnDeclaration < NameParser > : : parseImpl ( Pos & pos , ASTPtr & node , E <nl> ParserStringLiteral string_literal_parser ; <nl> ParserCodec codec_parser ; <nl> ParserExpression expression_parser ; <nl> + ParserIdentifier null_parser ; <nl> + ParserIdentifier not_null_parser ; <nl> <nl> / / / mandatory column name <nl> ASTPtr name ; <nl> bool IParserColumnDeclaration < NameParser > : : parseImpl ( Pos & pos , ASTPtr & node , E <nl> * / <nl> ASTPtr type ; <nl> String default_specifier ; <nl> - bool isNull = false ; <nl> - bool isNotNull = false ; <nl> + ASTPtr isNull ; <nl> + ASTPtr isNotNull ; <nl> ASTPtr default_expression ; <nl> ASTPtr comment_expression ; <nl> ASTPtr codec_expression ; <nl> bool IParserColumnDeclaration < NameParser > : : parseImpl ( Pos & pos , ASTPtr & node , E <nl> if ( require_type & & ! type & & ! default_expression ) <nl> return false ; / / / reject column name without type <nl> <nl> - if ( s_null . checkWithoutMoving ( pos , expected ) ) { <nl> - if ( s_null . check ( pos , expected ) ) <nl> - isNull = true ; <nl> - } else if ( s_not_null . checkWithoutMoving ( pos , expected ) ) { <nl> - if ( s_not_null . check ( pos , expected ) ) <nl> - isNotNull = true ; <nl> + Pos pos_before_null = pos ; <nl> + <nl> + if ( s_null . check ( pos , expected ) ) { <nl> + if ( ! null_parser . parse ( pos_before_null , isNull , expected ) ) <nl> + return false ; <nl> + } else if ( s_not_null . check ( pos , expected ) ) { <nl> + if ( ! not_null_parser . parse ( pos_before_null , isNotNull , expected ) ) <nl> + return false ; <nl> } <nl> <nl> if ( s_comment . ignore ( pos , expected ) ) <nl> bool IParserColumnDeclaration < NameParser > : : parseImpl ( Pos & pos , ASTPtr & node , E <nl> <nl> if ( isNull ) { <nl> column_declaration - > isNULL = isNull ; <nl> + column_declaration - > children . push_back ( std : : move ( isNull ) ) ; <nl> } <nl> <nl> - if ( isNull ) { <nl> + if ( isNotNull ) { <nl> column_declaration - > isNotNULL = isNotNull ; <nl> + column_declaration - > children . push_back ( std : : move ( isNotNull ) ) ; <nl> } <nl> <nl> if ( default_expression ) <nl>
at start
ClickHouse/ClickHouse
8a9064cef2b82fdb214359bb784f0c697919b810
2020-05-20T18:23:35Z
mmm a / modules / ts / include / opencv2 / ts / ts_gtest . h <nl> ppp b / modules / ts / include / opencv2 / ts / ts_gtest . h <nl> GTEST_DECLARE_string_ ( color ) ; <nl> / / the tests to run . If the filter is not given all tests are executed . <nl> GTEST_DECLARE_string_ ( filter ) ; <nl> <nl> + / / OpenCV extension : same as filter , but for the parameters string . <nl> + GTEST_DECLARE_string_ ( param_filter ) ; <nl> + <nl> / / This flag causes the Google Test to list tests . None of the tests listed <nl> / / are actually run if the flag is provided . <nl> GTEST_DECLARE_bool_ ( list_tests ) ; <nl> mmm a / modules / ts / src / ts_gtest . cpp <nl> ppp b / modules / ts / src / ts_gtest . cpp <nl> const char kBreakOnFailureFlag [ ] = " break_on_failure " ; <nl> const char kCatchExceptionsFlag [ ] = " catch_exceptions " ; <nl> const char kColorFlag [ ] = " color " ; <nl> const char kFilterFlag [ ] = " filter " ; <nl> + const char kParamFilterFlag [ ] = " param_filter " ; <nl> const char kListTestsFlag [ ] = " list_tests " ; <nl> const char kOutputFlag [ ] = " output " ; <nl> const char kPrintTimeFlag [ ] = " print_time " ; <nl> class GTestFlagSaver { <nl> death_test_style_ = GTEST_FLAG ( death_test_style ) ; <nl> death_test_use_fork_ = GTEST_FLAG ( death_test_use_fork ) ; <nl> filter_ = GTEST_FLAG ( filter ) ; <nl> + param_filter_ = GTEST_FLAG ( param_filter ) ; <nl> internal_run_death_test_ = GTEST_FLAG ( internal_run_death_test ) ; <nl> list_tests_ = GTEST_FLAG ( list_tests ) ; <nl> output_ = GTEST_FLAG ( output ) ; <nl> class GTestFlagSaver { <nl> GTEST_FLAG ( death_test_style ) = death_test_style_ ; <nl> GTEST_FLAG ( death_test_use_fork ) = death_test_use_fork_ ; <nl> GTEST_FLAG ( filter ) = filter_ ; <nl> + GTEST_FLAG ( param_filter ) = param_filter_ ; <nl> GTEST_FLAG ( internal_run_death_test ) = internal_run_death_test_ ; <nl> GTEST_FLAG ( list_tests ) = list_tests_ ; <nl> GTEST_FLAG ( output ) = output_ ; <nl> class GTestFlagSaver { <nl> std : : string death_test_style_ ; <nl> bool death_test_use_fork_ ; <nl> std : : string filter_ ; <nl> + std : : string param_filter_ ; <nl> std : : string internal_run_death_test_ ; <nl> bool list_tests_ ; <nl> std : : string output_ ; <nl> GTEST_DEFINE_string_ ( <nl> " exclude ) . A test is run if it matches one of the positive " <nl> " patterns and does not match any of the negative patterns . " ) ; <nl> <nl> + GTEST_DEFINE_string_ ( <nl> + param_filter , <nl> + internal : : StringFromGTestEnv ( " param_filter " , kUniversalFilter ) , <nl> + " Same syntax and semantics as for param , but these patterns " <nl> + " have to match the test ' s parameters . " ) ; <nl> + <nl> GTEST_DEFINE_bool_ ( list_tests , false , <nl> " List all tests without running them . " ) ; <nl> <nl> void PrettyUnitTestResultPrinter : : OnTestIterationStart ( <nl> " Note : % s filter = % s \ n " , GTEST_NAME_ , filter ) ; <nl> } <nl> <nl> + const char * const param_filter = GTEST_FLAG ( param_filter ) . c_str ( ) ; <nl> + <nl> + / / Ditto . <nl> + if ( ! String : : CStringEquals ( param_filter , kUniversalFilter ) ) { <nl> + ColoredPrintf ( COLOR_YELLOW , <nl> + " Note : % s parameter filter = % s \ n " , GTEST_NAME_ , param_filter ) ; <nl> + } <nl> + <nl> if ( internal : : ShouldShard ( kTestTotalShards , kTestShardIndex , false ) ) { <nl> const Int32 shard_index = Int32FromEnvOrDie ( kTestShardIndex , - 1 ) ; <nl> ColoredPrintf ( COLOR_YELLOW , <nl> int UnitTestImpl : : FilterTests ( ReactionToSharding shard_tests ) { <nl> kDisableTestFilter ) ; <nl> test_info - > is_disabled_ = is_disabled ; <nl> <nl> + const std : : string value_param ( test_info - > value_param ( ) = = NULL ? <nl> + " " : test_info - > value_param ( ) ) ; <nl> + <nl> const bool matches_filter = <nl> internal : : UnitTestOptions : : FilterMatchesTest ( test_case_name , <nl> - test_name ) ; <nl> + test_name ) & & <nl> + internal : : UnitTestOptions : : MatchesFilter ( value_param , <nl> + GTEST_FLAG ( param_filter ) . c_str ( ) ) ; <nl> + <nl> test_info - > matches_filter_ = matches_filter ; <nl> <nl> const bool is_runnable = <nl> static const char kColorEncodedHelpMessage [ ] = <nl> " Run only the tests whose name matches one of the positive patterns but \ n " <nl> " none of the negative patterns . ' ? ' matches any single character ; ' * ' \ n " <nl> " matches any substring ; ' : ' separates two patterns . \ n " <nl> + " @ G - - " GTEST_FLAG_PREFIX_ " param_filter = @ YPOSITIVE_PATTERNS " <nl> + " [ @ G - @ YNEGATIVE_PATTERNS ] @ D \ n " <nl> + " Like @ G - - " GTEST_FLAG_PREFIX_ <nl> + " filter @ D , but applies to the test ' s parameter . If a \ n " <nl> + " test is not parameterized , its parameter is considered to be the \ n " <nl> + " empty string . \ n " <nl> " @ G - - " GTEST_FLAG_PREFIX_ " also_run_disabled_tests @ D \ n " <nl> " Run all disabled tests too . \ n " <nl> " \ n " <nl> void ParseGoogleTestFlagsOnlyImpl ( int * argc , CharType * * argv ) { <nl> ParseBoolFlag ( arg , kDeathTestUseFork , <nl> & GTEST_FLAG ( death_test_use_fork ) ) | | <nl> ParseStringFlag ( arg , kFilterFlag , & GTEST_FLAG ( filter ) ) | | <nl> + ParseStringFlag ( arg , kParamFilterFlag , & GTEST_FLAG ( param_filter ) ) | | <nl> ParseStringFlag ( arg , kInternalRunDeathTestFlag , <nl> & GTEST_FLAG ( internal_run_death_test ) ) | | <nl> ParseBoolFlag ( arg , kListTestsFlag , & GTEST_FLAG ( list_tests ) ) | | <nl>
Merge pull request from SpecLad : gtest - param - filter
opencv/opencv
51008322c57b01e0085df9af3380a420a0b2842f
2013-06-27T11:50:31Z
mmm a / src / python / grpcio / grpc / _simple_stubs . py <nl> ppp b / src / python / grpcio / grpc / _simple_stubs . py <nl> <nl> else : <nl> _DEFAULT_TIMEOUT = 60 . 0 <nl> <nl> + class _DefaultTimeoutSentinelType ( object ) : <nl> + pass <nl> + <nl> + _DEFAULT_TIMEOUT_SENTINEL = _DefaultTimeoutSentinelType ( ) <nl> + <nl> <nl> def _create_channel ( target : str , options : Sequence [ Tuple [ str , str ] ] , <nl> channel_credentials : Optional [ grpc . ChannelCredentials ] , <nl> def _test_only_channel_count ( self ) - > int : <nl> <nl> <nl> def _get_wait_for_ready_settings ( wait_for_ready : Optional [ bool ] , <nl> - timeout : Optional [ float ] <nl> - ) - > Tuple [ bool , float ] : <nl> + timeout : Union [ Optional [ float ] , _DefaultTimeoutSentinelType ] <nl> + ) - > Tuple [ bool , Optional [ float ] ] : <nl> if wait_for_ready is None : <nl> wait_for_ready = True <nl> - if wait_for_ready and timeout is None : <nl> + # TODO : You don ' t actually need this sentinel . . . <nl> + if timeout is _DEFAULT_TIMEOUT_SENTINEL : <nl> timeout = _DEFAULT_TIMEOUT <nl> return wait_for_ready , timeout <nl> <nl> def unary_unary ( <nl> call_credentials : Optional [ grpc . CallCredentials ] = None , <nl> compression : Optional [ grpc . Compression ] = None , <nl> wait_for_ready : Optional [ bool ] = None , <nl> - timeout : Optional [ float ] = None , <nl> + timeout : Optional [ float ] = _DEFAULT_TIMEOUT_SENTINEL , <nl> metadata : Optional [ Sequence [ Tuple [ str , Union [ str , bytes ] ] ] ] = None <nl> ) - > ResponseType : <nl> " " " Invokes a unary - unary RPC without an explicitly specified channel . <nl> def unary_unary ( <nl> becomes ready . When using this option , the user will likely also want <nl> to set a timeout . Defaults to True . <nl> timeout : An optional duration of time in seconds to allow for the RPC , <nl> - after which an exception will be raised . If timeout is unspecified and <nl> - wait_for_ready is True , defaults to one minute . <nl> + after which an exception will be raised . If timeout is unspecified , <nl> + defaults to a timeout controlled by the <nl> + GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable . If that is <nl> + unset , defaults to 60 seconds . Supply a value of None to indicate that <nl> + no timeout should be enforced . <nl> metadata : Optional metadata to send to the server . <nl> <nl> Returns : <nl> def unary_stream ( <nl> call_credentials : Optional [ grpc . CallCredentials ] = None , <nl> compression : Optional [ grpc . Compression ] = None , <nl> wait_for_ready : Optional [ bool ] = None , <nl> - timeout : Optional [ float ] = None , <nl> + timeout : Optional [ float ] = _DEFAULT_TIMEOUT_SENTINEL , <nl> metadata : Optional [ Sequence [ Tuple [ str , Union [ str , bytes ] ] ] ] = None <nl> ) - > Iterator [ ResponseType ] : <nl> " " " Invokes a unary - stream RPC without an explicitly specified channel . <nl> def unary_stream ( <nl> becomes ready . When using this option , the user will likely also want <nl> to set a timeout . Defaults to True . <nl> timeout : An optional duration of time in seconds to allow for the RPC , <nl> - after which an exception will be raised . If timeout is unspecified and <nl> - wait_for_ready is True , defaults to one minute . <nl> + after which an exception will be raised . If timeout is unspecified , <nl> + defaults to a timeout controlled by the <nl> + GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable . If that is <nl> + unset , defaults to 60 seconds . Supply a value of None to indicate that <nl> + no timeout should be enforced . <nl> metadata : Optional metadata to send to the server . <nl> <nl> Returns : <nl> def stream_unary ( <nl> call_credentials : Optional [ grpc . CallCredentials ] = None , <nl> compression : Optional [ grpc . Compression ] = None , <nl> wait_for_ready : Optional [ bool ] = None , <nl> - timeout : Optional [ float ] = None , <nl> + timeout : Optional [ float ] = _DEFAULT_TIMEOUT_SENTINEL , <nl> metadata : Optional [ Sequence [ Tuple [ str , Union [ str , bytes ] ] ] ] = None <nl> ) - > ResponseType : <nl> " " " Invokes a stream - unary RPC without an explicitly specified channel . <nl> def stream_unary ( <nl> becomes ready . When using this option , the user will likely also want <nl> to set a timeout . Defaults to True . <nl> timeout : An optional duration of time in seconds to allow for the RPC , <nl> - after which an exception will be raised . If timeout is unspecified and <nl> - wait_for_ready is True , defaults to one minute . <nl> + after which an exception will be raised . If timeout is unspecified , <nl> + defaults to a timeout controlled by the <nl> + GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable . If that is <nl> + unset , defaults to 60 seconds . Supply a value of None to indicate that <nl> + no timeout should be enforced . <nl> metadata : Optional metadata to send to the server . <nl> <nl> Returns : <nl> def stream_stream ( <nl> call_credentials : Optional [ grpc . CallCredentials ] = None , <nl> compression : Optional [ grpc . Compression ] = None , <nl> wait_for_ready : Optional [ bool ] = None , <nl> - timeout : Optional [ float ] = None , <nl> + timeout : Optional [ float ] = _DEFAULT_TIMEOUT_SENTINEL , <nl> metadata : Optional [ Sequence [ Tuple [ str , Union [ str , bytes ] ] ] ] = None <nl> ) - > Iterator [ ResponseType ] : <nl> " " " Invokes a stream - stream RPC without an explicitly specified channel . <nl> def stream_stream ( <nl> becomes ready . When using this option , the user will likely also want <nl> to set a timeout . Defaults to True . <nl> timeout : An optional duration of time in seconds to allow for the RPC , <nl> - after which an exception will be raised . If timeout is unspecified and <nl> - wait_for_ready is True , defaults to one minute . <nl> + after which an exception will be raised . If timeout is unspecified , <nl> + defaults to a timeout controlled by the <nl> + GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable . If that is <nl> + unset , defaults to 60 seconds . Supply a value of None to indicate that <nl> + no timeout should be enforced . <nl> metadata : Optional metadata to send to the server . <nl> <nl> Returns : <nl> mmm a / src / python / grpcio_tests / tests_py3_only / unit / _simple_stubs_test . py <nl> ppp b / src / python / grpcio_tests / tests_py3_only / unit / _simple_stubs_test . py <nl> <nl> <nl> _MAXIMUM_CHANNELS = 10 <nl> <nl> + _DEFAULT_TIMEOUT = 1 . 0 <nl> + <nl> os . environ [ " GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS " ] = " 2 " <nl> os . environ [ " GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM " ] = str ( _MAXIMUM_CHANNELS ) <nl> + os . environ [ " GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS " ] = str ( _DEFAULT_TIMEOUT ) <nl> <nl> import contextlib <nl> import datetime <nl> <nl> _UNARY_STREAM = " / test / UnaryStream " <nl> _STREAM_UNARY = " / test / StreamUnary " <nl> _STREAM_STREAM = " / test / StreamStream " <nl> + _BLACK_HOLE = " / test / BlackHole " <nl> <nl> <nl> @ contextlib . contextmanager <nl> def _stream_stream_handler ( request_iterator , context ) : <nl> yield request <nl> <nl> <nl> + def _black_hole_handler ( request , context ) : <nl> + event = threading . Event ( ) <nl> + def _on_done ( ) : <nl> + event . set ( ) <nl> + context . add_callback ( _on_done ) <nl> + while not event . is_set ( ) : <nl> + time . sleep ( 0 . 1 ) <nl> + <nl> + <nl> class _GenericHandler ( grpc . GenericRpcHandler ) : <nl> <nl> def service ( self , handler_call_details ) : <nl> def service ( self , handler_call_details ) : <nl> return grpc . stream_unary_rpc_method_handler ( _stream_unary_handler ) <nl> elif handler_call_details . method = = _STREAM_STREAM : <nl> return grpc . stream_stream_rpc_method_handler ( _stream_stream_handler ) <nl> + elif handler_call_details . method = = _BLACK_HOLE : <nl> + return grpc . unary_unary_rpc_method_handler ( _black_hole_handler ) <nl> else : <nl> raise NotImplementedError ( ) <nl> <nl> def assert_eventually ( self , <nl> else : <nl> self . fail ( message ( ) + " after " + str ( timeout ) ) <nl> <nl> - def test_unary_unary_insecure ( self ) : <nl> - with _server ( None ) as port : <nl> - target = f ' localhost : { port } ' <nl> - response = grpc . experimental . unary_unary ( <nl> - _REQUEST , <nl> - target , <nl> - _UNARY_UNARY , <nl> - channel_credentials = grpc . experimental . <nl> - insecure_channel_credentials ( ) ) <nl> - self . assertEqual ( _REQUEST , response ) <nl> - <nl> - def test_unary_unary_secure ( self ) : <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - response = grpc . experimental . unary_unary ( <nl> - _REQUEST , <nl> - target , <nl> - _UNARY_UNARY , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) <nl> - self . assertEqual ( _REQUEST , response ) <nl> - <nl> - def test_channels_cached ( self ) : <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - test_name = inspect . stack ( ) [ 0 ] [ 3 ] <nl> - args = ( _REQUEST , target , _UNARY_UNARY ) <nl> - kwargs = { " channel_credentials " : grpc . local_channel_credentials ( ) } <nl> - <nl> - def _invoke ( seed : str ) : <nl> - run_kwargs = dict ( kwargs ) <nl> - run_kwargs [ " options " ] = ( ( test_name + seed , " " ) , ) <nl> - grpc . experimental . unary_unary ( * args , * * run_kwargs ) <nl> - <nl> - self . assert_cached ( _invoke ) <nl> - <nl> - def test_channels_evicted ( self ) : <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - response = grpc . experimental . unary_unary ( <nl> - _REQUEST , <nl> - target , <nl> - _UNARY_UNARY , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) <nl> - self . assert_eventually ( <nl> - lambda : grpc . _simple_stubs . ChannelCache . get ( <nl> - ) . _test_only_channel_count ( ) = = 0 , <nl> - message = lambda : <nl> - f " { grpc . _simple_stubs . ChannelCache . get ( ) . _test_only_channel_count ( ) } remain " <nl> - ) <nl> - <nl> - def test_total_channels_enforced ( self ) : <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - for i in range ( _STRESS_EPOCHS ) : <nl> - # Ensure we get a new channel each time . <nl> - options = ( ( " foo " , str ( i ) ) , ) <nl> - # Send messages at full blast . <nl> - grpc . experimental . unary_unary ( <nl> - _REQUEST , <nl> - target , <nl> - _UNARY_UNARY , <nl> - options = options , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) <nl> - self . assert_eventually ( <nl> - lambda : grpc . _simple_stubs . ChannelCache . get ( <nl> - ) . _test_only_channel_count ( ) < = _MAXIMUM_CHANNELS + 1 , <nl> - message = lambda : <nl> - f " { grpc . _simple_stubs . ChannelCache . get ( ) . _test_only_channel_count ( ) } channels remain " <nl> - ) <nl> - <nl> - def test_unary_stream ( self ) : <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - for response in grpc . experimental . unary_stream ( <nl> - _REQUEST , <nl> - target , <nl> - _UNARY_STREAM , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) : <nl> - self . assertEqual ( _REQUEST , response ) <nl> - <nl> - def test_stream_unary ( self ) : <nl> - <nl> - def request_iter ( ) : <nl> - for _ in range ( _CLIENT_REQUEST_COUNT ) : <nl> - yield _REQUEST <nl> - <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - response = grpc . experimental . stream_unary ( <nl> - request_iter ( ) , <nl> - target , <nl> - _STREAM_UNARY , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) <nl> - self . assertEqual ( _REQUEST , response ) <nl> - <nl> - def test_stream_stream ( self ) : <nl> - <nl> - def request_iter ( ) : <nl> - for _ in range ( _CLIENT_REQUEST_COUNT ) : <nl> - yield _REQUEST <nl> - <nl> - with _server ( grpc . local_server_credentials ( ) ) as port : <nl> - target = f ' localhost : { port } ' <nl> - for response in grpc . experimental . stream_stream ( <nl> - request_iter ( ) , <nl> - target , <nl> - _STREAM_STREAM , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) : <nl> - self . assertEqual ( _REQUEST , response ) <nl> - <nl> - def test_default_ssl ( self ) : <nl> - _private_key = resources . private_key ( ) <nl> - _certificate_chain = resources . certificate_chain ( ) <nl> - _server_certs = ( ( _private_key , _certificate_chain ) , ) <nl> - _server_host_override = ' foo . test . google . fr ' <nl> - _test_root_certificates = resources . test_root_certificates ( ) <nl> - _property_options = ( ( <nl> - ' grpc . ssl_target_name_override ' , <nl> - _server_host_override , <nl> - ) , ) <nl> - cert_dir = os . path . join ( os . path . dirname ( resources . __file__ ) , <nl> - " credentials " ) <nl> - cert_file = os . path . join ( cert_dir , " ca . pem " ) <nl> - with _env ( " GRPC_DEFAULT_SSL_ROOTS_FILE_PATH " , cert_file ) : <nl> - server_creds = grpc . ssl_server_credentials ( _server_certs ) <nl> - with _server ( server_creds ) as port : <nl> - target = f ' localhost : { port } ' <nl> - response = grpc . experimental . unary_unary ( <nl> - _REQUEST , target , _UNARY_UNARY , options = _property_options ) <nl> - <nl> - def test_insecure_sugar ( self ) : <nl> - with _server ( None ) as port : <nl> - target = f ' localhost : { port } ' <nl> - response = grpc . experimental . unary_unary ( _REQUEST , <nl> - target , <nl> - _UNARY_UNARY , <nl> - insecure = True ) <nl> - self . assertEqual ( _REQUEST , response ) <nl> - <nl> - def test_insecure_sugar_mutually_exclusive ( self ) : <nl> + # def test_unary_unary_insecure ( self ) : <nl> + # with _server ( None ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # response = grpc . experimental . unary_unary ( <nl> + # _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # channel_credentials = grpc . experimental . <nl> + # insecure_channel_credentials ( ) ) <nl> + # self . assertEqual ( _REQUEST , response ) <nl> + <nl> + # def test_unary_unary_secure ( self ) : <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # response = grpc . experimental . unary_unary ( <nl> + # _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) <nl> + # self . assertEqual ( _REQUEST , response ) <nl> + <nl> + # def test_channels_cached ( self ) : <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # test_name = inspect . stack ( ) [ 0 ] [ 3 ] <nl> + # args = ( _REQUEST , target , _UNARY_UNARY ) <nl> + # kwargs = { " channel_credentials " : grpc . local_channel_credentials ( ) } <nl> + <nl> + # def _invoke ( seed : str ) : <nl> + # run_kwargs = dict ( kwargs ) <nl> + # run_kwargs [ " options " ] = ( ( test_name + seed , " " ) , ) <nl> + # grpc . experimental . unary_unary ( * args , * * run_kwargs ) <nl> + <nl> + # self . assert_cached ( _invoke ) <nl> + <nl> + # def test_channels_evicted ( self ) : <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # response = grpc . experimental . unary_unary ( <nl> + # _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) <nl> + # self . assert_eventually ( <nl> + # lambda : grpc . _simple_stubs . ChannelCache . get ( <nl> + # ) . _test_only_channel_count ( ) = = 0 , <nl> + # message = lambda : <nl> + # f " { grpc . _simple_stubs . ChannelCache . get ( ) . _test_only_channel_count ( ) } remain " <nl> + # ) <nl> + <nl> + # def test_total_channels_enforced ( self ) : <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # for i in range ( _STRESS_EPOCHS ) : <nl> + # # Ensure we get a new channel each time . <nl> + # options = ( ( " foo " , str ( i ) ) , ) <nl> + # # Send messages at full blast . <nl> + # grpc . experimental . unary_unary ( <nl> + # _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # options = options , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) <nl> + # self . assert_eventually ( <nl> + # lambda : grpc . _simple_stubs . ChannelCache . get ( <nl> + # ) . _test_only_channel_count ( ) < = _MAXIMUM_CHANNELS + 1 , <nl> + # message = lambda : <nl> + # f " { grpc . _simple_stubs . ChannelCache . get ( ) . _test_only_channel_count ( ) } channels remain " <nl> + # ) <nl> + <nl> + # def test_unary_stream ( self ) : <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # for response in grpc . experimental . unary_stream ( <nl> + # _REQUEST , <nl> + # target , <nl> + # _UNARY_STREAM , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) : <nl> + # self . assertEqual ( _REQUEST , response ) <nl> + <nl> + # def test_stream_unary ( self ) : <nl> + <nl> + # def request_iter ( ) : <nl> + # for _ in range ( _CLIENT_REQUEST_COUNT ) : <nl> + # yield _REQUEST <nl> + <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # response = grpc . experimental . stream_unary ( <nl> + # request_iter ( ) , <nl> + # target , <nl> + # _STREAM_UNARY , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) <nl> + # self . assertEqual ( _REQUEST , response ) <nl> + <nl> + # def test_stream_stream ( self ) : <nl> + <nl> + # def request_iter ( ) : <nl> + # for _ in range ( _CLIENT_REQUEST_COUNT ) : <nl> + # yield _REQUEST <nl> + <nl> + # with _server ( grpc . local_server_credentials ( ) ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # for response in grpc . experimental . stream_stream ( <nl> + # request_iter ( ) , <nl> + # target , <nl> + # _STREAM_STREAM , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) : <nl> + # self . assertEqual ( _REQUEST , response ) <nl> + <nl> + # def test_default_ssl ( self ) : <nl> + # _private_key = resources . private_key ( ) <nl> + # _certificate_chain = resources . certificate_chain ( ) <nl> + # _server_certs = ( ( _private_key , _certificate_chain ) , ) <nl> + # _server_host_override = ' foo . test . google . fr ' <nl> + # _test_root_certificates = resources . test_root_certificates ( ) <nl> + # _property_options = ( ( <nl> + # ' grpc . ssl_target_name_override ' , <nl> + # _server_host_override , <nl> + # ) , ) <nl> + # cert_dir = os . path . join ( os . path . dirname ( resources . __file__ ) , <nl> + # " credentials " ) <nl> + # cert_file = os . path . join ( cert_dir , " ca . pem " ) <nl> + # with _env ( " GRPC_DEFAULT_SSL_ROOTS_FILE_PATH " , cert_file ) : <nl> + # server_creds = grpc . ssl_server_credentials ( _server_certs ) <nl> + # with _server ( server_creds ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # response = grpc . experimental . unary_unary ( <nl> + # _REQUEST , target , _UNARY_UNARY , options = _property_options ) <nl> + <nl> + # def test_insecure_sugar ( self ) : <nl> + # with _server ( None ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # response = grpc . experimental . unary_unary ( _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # insecure = True ) <nl> + # self . assertEqual ( _REQUEST , response ) <nl> + <nl> + # def test_insecure_sugar_mutually_exclusive ( self ) : <nl> + # with _server ( None ) as port : <nl> + # target = f ' localhost : { port } ' <nl> + # with self . assertRaises ( ValueError ) : <nl> + # response = grpc . experimental . unary_unary ( <nl> + # _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # insecure = True , <nl> + # channel_credentials = grpc . local_channel_credentials ( ) ) <nl> + <nl> + # def test_default_wait_for_ready ( self ) : <nl> + # addr , port , sock = get_socket ( ) <nl> + # sock . close ( ) <nl> + # target = f ' { addr } : { port } ' <nl> + # channel = grpc . _simple_stubs . ChannelCache . get ( ) . get_channel ( <nl> + # target , ( ) , None , True , None ) <nl> + # rpc_finished_event = threading . Event ( ) <nl> + # rpc_failed_event = threading . Event ( ) <nl> + # server = None <nl> + <nl> + # def _on_connectivity_changed ( connectivity ) : <nl> + # nonlocal server <nl> + # if connectivity is grpc . ChannelConnectivity . TRANSIENT_FAILURE : <nl> + # self . assertFalse ( rpc_finished_event . is_set ( ) ) <nl> + # self . assertFalse ( rpc_failed_event . is_set ( ) ) <nl> + # server = test_common . test_server ( ) <nl> + # server . add_insecure_port ( target ) <nl> + # server . add_generic_rpc_handlers ( ( _GenericHandler ( ) , ) ) <nl> + # server . start ( ) <nl> + # channel . unsubscribe ( _on_connectivity_changed ) <nl> + # elif connectivity in ( grpc . ChannelConnectivity . IDLE , <nl> + # grpc . ChannelConnectivity . CONNECTING ) : <nl> + # pass <nl> + # else : <nl> + # self . fail ( " Encountered unknown state . " ) <nl> + <nl> + # channel . subscribe ( _on_connectivity_changed ) <nl> + <nl> + # def _send_rpc ( ) : <nl> + # try : <nl> + # response = grpc . experimental . unary_unary ( _REQUEST , <nl> + # target , <nl> + # _UNARY_UNARY , <nl> + # insecure = True ) <nl> + # rpc_finished_event . set ( ) <nl> + # except Exception as e : <nl> + # rpc_failed_event . set ( ) <nl> + <nl> + # t = threading . Thread ( target = _send_rpc ) <nl> + # t . start ( ) <nl> + # t . join ( ) <nl> + # self . assertFalse ( rpc_failed_event . is_set ( ) ) <nl> + # self . assertTrue ( rpc_finished_event . is_set ( ) ) <nl> + # if server is not None : <nl> + # server . stop ( None ) <nl> + <nl> + def assert_times_out ( self , invocation_args ) : <nl> with _server ( None ) as port : <nl> target = f ' localhost : { port } ' <nl> - with self . assertRaises ( ValueError ) : <nl> - response = grpc . experimental . unary_unary ( <nl> - _REQUEST , <nl> - target , <nl> - _UNARY_UNARY , <nl> - insecure = True , <nl> - channel_credentials = grpc . local_channel_credentials ( ) ) <nl> - <nl> - def test_default_wait_for_ready ( self ) : <nl> - addr , port , sock = get_socket ( ) <nl> - sock . close ( ) <nl> - target = f ' { addr } : { port } ' <nl> - channel = grpc . _simple_stubs . ChannelCache . get ( ) . get_channel ( <nl> - target , ( ) , None , True , None ) <nl> - rpc_finished_event = threading . Event ( ) <nl> - rpc_failed_event = threading . Event ( ) <nl> - server = None <nl> - <nl> - def _on_connectivity_changed ( connectivity ) : <nl> - nonlocal server <nl> - if connectivity is grpc . ChannelConnectivity . TRANSIENT_FAILURE : <nl> - self . assertFalse ( rpc_finished_event . is_set ( ) ) <nl> - self . assertFalse ( rpc_failed_event . is_set ( ) ) <nl> - server = test_common . test_server ( ) <nl> - server . add_insecure_port ( target ) <nl> - server . add_generic_rpc_handlers ( ( _GenericHandler ( ) , ) ) <nl> - server . start ( ) <nl> - channel . unsubscribe ( _on_connectivity_changed ) <nl> - elif connectivity in ( grpc . ChannelConnectivity . IDLE , <nl> - grpc . ChannelConnectivity . CONNECTING ) : <nl> - pass <nl> - else : <nl> - self . fail ( " Encountered unknown state . " ) <nl> - <nl> - channel . subscribe ( _on_connectivity_changed ) <nl> - <nl> - def _send_rpc ( ) : <nl> - try : <nl> + with self . assertRaises ( grpc . RpcError ) as cm : <nl> response = grpc . experimental . unary_unary ( _REQUEST , <nl> target , <nl> - _UNARY_UNARY , <nl> - insecure = True ) <nl> - rpc_finished_event . set ( ) <nl> - except Exception as e : <nl> - rpc_failed_event . set ( ) <nl> - <nl> - t = threading . Thread ( target = _send_rpc ) <nl> - t . start ( ) <nl> - t . join ( ) <nl> - self . assertFalse ( rpc_failed_event . is_set ( ) ) <nl> - self . assertTrue ( rpc_finished_event . is_set ( ) ) <nl> - if server is not None : <nl> - server . stop ( None ) <nl> + _BLACK_HOLE , <nl> + insecure = True , <nl> + * * invocation_args ) <nl> + self . assertEqual ( grpc . StatusCode . DEADLINE_EXCEEDED , cm . exception . code ( ) ) <nl> + <nl> + def test_default_timeout ( self ) : <nl> + not_present = object ( ) <nl> + wait_for_ready_values = [ True , not_present ] <nl> + timeout_values = [ 0 . 5 , not_present ] <nl> + cases = [ ] <nl> + for wait_for_ready in wait_for_ready_values : <nl> + for timeout in timeout_values : <nl> + case = { } <nl> + if timeout is not not_present : <nl> + case [ " timeout " ] = timeout <nl> + if wait_for_ready is not not_present : <nl> + case [ " wait_for_ready " ] = wait_for_ready <nl> + cases . append ( case ) <nl> + <nl> + for case in cases : <nl> + with self . subTest ( * * case ) : <nl> + self . assert_times_out ( case ) <nl> <nl> <nl> if __name__ = = " __main__ " : <nl>
Support infinite timeouts
grpc/grpc
6344b2b97f409e3c3c37becc19e07ad6ad43fd60
2020-06-10T18:48:22Z
mmm a / src / video_core / renderer_opengl / gl_shader_decompiler . cpp <nl> ppp b / src / video_core / renderer_opengl / gl_shader_decompiler . cpp <nl> class GLSLGenerator { <nl> switch ( instr . conversion . f2f . rounding ) { <nl> case Tegra : : Shader : : F2fRoundingOp : : None : <nl> break ; <nl> + case Tegra : : Shader : : F2fRoundingOp : : Round : <nl> + op_a = " roundEven ( " + op_a + ' ) ' ; <nl> + break ; <nl> case Tegra : : Shader : : F2fRoundingOp : : Floor : <nl> op_a = " floor ( " + op_a + ' ) ' ; <nl> break ; <nl>
Merge pull request from Subv / f2f_round
yuzu-emu/yuzu
637f9d780ad960fd58577559a819adbb5069c9b1
2018-07-05T15:30:29Z
mmm a / plugins / account_history_plugin / account_history_plugin . cpp <nl> ppp b / plugins / account_history_plugin / account_history_plugin . cpp <nl> void account_history_plugin_impl : : applied_block ( const signed_block & block ) <nl> if ( check_relevance & & ! is_scope_relevant ( trx . scope ) ) <nl> continue ; <nl> <nl> + auto trx_obj_ptr = db . find < transaction_history_object , by_trx_id > ( trx . id ( ) ) ; <nl> + if ( trx_obj_ptr ! = nullptr ) <nl> + continue ; / / on restart may already have block <nl> + <nl> db . create < transaction_history_object > ( [ & block_id , & trx ] ( transaction_history_object & transaction_history ) { <nl> transaction_history . block_id = block_id ; <nl> transaction_history . transaction_id = trx . id ( ) ; <nl> void account_history_plugin_impl : : applied_block ( const signed_block & block ) <nl> <nl> for ( const auto & account_name : trx . scope ) <nl> { <nl> - db . create < account_transaction_history_object > ( [ & trx , & account_name ] ( account_transaction_history_object & account_transaction_history ) { <nl> - account_transaction_history . name = account_name ; <nl> - account_transaction_history . transaction_id = trx . id ( ) ; <nl> - } ) ; <nl> + db . create < account_transaction_history_object > ( [ & trx , & account_name ] ( account_transaction_history_object & account_transaction_history ) { <nl> + account_transaction_history . name = account_name ; <nl> + account_transaction_history . transaction_id = trx . id ( ) ; <nl> + } ) ; <nl> } <nl> <nl> for ( const chain : : message & msg : trx . messages ) <nl> mmm a / plugins / net_plugin / net_plugin . cpp <nl> ppp b / plugins / net_plugin / net_plugin . cpp <nl> namespace eosio { <nl> void operator ( ) ( node_transaction_state & nts ) { <nl> nts . received = fc : : time_point : : now ( ) ; <nl> nts . validated = true ; <nl> - size_t packsiz = fc : : raw : : pack_size ( txn ) ; <nl> - size_t bufsiz = packsiz + sizeof ( packsiz ) ; <nl> + net_message msg ( txn ) ; <nl> + uint32_t packsiz = fc : : raw : : pack_size ( msg ) ; <nl> + uint32_t bufsiz = packsiz + sizeof ( packsiz ) ; <nl> nts . packed_transaction . resize ( bufsiz ) ; <nl> fc : : datastream < char * > ds ( nts . packed_transaction . data ( ) , bufsiz ) ; <nl> ds . write ( reinterpret_cast < char * > ( & packsiz ) , sizeof ( packsiz ) ) ; <nl> - fc : : raw : : pack ( ds , txn ) ; <nl> + fc : : raw : : pack ( ds , msg ) ; <nl> } <nl> } ; <nl> <nl> namespace eosio { <nl> try { <nl> / / If it is a signed_block , then save the raw message for the cache <nl> / / This must be done before we unpack the message . <nl> - unsigned_int which ; <nl> + / / This code is copied from fc : : io : : unpack ( . . . , unsigned_int ) <nl> auto index = pending_message_buffer . read_index ( ) ; <nl> - pending_message_buffer . peek ( & which , sizeof ( unsigned_int ) , index ) ; <nl> - if ( which = = uint32_t ( net_message : : tag < signed_block > : : value ) ) { <nl> + uint64_t which = 0 ; char b = 0 ; uint8_t by = 0 ; <nl> + do { <nl> + pending_message_buffer . peek ( & b , 1 , index ) ; <nl> + which | = uint32_t ( uint8_t ( b ) & 0x7f ) < < by ; <nl> + by + = 7 ; <nl> + } while ( uint8_t ( b ) & 0x80 ) ; <nl> + <nl> + if ( which = = uint64_t ( net_message : : tag < signed_block > : : value ) ) { <nl> blk_buffer . resize ( message_length ) ; <nl> auto index = pending_message_buffer . read_index ( ) ; <nl> pending_message_buffer . peek ( blk_buffer . data ( ) , message_length , index ) ; <nl> namespace eosio { <nl> <nl> size_t net_plugin_impl : : cache_txn ( const transaction_id_type txnid , <nl> const signed_transaction & txn ) { <nl> - size_t packsiz = fc : : raw : : pack_size ( txn ) ; <nl> - size_t bufsiz = packsiz + sizeof ( packsiz ) ; <nl> + net_message msg ( txn ) ; <nl> + uint32_t packsiz = fc : : raw : : pack_size ( msg ) ; <nl> + uint32_t bufsiz = packsiz + sizeof ( packsiz ) ; <nl> vector < char > buff ( bufsiz ) ; <nl> fc : : datastream < char * > ds ( buff . data ( ) , bufsiz ) ; <nl> ds . write ( reinterpret_cast < char * > ( & packsiz ) , sizeof ( packsiz ) ) ; <nl> <nl> - fc : : raw : : pack ( ds , txn ) ; <nl> + fc : : raw : : pack ( ds , msg ) ; <nl> <nl> uint16_t bn = static_cast < uint16_t > ( txn . ref_block_num ) ; <nl> node_transaction_state nts = { txnid , time_point : : now ( ) , <nl>
Merge pull request from PaulCalabrese / STAT - 188 - GH - 743 - Fix - eosd - restart - issues
EOSIO/eos
02b2152f0b1de177f70dbf86182c36592c7c7602
2017-11-30T16:11:46Z
mmm a / include / swift / AST / ASTPrinter . h <nl> ppp b / include / swift / AST / ASTPrinter . h <nl> class StreamPrinter : public ASTPrinter { <nl> void printText ( StringRef Text ) override ; <nl> } ; <nl> <nl> + / / / AST stream printer that adds extra indentation to each line . <nl> + class ExtraIndentStreamPrinter : public StreamPrinter { <nl> + StringRef ExtraIndent ; <nl> + <nl> + public : <nl> + ExtraIndentStreamPrinter ( raw_ostream & out , StringRef extraIndent ) <nl> + : StreamPrinter ( out ) , ExtraIndent ( extraIndent ) { } <nl> + <nl> + virtual void printIndent ( ) { <nl> + printText ( ExtraIndent ) ; <nl> + StreamPrinter : : printIndent ( ) ; <nl> + } <nl> + } ; <nl> + <nl> bool shouldPrint ( const Decl * D , PrintOptions & Options ) ; <nl> bool shouldPrintPattern ( const Pattern * P , PrintOptions & Options ) ; <nl> <nl> mmm a / include / swift / AST / DiagnosticsSema . def <nl> ppp b / include / swift / AST / DiagnosticsSema . def <nl> NOTE ( inherited_protocol_does_not_conform , none , <nl> " type % 0 does not conform to inherited protocol % 1 " , ( Type , Type ) ) <nl> NOTE ( no_witnesses , none , <nl> " protocol requires % select { initializer % 1 | function % 1 | property % 1 | " <nl> - " subscript } 0 with type % 2 " , ( RequirementKind , DeclName , Type ) ) <nl> + " subscript } 0 with type % 2 ; do you want to add a stub ? " , <nl> + ( RequirementKind , DeclName , Type ) ) <nl> NOTE ( ambiguous_witnesses , none , <nl> " multiple matching " <nl> " % select { initializers named % 1 | functions named % 1 | properties named % 1 | " <nl> NOTE ( ambiguous_witnesses_wrong_name , none , <nl> " % select { initializers named % 1 | functions named % 1 | properties named % 1 | " <nl> " subscript operators } 0 with type % 2 " , ( RequirementKind , DeclName , Type ) ) <nl> NOTE ( no_witnesses_type , none , <nl> - " protocol requires nested type % 0 " , ( Identifier ) ) <nl> + " protocol requires nested type % 0 ; do you want to add it ? " , ( Identifier ) ) <nl> NOTE ( default_associated_type_req_fail , none , <nl> " default type % 0 for associated type % 1 ( from protocol % 2 ) " <nl> " does not conform to % 3 " , <nl> mmm a / include / swift / AST / PrintOptions . h <nl> ppp b / include / swift / AST / PrintOptions . h <nl> class NominalTypeDecl ; <nl> class TypeBase ; <nl> class DeclContext ; <nl> class Type ; <nl> + class ModuleDecl ; <nl> enum DeclAttrKind : unsigned ; <nl> class PrinterTypeTransformer ; <nl> class SynthesizedExtensionAnalyzer ; <nl> struct PrintOptions { <nl> / / / \ brief Print types with alternative names from their canonical names . <nl> llvm : : DenseMap < CanType , Identifier > * AlternativeTypeNames = nullptr ; <nl> <nl> + / / / \ brief The module in which the printer is used . Determines if the module <nl> + / / / name should be printed when printing a type . <nl> + ModuleDecl * CurrentModule ; <nl> + <nl> / / / \ brief The information for converting archetypes to specialized types . <nl> std : : shared_ptr < TypeTransformContext > TransformContext ; <nl> <nl> + / / / \ brief If this is not \ c nullptr then functions ( incuding accessors and <nl> + / / / constructors ) will be printed with a body that is determined by this <nl> + / / / function . <nl> + std : : function < std : : string ( const ValueDecl * ) > FunctionBody ; <nl> + <nl> BracketOptions BracketOptions ; <nl> <nl> / / / Retrieve the set of options for verbose printing to users . <nl> struct PrintOptions { <nl> <nl> void setArchetypeSelfTransformForQuickHelp ( Type T , DeclContext * DC ) ; <nl> <nl> + void setArchetypeAndDynamicSelfTransform ( Type T , DeclContext * DC ) ; <nl> + <nl> void initArchetypeTransformerForSynthesizedExtensions ( NominalTypeDecl * D , <nl> SynthesizedExtensionAnalyzer * SynAnalyzer ) ; <nl> <nl> mmm a / lib / AST / ASTPrinter . cpp <nl> ppp b / lib / AST / ASTPrinter . cpp <nl> class PrinterArchetypeNameTransformer : public PrinterTypeTransformer { <nl> } ; <nl> <nl> class ArchetypeSelfTransformer : public PrinterTypeTransformer { <nl> + protected : <nl> Type BaseTy ; <nl> DeclContext & DC ; <nl> const ASTContext & Ctx ; <nl> class ArchetypeSelfTransformer : public PrinterTypeTransformer { <nl> } <nl> } ; <nl> <nl> + class ArchetypeAndDynamicSelfTransformer : public ArchetypeSelfTransformer { <nl> + public : <nl> + using ArchetypeSelfTransformer : : ArchetypeSelfTransformer ; <nl> + <nl> + Type transform ( Type Ty ) override { <nl> + if ( Ty - > is < DynamicSelfType > ( ) ) { <nl> + return BaseTy ; <nl> + } <nl> + return ArchetypeSelfTransformer : : transform ( Ty ) ; <nl> + } <nl> + <nl> + StringRef transform ( StringRef TypeName ) override { <nl> + if ( TypeName = = " Self " ) { <nl> + std : : unique_ptr < std : : string > pBuffer ( new std : : string ) ; <nl> + llvm : : raw_string_ostream OS ( * pBuffer ) ; <nl> + BaseTy . print ( OS ) ; <nl> + OS . str ( ) ; <nl> + Buffers . push_back ( std : : move ( pBuffer ) ) ; <nl> + return StringRef ( * Buffers . back ( ) ) ; <nl> + } <nl> + return ArchetypeSelfTransformer : : transform ( TypeName ) ; <nl> + } <nl> + } ; <nl> + <nl> struct SynthesizedExtensionAnalyzer : : Implementation { <nl> static bool isMemberFavored ( const NominalTypeDecl * Target , const Decl * D ) { <nl> DeclContext * DC = Target - > getDeclContext ( ) ; <nl> void PrintOptions : : setArchetypeSelfTransformForQuickHelp ( Type T , <nl> new ArchetypeSelfTransformer ( T , * DC ) ) ; <nl> } <nl> <nl> + void PrintOptions : : setArchetypeAndDynamicSelfTransform ( Type T , <nl> + DeclContext * DC ) { <nl> + TransformContext = std : : make_shared < TypeTransformContext > ( <nl> + new ArchetypeAndDynamicSelfTransformer ( T , * DC ) ) ; <nl> + } <nl> + <nl> void PrintOptions : : <nl> initArchetypeTransformerForSynthesizedExtensions ( NominalTypeDecl * D , <nl> SynthesizedExtensionAnalyzer * Analyzer ) { <nl> void PrintAST : : printAccessors ( AbstractStorageDecl * ASD ) { <nl> / / We sometimes want to print the accessors abstractly <nl> / / instead of listing out how they ' re actually implemented . <nl> bool inProtocol = isa < ProtocolDecl > ( ASD - > getDeclContext ( ) ) ; <nl> - if ( inProtocol | | <nl> - ( Options . AbstractAccessors & & ! Options . FunctionDefinitions ) ) { <nl> + if ( ! Options . FunctionBody & & <nl> + ( inProtocol | | <nl> + ( Options . AbstractAccessors & & ! Options . FunctionDefinitions ) ) ) { <nl> bool mutatingGetter = ASD - > getGetter ( ) & & ASD - > isGetterMutating ( ) ; <nl> bool settable = ASD - > isSettable ( nullptr ) ; <nl> bool nonmutatingSetter = false ; <nl> void PrintAST : : printAccessors ( AbstractStorageDecl * ASD ) { <nl> <nl> / / Otherwise , print all the concrete defining accessors . <nl> <nl> - bool PrintAccessorBody = Options . FunctionDefinitions ; <nl> + bool PrintAccessorBody = Options . FunctionDefinitions | | Options . FunctionBody ; <nl> <nl> auto PrintAccessor = [ & ] ( FuncDecl * Accessor , StringRef Label ) { <nl> if ( ! Accessor ) <nl> void PrintAST : : printAccessors ( AbstractStorageDecl * ASD ) { <nl> <nl> case AbstractStorageDecl : : StoredWithTrivialAccessors : <nl> case AbstractStorageDecl : : Computed : <nl> - PrintAccessor ( ASD - > getGetter ( ) , " get " ) ; <nl> - PrintAccessor ( ASD - > getSetter ( ) , " set " ) ; <nl> + if ( ASD - > getGetter ( ) & & ! ASD - > getSetter ( ) & & PrintAccessorBody & & <nl> + ! Options . FunctionDefinitions ) { <nl> + / / Omit the ' get ' keyword . Directly print getter <nl> + if ( auto BodyFunc = Options . FunctionBody ) { <nl> + Printer . printNewline ( ) ; <nl> + IndentRAII IndentBody ( * this ) ; <nl> + indent ( ) ; <nl> + Printer < < BodyFunc ( ASD - > getGetter ( ) ) ; <nl> + } <nl> + } else { <nl> + PrintAccessor ( ASD - > getGetter ( ) , " get " ) ; <nl> + PrintAccessor ( ASD - > getSetter ( ) , " set " ) ; <nl> + } <nl> break ; <nl> <nl> case AbstractStorageDecl : : StoredWithObservers : <nl> void PrintAST : : visitFuncDecl ( FuncDecl * decl ) { <nl> } ) ; <nl> Printer < < " { " ; <nl> } <nl> - if ( Options . FunctionDefinitions & & decl - > getBody ( ) ) { <nl> + if ( auto BodyFunc = Options . FunctionBody ) { <nl> + { <nl> + IndentRAII IndentBody ( * this ) ; <nl> + indent ( ) ; <nl> + Printer . printNewline ( ) ; <nl> + Printer < < BodyFunc ( decl ) ; <nl> + } <nl> + indent ( ) ; <nl> + Printer . printNewline ( ) ; <nl> + } else if ( Options . FunctionDefinitions & & decl - > getBody ( ) ) { <nl> if ( printASTNodes ( decl - > getBody ( ) - > getElements ( ) ) ) { <nl> Printer . printNewline ( ) ; <nl> indent ( ) ; <nl> void PrintAST : : visitFuncDecl ( FuncDecl * decl ) { <nl> } <nl> } <nl> <nl> - if ( ! Options . FunctionDefinitions | | ! decl - > getBody ( ) ) { <nl> - return ; <nl> - } <nl> + if ( auto BodyFunc = Options . FunctionBody ) { <nl> + Printer < < " { " ; <nl> + Printer . printNewline ( ) ; <nl> + { <nl> + IndentRAII IndentBody ( * this ) ; <nl> + indent ( ) ; <nl> + Printer < < BodyFunc ( decl ) ; <nl> + } <nl> + indent ( ) ; <nl> + Printer . printNewline ( ) ; <nl> + Printer < < " } " ; <nl> <nl> - Printer < < " " ; <nl> - visit ( decl - > getBody ( ) ) ; <nl> + } else if ( Options . FunctionDefinitions & & decl - > getBody ( ) ) { <nl> + Printer < < " " ; <nl> + visit ( decl - > getBody ( ) ) ; <nl> + } <nl> } <nl> } <nl> <nl> void PrintAST : : visitConstructorDecl ( ConstructorDecl * decl ) { <nl> printFunctionParameters ( decl ) ; <nl> } ) ; <nl> <nl> - if ( ! Options . FunctionDefinitions | | ! decl - > getBody ( ) ) { <nl> - return ; <nl> + if ( auto BodyFunc = Options . FunctionBody ) { <nl> + Printer < < " { " ; <nl> + { <nl> + Printer . printNewline ( ) ; <nl> + IndentRAII IndentBody ( * this ) ; <nl> + indent ( ) ; <nl> + Printer < < BodyFunc ( decl ) ; <nl> + } <nl> + indent ( ) ; <nl> + Printer . printNewline ( ) ; <nl> + Printer < < " } " ; <nl> + } else if ( Options . FunctionDefinitions & & decl - > getBody ( ) ) { <nl> + Printer < < " " ; <nl> + visit ( decl - > getBody ( ) ) ; <nl> } <nl> - <nl> - Printer < < " " ; <nl> - visit ( decl - > getBody ( ) ) ; <nl> } <nl> <nl> void PrintAST : : visitDestructorDecl ( DestructorDecl * decl ) { <nl> class TypePrinter : public TypeVisitor < TypePrinter > { <nl> <nl> Module * M = D - > getDeclContext ( ) - > getParentModule ( ) ; <nl> <nl> + if ( Options . CurrentModule & & M = = Options . CurrentModule ) { <nl> + return false ; <nl> + } <nl> + <nl> / / Don ' t print qualifiers for types from the standard library . <nl> if ( M - > isStdlibModule ( ) | | <nl> M - > getName ( ) = = M - > getASTContext ( ) . Id_ObjectiveC | | <nl> mmm a / lib / Sema / TypeCheckDecl . cpp <nl> ppp b / lib / Sema / TypeCheckDecl . cpp <nl> static void diagnoseClassWithoutInitializers ( TypeChecker & tc , <nl> } <nl> } <nl> <nl> - namespace { <nl> - / / / AST stream printer that adds extra indentation to each line . <nl> - class ExtraIndentStreamPrinter : public StreamPrinter { <nl> - StringRef ExtraIndent ; <nl> - <nl> - public : <nl> - ExtraIndentStreamPrinter ( raw_ostream & out , StringRef extraIndent ) <nl> - : StreamPrinter ( out ) , ExtraIndent ( extraIndent ) { } <nl> - <nl> - virtual void printIndent ( ) { <nl> - printText ( ExtraIndent ) ; <nl> - StreamPrinter : : printIndent ( ) ; <nl> - } <nl> - } ; <nl> - } <nl> - <nl> / / / Diagnose a missing required initializer . <nl> static void diagnoseMissingRequiredInitializer ( <nl> TypeChecker & TC , <nl> mmm a / lib / Sema / TypeCheckProtocol . cpp <nl> ppp b / lib / Sema / TypeCheckProtocol . cpp <nl> <nl> # include " swift / Basic / StringExtras . h " <nl> # include " swift / AST / ArchetypeBuilder . h " <nl> # include " swift / AST / ASTContext . h " <nl> + # include " swift / AST / ASTPrinter . h " <nl> # include " swift / AST / Decl . h " <nl> # include " swift / AST / NameLookup . h " <nl> # include " swift / AST / ReferencedNameTracker . h " <nl> void ConformanceChecker : : recordTypeWitness ( AssociatedTypeDecl * assocType , <nl> typeDecl ) ; <nl> } <nl> <nl> + / / / Generates a note for a protocol requirement for which no witness was found <nl> + / / / and provides a fixit to add a stub to the adopter <nl> + static void diagnoseNoWitness ( ValueDecl * Requirement , Type RequirementType , <nl> + NormalProtocolConformance * Conformance , <nl> + TypeChecker & TC ) { <nl> + SourceLoc FixitLocation ; <nl> + SourceLoc TypeLoc ; <nl> + if ( auto Extension = dyn_cast < ExtensionDecl > ( Conformance - > getDeclContext ( ) ) ) { <nl> + FixitLocation = Extension - > getBraces ( ) . Start . getAdvancedLocOrInvalid ( 1 ) ; <nl> + TypeLoc = Extension - > getStartLoc ( ) ; <nl> + } else if ( auto Nominal = <nl> + dyn_cast < NominalTypeDecl > ( Conformance - > getDeclContext ( ) ) ) { <nl> + FixitLocation = Nominal - > getBraces ( ) . Start . getAdvancedLocOrInvalid ( 1 ) ; <nl> + TypeLoc = Nominal - > getStartLoc ( ) ; <nl> + } else { <nl> + llvm_unreachable ( " Unknown adopter kind " ) ; <nl> + } <nl> + <nl> + / / FIXME : Infer body indention from the source rather than hard - coding <nl> + / / 4 spaces . <nl> + std : : string ExtraIndent = " " ; <nl> + StringRef CurrentIndent = Lexer : : getIndentationForLine ( TC . Context . SourceMgr , <nl> + TypeLoc ) ; <nl> + std : : string StubIndent = CurrentIndent . str ( ) + ExtraIndent ; <nl> + <nl> + std : : string FixitString ; <nl> + llvm : : raw_string_ostream FixitStream ( FixitString ) ; <nl> + ExtraIndentStreamPrinter Printer ( FixitStream , StubIndent ) ; <nl> + <nl> + if ( auto MissingTypeWitness = dyn_cast < AssociatedTypeDecl > ( Requirement ) ) { <nl> + Printer . printNewline ( ) ; <nl> + Printer < < " typealias " < < MissingTypeWitness - > getName ( ) < < " = < # type # > " ; <nl> + Printer < < " \ n " ; <nl> + <nl> + TC . diagnose ( MissingTypeWitness , diag : : no_witnesses_type , <nl> + MissingTypeWitness - > getName ( ) ) <nl> + . fixItInsert ( FixitLocation , FixitStream . str ( ) ) ; <nl> + } else { <nl> + <nl> + PrintOptions Options = PrintOptions : : printForDiagnostics ( ) ; <nl> + Options . AccessibilityFilter = Accessibility : : Private ; <nl> + Options . FunctionBody = [ ] ( const ValueDecl * VD ) { return " < # code # > " ; } ; <nl> + if ( isa < ClassDecl > ( Conformance - > getDeclContext ( ) ) ) { <nl> + Type SelfType = Conformance - > getDeclContext ( ) - > getSelfTypeInContext ( ) ; <nl> + DeclContext * Adopter = Conformance - > getDeclContext ( ) ; <nl> + Options . setArchetypeSelfTransform ( SelfType , Adopter ) ; <nl> + } else { <nl> + Type SelfType = Conformance - > getDeclContext ( ) - > getSelfTypeInContext ( ) ; <nl> + DeclContext * Adopter = Conformance - > getDeclContext ( ) ; <nl> + Options . setArchetypeAndDynamicSelfTransform ( SelfType , Adopter ) ; <nl> + } <nl> + Options . CurrentModule = Conformance - > getDeclContext ( ) - > getParentModule ( ) ; <nl> + if ( isa < NominalTypeDecl > ( Conformance - > getDeclContext ( ) ) ) { <nl> + / / Create a variable declaration instead of a computed property in nominal <nl> + / / types <nl> + Options . PrintPropertyAccessors = false ; <nl> + } <nl> + <nl> + Printer . printNewline ( ) ; <nl> + Requirement - > print ( Printer , Options ) ; <nl> + Printer < < " \ n " ; <nl> + <nl> + / / Point out the requirement that wasn ' t met . <nl> + TC . diagnose ( Requirement , diag : : no_witnesses , <nl> + getRequirementKind ( Requirement ) , <nl> + Requirement - > getFullName ( ) , <nl> + RequirementType ) <nl> + . fixItInsert ( FixitLocation , FixitStream . str ( ) ) ; <nl> + } <nl> + } <nl> + <nl> ResolveWitnessResult <nl> ConformanceChecker : : resolveWitnessViaLookup ( ValueDecl * requirement ) { <nl> assert ( ! isa < AssociatedTypeDecl > ( requirement ) & & " Use resolveTypeWitnessVia * " ) ; <nl> ConformanceChecker : : resolveWitnessViaLookup ( ValueDecl * requirement ) { <nl> Type reqType = getRequirementTypeForDisplay ( tc , dc - > getParentModule ( ) , <nl> conformance , requirement ) ; <nl> <nl> - / / Point out the requirement that wasn ' t met . <nl> - tc . diagnose ( requirement , <nl> - numViable > 0 ? ( ignoringNames <nl> - ? diag : : ambiguous_witnesses_wrong_name <nl> - : diag : : ambiguous_witnesses ) <nl> - : diag : : no_witnesses , <nl> - getRequirementKind ( requirement ) , <nl> - requirement - > getFullName ( ) , <nl> - reqType ) ; <nl> + if ( numViable > 0 ) { <nl> + auto diagnosticMessage = diag : : ambiguous_witnesses ; <nl> + if ( ignoringNames ) { <nl> + diagnosticMessage = diag : : ambiguous_witnesses_wrong_name ; <nl> + } <nl> + tc . diagnose ( requirement , diagnosticMessage , <nl> + getRequirementKind ( requirement ) , <nl> + requirement - > getFullName ( ) , <nl> + reqType ) ; <nl> + } else { <nl> + / / Generate diagnostics for the missing requirement and a fixit to add <nl> + / / it <nl> + diagnoseNoWitness ( requirement , reqType , conformance , tc ) ; <nl> + } <nl> <nl> / / Diagnose each of the matches . <nl> for ( const auto & match : matches ) <nl> ConformanceChecker : : resolveWitnessViaLookup ( ValueDecl * requirement ) { <nl> match ) ; <nl> } ) ; <nl> <nl> - <nl> - / / FIXME : Suggest a new declaration that does match ? <nl> - <nl> return ResolveWitnessResult : : ExplicitFailed ; <nl> } <nl> <nl> void ConformanceChecker : : resolveTypeWitnesses ( ) { <nl> diagnoseOrDefer ( missingTypeWitness , true , <nl> [ missingTypeWitness ] ( TypeChecker & tc , <nl> NormalProtocolConformance * conformance ) { <nl> - tc . diagnose ( missingTypeWitness , diag : : no_witnesses_type , <nl> - missingTypeWitness - > getName ( ) ) ; <nl> + diagnoseNoWitness ( missingTypeWitness , Type ( ) , conformance , tc ) ; <nl> } ) ; <nl> } <nl> <nl> mmm a / test / ClangModules / objc_bridging_custom . swift <nl> ppp b / test / ClangModules / objc_bridging_custom . swift <nl> class Sub : Base { <nl> } <nl> <nl> protocol TestProto { <nl> - func test ( a : Refrigerator , b : Refrigerator ) - > Refrigerator ? / / expected - note { { protocol requires } } { { none } } <nl> - func testGeneric ( a : ManufacturerInfo < NSString > , b : ManufacturerInfo < NSString > ) - > ManufacturerInfo < NSString > ? / / expected - note { { protocol requires } } { { none } } <nl> - static func testInout ( _ : inout Refrigerator ) / / expected - note { { protocol requires } } { { none } } <nl> - func testUnmigrated ( a : RuncingMode , b : Refrigerator , c : NSCoding ) / / expected - note { { protocol requires } } { { none } } <nl> - func testPartialMigrated ( a : RuncingMode , b : Refrigerator ) / / expected - note { { protocol requires } } { { none } } <nl> + func test ( a : Refrigerator , b : Refrigerator ) - > Refrigerator ? / / expected - note { { protocol requires } } <nl> + func testGeneric ( a : ManufacturerInfo < NSString > , b : ManufacturerInfo < NSString > ) - > ManufacturerInfo < NSString > ? / / expected - note { { protocol requires } } <nl> + static func testInout ( _ : inout Refrigerator ) / / expected - note { { protocol requires } } <nl> + func testUnmigrated ( a : RuncingMode , b : Refrigerator , c : NSCoding ) / / expected - note { { protocol requires } } <nl> + func testPartialMigrated ( a : RuncingMode , b : Refrigerator ) / / expected - note { { protocol requires } } <nl> <nl> - subscript ( a a : Refrigerator , b b : Refrigerator ) - > Refrigerator ? { get } / / expected - note { { protocol requires } } { { none } } <nl> - subscript ( generic a : ManufacturerInfo < NSString > , b b : ManufacturerInfo < NSString > ) - > ManufacturerInfo < NSString > ? { get } / / expected - note { { protocol requires } } { { none } } <nl> + subscript ( a a : Refrigerator , b b : Refrigerator ) - > Refrigerator ? { get } / / expected - note { { protocol requires } } <nl> + subscript ( generic a : ManufacturerInfo < NSString > , b b : ManufacturerInfo < NSString > ) - > ManufacturerInfo < NSString > ? { get } / / expected - note { { protocol requires } } <nl> <nl> - init ? ( a : Refrigerator , b : Refrigerator ) / / expected - note { { protocol requires } } { { none } } <nl> - init ? ( generic : ManufacturerInfo < NSString > , b : ManufacturerInfo < NSString > ) / / expected - note { { protocol requires } } { { none } } <nl> - init ( singleArgument : Refrigerator ) / / expected - note { { protocol requires } } { { none } } <nl> + init ? ( a : Refrigerator , b : Refrigerator ) / / expected - note { { protocol requires } } <nl> + init ? ( generic : ManufacturerInfo < NSString > , b : ManufacturerInfo < NSString > ) / / expected - note { { protocol requires } } <nl> + init ( singleArgument : Refrigerator ) / / expected - note { { protocol requires } } <nl> <nl> - var prop : Refrigerator ? { get } / / expected - note { { protocol requires } } { { none } } <nl> - var propGeneric : ManufacturerInfo < NSString > ? { get } / / expected - note { { protocol requires } } { { none } } <nl> + var prop : Refrigerator ? { get } / / expected - note { { protocol requires } } <nl> + var propGeneric : ManufacturerInfo < NSString > ? { get } / / expected - note { { protocol requires } } <nl> } <nl> <nl> class TestProtoImpl : NSObject , TestProto { / / expected - error { { type ' TestProtoImpl ' does not conform to protocol ' TestProto ' } } <nl> new file mode 100644 <nl> index 000000000000 . . 2570a6c59d73 <nl> mmm / dev / null <nl> ppp b / test / decl / protocol / conforms / fixit_stub . swift <nl> <nl> + / / RUN : % target - parse - verify - swift <nl> + <nl> + protocol Protocol1 { <nl> + func foo ( arg1 : Int , arg2 : String ) - > String / / expected - note { { protocol requires function ' foo ( arg1 : arg2 : ) ' with type ' ( arg1 : Int , arg2 : String ) - > String ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal func foo ( arg1 : Int , arg2 : String ) - > String { \ n < # code # > \ n \ } \ n } } <nl> + func bar ( ) throws - > String / / expected - note { { protocol requires function ' bar ( ) ' with type ' ( ) throws - > String ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal func bar ( ) throws - > String { \ n < # code # > \ n \ } \ n } } <nl> + init ( arg : Int ) / / expected - note { { protocol requires initializer ' init ( arg : ) ' with type ' ( arg : Int ) ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal init ( arg : Int ) { \ n < # code # > \ n \ } \ n } } <nl> + var baz : Int { get } / / expected - note { { protocol requires property ' baz ' with type ' Int ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal var baz : Int \ n } } <nl> + var baz2 : Int { get set } / / expected - note { { protocol requires property ' baz2 ' with type ' Int ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal var baz2 : Int \ n } } <nl> + subscript ( arg : Int ) - > String { get } / / expected - note { { rotocol requires subscript with type ' ( Int ) - > String ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal subscript ( arg : Int ) - > String { \ n < # code # > \ n \ } \ n } } <nl> + subscript ( arg1 : Int , arg2 : Int ) - > String { get set } / / expected - note { { protocol requires subscript with type ' ( Int , Int ) - > String ' ; do you want to add a stub ? } } { { 27 - 27 = \ n internal subscript ( arg1 : Int , arg2 : Int ) - > String { \ n get { \ n < # code # > \ n \ } \ n set { \ n < # code # > \ n \ } \ n \ } \ n } } <nl> + } <nl> + <nl> + class Adopter : Protocol1 { / / expected - error { { type ' Adopter ' does not conform to protocol ' Protocol1 ' } } expected - note { { candidate has non - matching type ' ( ) ' } } <nl> + } <nl> + <nl> + <nl> + <nl> + protocol Protocol2 { <nl> + func foo ( arg1 : Int , arg2 : String ) - > String / / expected - note { { protocol requires function ' foo ( arg1 : arg2 : ) ' with type ' ( arg1 : Int , arg2 : String ) - > String ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal func foo ( arg1 : Int , arg2 : String ) - > String { \ n < # code # > \ n \ } \ n } } <nl> + func bar ( ) throws - > String / / expected - note { { protocol requires function ' bar ( ) ' with type ' ( ) throws - > String ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal func bar ( ) throws - > String { \ n < # code # > \ n \ } \ n } } <nl> + init ( arg : Int ) / / expected - note { { protocol requires initializer ' init ( arg : ) ' with type ' ( arg : Int ) ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal init ( arg : Int ) { \ n < # code # > \ n \ } \ n } } <nl> + var baz : Int { get } / / expected - note { { protocol requires property ' baz ' with type ' Int ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal var baz : Int { \ n < # code # > \ n \ } \ n } } <nl> + var baz2 : Int { get set } / / expected - note { { protocol requires property ' baz2 ' with type ' Int ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal var baz2 : Int { \ n get { \ n < # code # > \ n \ } \ n set { \ n < # code # > \ n \ } \ n \ } \ n } } <nl> + subscript ( arg : Int ) - > String { get } / / expected - note { { rotocol requires subscript with type ' ( Int ) - > String ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal subscript ( arg : Int ) - > String { \ n < # code # > \ n \ } \ n } } <nl> + subscript ( arg1 : Int , arg2 : Int ) - > String { get set } / / expected - note { { protocol requires subscript with type ' ( Int , Int ) - > String ' ; do you want to add a stub ? } } { { 32 - 32 = \ n internal subscript ( arg1 : Int , arg2 : Int ) - > String { \ n get { \ n < # code # > \ n \ } \ n set { \ n < # code # > \ n \ } \ n \ } \ n } } <nl> + } <nl> + <nl> + class Adopter2 { } / / expected - note { { candidate has non - matching type ' ( ) ' } } <nl> + <nl> + extension Adopter2 : Protocol2 { / / expected - error { { ype ' Adopter2 ' does not conform to protocol ' Protocol2 ' } } <nl> + } <nl> + <nl> + <nl> + <nl> + protocol ProtocolWithAssocType { <nl> + associatedtype AssocType / / expected - note { { protocol requires nested type ' AssocType ' } } { { 41 - 41 = \ n typealias AssocType = < # type # > \ n } } <nl> + } <nl> + <nl> + struct Adopter3 : ProtocolWithAssocType { / / expected - error { { type ' Adopter3 ' does not conform to protocol ' ProtocolWithAssocType ' } } <nl> + } <nl> + <nl> + <nl> + <nl> + protocol ProtocolWithAssocType2 { <nl> + associatedtype AssocType / / expected - note { { protocol requires nested type ' AssocType ' ; do you want to add it ? } } { { 45 - 45 = \ n typealias AssocType = < # type # > \ n } } <nl> + } <nl> + <nl> + struct Adopter4 { <nl> + } <nl> + <nl> + extension Adopter4 : ProtocolWithAssocType2 { / / expected - error { { type ' Adopter4 ' does not conform to protocol ' ProtocolWithAssocType2 ' } } <nl> + } <nl> + <nl> + <nl> + <nl> + protocol ProtocolWithSelfRequirement { <nl> + func foo ( ) - > Self / / expected - note { { protocol requires function ' foo ( ) ' with type ' ( ) - > Self ' ; do you want to add a stub ? } } { { 47 - 47 = \ n internal func foo ( ) - > Adopter5 { \ n < # code # > \ n \ } \ n } } <nl> + func foo ( lhs : Self , rhs : Self ) - > Self / / expected - note { { protocol requires function ' foo ( lhs : rhs : ) ' with type ' ( lhs : Adopter5 , rhs : Adopter5 ) - > Self ' ; do you want to add a stub ? } } { { 47 - 47 = \ n internal func foo ( lhs : Adopter5 , rhs : Adopter5 ) - > Adopter5 { \ n < # code # > \ n \ } \ n } } <nl> + } <nl> + <nl> + struct Adopter5 : ProtocolWithSelfRequirement { / / expected - error { { type ' Adopter5 ' does not conform to protocol ' ProtocolWithSelfRequirement ' } } <nl> + } <nl> + <nl> + <nl> + <nl> + protocol ProtocolWithSelfRequirement2 { <nl> + func foo ( ) - > Self / / expected - note { { protocol requires function ' foo ( ) ' with type ' ( ) - > Self ' ; do you want to add a stub ? } } { { 51 - 51 = \ n internal func foo ( ) - > Adopter6 { \ n < # code # > \ n \ } \ n } } <nl> + func foo ( lhs : Self , rhs : Self ) - > Self / / expected - note { { protocol requires function ' foo ( lhs : rhs : ) ' with type ' ( lhs : Adopter6 , rhs : Adopter6 ) - > Self ' ; do you want to add a stub ? } } { { 51 - 51 = \ n internal func foo ( lhs : Adopter6 , rhs : Adopter6 ) - > Adopter6 { \ n < # code # > \ n \ } \ n } } <nl> + } <nl> + <nl> + struct Adopter6 { } <nl> + <nl> + extension Adopter6 : ProtocolWithSelfRequirement2 { / / expected - error { { type ' Adopter6 ' does not conform to protocol ' ProtocolWithSelfRequirement2 ' } } <nl> + } <nl> + <nl> + <nl> + protocol ProtocolWithSelfRequirement3 { <nl> + func foo ( ) - > Self / / expected - note { { protocol requires function ' foo ( ) ' with type ' ( ) - > Self ' ; do you want to add a stub ? } } { { 47 - 47 = \ n internal func foo ( ) - > Self { \ n < # code # > \ n \ } \ n } } <nl> + func foo ( lhs : Self , rhs : Self ) - > Self / / expected - note { { protocol requires function ' foo ( lhs : rhs : ) ' with type ' ( lhs : Adopter7 , rhs : Adopter7 ) - > Self ' ; do you want to add a stub ? } } { { 47 - 47 = \ n internal func foo ( lhs : Adopter7 , rhs : Adopter7 ) - > Self { \ n < # code # > \ n \ } \ n } } <nl> + } <nl> + <nl> + class Adopter7 : ProtocolWithSelfRequirement3 { / / expected - error { { type ' Adopter7 ' does not conform to protocol ' ProtocolWithSelfRequirement3 ' } } <nl> + } <nl>
[ Diag ] Fixits for missing protocol requirements
apple/swift
c3b5b305b220f50625dc067cfe86547d911d12df
2016-07-20T09:47:08Z
mmm a / Source / CNTK / tests . cpp <nl> ppp b / Source / CNTK / tests . cpp <nl> void TestSequenceReader ( const ConfigParameters & configBase ) <nl> / / setup minibatch matrices <nl> auto featuresMatrix = make_shared < Matrix < ElemType > > ( ) ; <nl> auto labelsMatrix = make_shared < Matrix < ElemType > > ( ) ; <nl> + MBLayoutPtr pMBLayout = make_shared < MBLayout > ( ) ; <nl> StreamMinibatchInputs matrices ; <nl> - matrices . AddInputMatrix ( featureNames [ 0 ] , featuresMatrix ) ; <nl> - matrices . AddInputMatrix ( labelNames [ 1 ] , labelsMatrix ) ; <nl> + matrices . AddInput ( featureNames [ 0 ] , featuresMatrix , pMBLayout , TensorShape ( ) ) ; <nl> + matrices . AddInput ( labelNames [ 0 ] , labelsMatrix , pMBLayout , TensorShape ( ) ) ; <nl> <nl> auto start = std : : chrono : : system_clock : : now ( ) ; <nl> int epochs = config ( " maxEpochs " ) ; <nl>
Fixed merge issue
microsoft/CNTK
67701e9bc9b2cf095ccd9b08728a41598e1ac8d6
2016-04-11T13:33:02Z
mmm a / src / inspector / js_protocol . json <nl> ppp b / src / inspector / js_protocol . json <nl> <nl> { <nl> " name " : " callFunctionOn " , <nl> " parameters " : [ <nl> - { " name " : " objectId " , " $ ref " : " RemoteObjectId " , " description " : " Identifier of the object to call function on . " } , <nl> { " name " : " functionDeclaration " , " type " : " string " , " description " : " Declaration of the function to call . " } , <nl> + { " name " : " objectId " , " $ ref " : " RemoteObjectId " , " optional " : true , " description " : " Identifier of the object to call function on . Either objectId or executionContextId should be specified . " } , <nl> { " name " : " arguments " , " type " : " array " , " items " : { " $ ref " : " CallArgument " , " description " : " Call argument . " } , " optional " : true , " description " : " Call arguments . All call arguments must belong to the same JavaScript world as the target object . " } , <nl> { " name " : " silent " , " type " : " boolean " , " optional " : true , " description " : " In silent mode exceptions thrown during evaluation are not reported and do not pause execution . Overrides < code > setPauseOnException < / code > state . " } , <nl> { " name " : " returnByValue " , " type " : " boolean " , " optional " : true , " description " : " Whether the result is expected to be a JSON object which should be sent by value . " } , <nl> { " name " : " generatePreview " , " type " : " boolean " , " optional " : true , " experimental " : true , " description " : " Whether preview should be generated for the result . " } , <nl> { " name " : " userGesture " , " type " : " boolean " , " optional " : true , " experimental " : true , " description " : " Whether execution should be treated as initiated by user in the UI . " } , <nl> - { " name " : " awaitPromise " , " type " : " boolean " , " optional " : true , " description " : " Whether execution should < code > await < / code > for resulting value and return once awaited promise is resolved . " } <nl> + { " name " : " awaitPromise " , " type " : " boolean " , " optional " : true , " description " : " Whether execution should < code > await < / code > for resulting value and return once awaited promise is resolved . " } , <nl> + { " name " : " executionContextId " , " $ ref " : " ExecutionContextId " , " optional " : true , " description " : " Specifies execution context which global object will be used to call function on . Either executionContextId or objectId should be specified . " } , <nl> + { " name " : " objectGroup " , " type " : " string " , " optional " : true , " description " : " Symbolic group name that can be used to release multiple objects . If objectGroup is not specified and objectId is , objectGroup will be inherited from object . " } <nl> ] , <nl> " returns " : [ <nl> { " name " : " result " , " $ ref " : " RemoteObject " , " description " : " Call result . " } , <nl> mmm a / src / inspector / v8 - runtime - agent - impl . cc <nl> ppp b / src / inspector / v8 - runtime - agent - impl . cc <nl> bool wrapEvaluateResultAsync ( InjectedScript * injectedScript , <nl> return false ; <nl> } <nl> <nl> + void innerCallFunctionOn ( <nl> + V8InspectorSessionImpl * session , InjectedScript : : Scope & scope , <nl> + v8 : : Local < v8 : : Value > recv , const String16 & expression , <nl> + Maybe < protocol : : Array < protocol : : Runtime : : CallArgument > > optionalArguments , <nl> + bool silent , bool returnByValue , bool generatePreview , bool userGesture , <nl> + bool awaitPromise , const String16 & objectGroup , <nl> + std : : unique_ptr < V8RuntimeAgentImpl : : CallFunctionOnCallback > callback ) { <nl> + V8InspectorImpl * inspector = session - > inspector ( ) ; <nl> + <nl> + std : : unique_ptr < v8 : : Local < v8 : : Value > [ ] > argv = nullptr ; <nl> + int argc = 0 ; <nl> + if ( optionalArguments . isJust ( ) ) { <nl> + protocol : : Array < protocol : : Runtime : : CallArgument > * arguments = <nl> + optionalArguments . fromJust ( ) ; <nl> + argc = static_cast < int > ( arguments - > length ( ) ) ; <nl> + argv . reset ( new v8 : : Local < v8 : : Value > [ argc ] ) ; <nl> + for ( int i = 0 ; i < argc ; + + i ) { <nl> + v8 : : Local < v8 : : Value > argumentValue ; <nl> + Response response = scope . injectedScript ( ) - > resolveCallArgument ( <nl> + arguments - > get ( i ) , & argumentValue ) ; <nl> + if ( ! response . isSuccess ( ) ) { <nl> + callback - > sendFailure ( response ) ; <nl> + return ; <nl> + } <nl> + argv [ i ] = argumentValue ; <nl> + } <nl> + } <nl> + <nl> + if ( silent ) scope . ignoreExceptionsAndMuteConsole ( ) ; <nl> + if ( userGesture ) scope . pretendUserGesture ( ) ; <nl> + <nl> + v8 : : MaybeLocal < v8 : : Value > maybeFunctionValue ; <nl> + v8 : : Local < v8 : : Script > functionScript ; <nl> + if ( inspector <nl> + - > compileScript ( scope . context ( ) , " ( " + expression + " ) " , String16 ( ) ) <nl> + . ToLocal ( & functionScript ) ) { <nl> + v8 : : MicrotasksScope microtasksScope ( inspector - > isolate ( ) , <nl> + v8 : : MicrotasksScope : : kRunMicrotasks ) ; <nl> + maybeFunctionValue = functionScript - > Run ( scope . context ( ) ) ; <nl> + } <nl> + / / Re - initialize after running client ' s code , as it could have destroyed <nl> + / / context or session . <nl> + Response response = scope . initialize ( ) ; <nl> + if ( ! response . isSuccess ( ) ) { <nl> + callback - > sendFailure ( response ) ; <nl> + return ; <nl> + } <nl> + <nl> + if ( scope . tryCatch ( ) . HasCaught ( ) ) { <nl> + wrapEvaluateResultAsync ( scope . injectedScript ( ) , maybeFunctionValue , <nl> + scope . tryCatch ( ) , objectGroup , false , false , <nl> + callback . get ( ) ) ; <nl> + return ; <nl> + } <nl> + <nl> + v8 : : Local < v8 : : Value > functionValue ; <nl> + if ( ! maybeFunctionValue . ToLocal ( & functionValue ) | | <nl> + ! functionValue - > IsFunction ( ) ) { <nl> + callback - > sendFailure ( <nl> + Response : : Error ( " Given expression does not evaluate to a function " ) ) ; <nl> + return ; <nl> + } <nl> + <nl> + v8 : : MaybeLocal < v8 : : Value > maybeResultValue ; <nl> + { <nl> + v8 : : MicrotasksScope microtasksScope ( inspector - > isolate ( ) , <nl> + v8 : : MicrotasksScope : : kRunMicrotasks ) ; <nl> + maybeResultValue = functionValue . As < v8 : : Function > ( ) - > Call ( <nl> + scope . context ( ) , recv , argc , argv . get ( ) ) ; <nl> + } <nl> + / / Re - initialize after running client ' s code , as it could have destroyed <nl> + / / context or session . <nl> + response = scope . initialize ( ) ; <nl> + if ( ! response . isSuccess ( ) ) { <nl> + callback - > sendFailure ( response ) ; <nl> + return ; <nl> + } <nl> + <nl> + if ( ! awaitPromise | | scope . tryCatch ( ) . HasCaught ( ) ) { <nl> + wrapEvaluateResultAsync ( scope . injectedScript ( ) , maybeResultValue , <nl> + scope . tryCatch ( ) , objectGroup , returnByValue , <nl> + generatePreview , callback . get ( ) ) ; <nl> + return ; <nl> + } <nl> + <nl> + scope . injectedScript ( ) - > addPromiseCallback ( <nl> + session , maybeResultValue , objectGroup , returnByValue , generatePreview , <nl> + EvaluateCallbackWrapper < V8RuntimeAgentImpl : : CallFunctionOnCallback > : : wrap ( <nl> + std : : move ( callback ) ) ) ; <nl> + } <nl> + <nl> Response ensureContext ( V8InspectorImpl * inspector , int contextGroupId , <nl> Maybe < int > executionContextId , int * contextId ) { <nl> if ( executionContextId . isJust ( ) ) { <nl> void V8RuntimeAgentImpl : : awaitPromise ( <nl> } <nl> <nl> void V8RuntimeAgentImpl : : callFunctionOn ( <nl> - const String16 & objectId , const String16 & expression , <nl> + const String16 & expression , Maybe < String16 > objectId , <nl> Maybe < protocol : : Array < protocol : : Runtime : : CallArgument > > optionalArguments , <nl> Maybe < bool > silent , Maybe < bool > returnByValue , Maybe < bool > generatePreview , <nl> Maybe < bool > userGesture , Maybe < bool > awaitPromise , <nl> + Maybe < int > executionContextId , Maybe < String16 > objectGroup , <nl> std : : unique_ptr < CallFunctionOnCallback > callback ) { <nl> - InjectedScript : : ObjectScope scope ( m_session , objectId ) ; <nl> - Response response = scope . initialize ( ) ; <nl> - if ( ! response . isSuccess ( ) ) { <nl> - callback - > sendFailure ( response ) ; <nl> - return ; <nl> - } <nl> - <nl> - std : : unique_ptr < v8 : : Local < v8 : : Value > [ ] > argv = nullptr ; <nl> - int argc = 0 ; <nl> - if ( optionalArguments . isJust ( ) ) { <nl> - protocol : : Array < protocol : : Runtime : : CallArgument > * arguments = <nl> - optionalArguments . fromJust ( ) ; <nl> - argc = static_cast < int > ( arguments - > length ( ) ) ; <nl> - argv . reset ( new v8 : : Local < v8 : : Value > [ argc ] ) ; <nl> - for ( int i = 0 ; i < argc ; + + i ) { <nl> - v8 : : Local < v8 : : Value > argumentValue ; <nl> - response = scope . injectedScript ( ) - > resolveCallArgument ( arguments - > get ( i ) , <nl> - & argumentValue ) ; <nl> - if ( ! response . isSuccess ( ) ) { <nl> - callback - > sendFailure ( response ) ; <nl> - return ; <nl> - } <nl> - argv [ i ] = argumentValue ; <nl> - } <nl> - } <nl> - <nl> - if ( silent . fromMaybe ( false ) ) scope . ignoreExceptionsAndMuteConsole ( ) ; <nl> - if ( userGesture . fromMaybe ( false ) ) scope . pretendUserGesture ( ) ; <nl> - <nl> - v8 : : MaybeLocal < v8 : : Value > maybeFunctionValue ; <nl> - v8 : : Local < v8 : : Script > functionScript ; <nl> - if ( m_inspector <nl> - - > compileScript ( scope . context ( ) , " ( " + expression + " ) " , String16 ( ) ) <nl> - . ToLocal ( & functionScript ) ) { <nl> - v8 : : MicrotasksScope microtasksScope ( m_inspector - > isolate ( ) , <nl> - v8 : : MicrotasksScope : : kRunMicrotasks ) ; <nl> - maybeFunctionValue = functionScript - > Run ( scope . context ( ) ) ; <nl> - } <nl> - / / Re - initialize after running client ' s code , as it could have destroyed <nl> - / / context or session . <nl> - response = scope . initialize ( ) ; <nl> - if ( ! response . isSuccess ( ) ) { <nl> - callback - > sendFailure ( response ) ; <nl> - return ; <nl> - } <nl> - <nl> - if ( scope . tryCatch ( ) . HasCaught ( ) ) { <nl> - wrapEvaluateResultAsync ( scope . injectedScript ( ) , maybeFunctionValue , <nl> - scope . tryCatch ( ) , scope . objectGroupName ( ) , false , <nl> - false , callback . get ( ) ) ; <nl> + if ( objectId . isJust ( ) & & executionContextId . isJust ( ) ) { <nl> + callback - > sendFailure ( Response : : Error ( <nl> + " ObjectId must not be specified together with executionContextId " ) ) ; <nl> return ; <nl> } <nl> - <nl> - v8 : : Local < v8 : : Value > functionValue ; <nl> - if ( ! maybeFunctionValue . ToLocal ( & functionValue ) | | <nl> - ! functionValue - > IsFunction ( ) ) { <nl> - callback - > sendFailure ( <nl> - Response : : Error ( " Given expression does not evaluate to a function " ) ) ; <nl> + if ( ! objectId . isJust ( ) & & ! executionContextId . isJust ( ) ) { <nl> + callback - > sendFailure ( Response : : Error ( <nl> + " Either ObjectId or executionContextId must be specified " ) ) ; <nl> return ; <nl> } <nl> - <nl> - v8 : : MaybeLocal < v8 : : Value > maybeResultValue ; <nl> - { <nl> - v8 : : MicrotasksScope microtasksScope ( m_inspector - > isolate ( ) , <nl> - v8 : : MicrotasksScope : : kRunMicrotasks ) ; <nl> - maybeResultValue = functionValue . As < v8 : : Function > ( ) - > Call ( <nl> - scope . context ( ) , scope . object ( ) , argc , argv . get ( ) ) ; <nl> - } <nl> - / / Re - initialize after running client ' s code , as it could have destroyed <nl> - / / context or session . <nl> - response = scope . initialize ( ) ; <nl> - if ( ! response . isSuccess ( ) ) { <nl> - callback - > sendFailure ( response ) ; <nl> - return ; <nl> - } <nl> - <nl> - if ( ! awaitPromise . fromMaybe ( false ) | | scope . tryCatch ( ) . HasCaught ( ) ) { <nl> - wrapEvaluateResultAsync ( scope . injectedScript ( ) , maybeResultValue , <nl> - scope . tryCatch ( ) , scope . objectGroupName ( ) , <nl> - returnByValue . fromMaybe ( false ) , <nl> - generatePreview . fromMaybe ( false ) , callback . get ( ) ) ; <nl> - return ; <nl> + if ( objectId . isJust ( ) ) { <nl> + InjectedScript : : ObjectScope scope ( m_session , objectId . fromJust ( ) ) ; <nl> + Response response = scope . initialize ( ) ; <nl> + if ( ! response . isSuccess ( ) ) { <nl> + callback - > sendFailure ( response ) ; <nl> + return ; <nl> + } <nl> + innerCallFunctionOn ( <nl> + m_session , scope , scope . object ( ) , expression , <nl> + std : : move ( optionalArguments ) , silent . fromMaybe ( false ) , <nl> + returnByValue . fromMaybe ( false ) , generatePreview . fromMaybe ( false ) , <nl> + userGesture . fromMaybe ( false ) , awaitPromise . fromMaybe ( false ) , <nl> + objectGroup . isJust ( ) ? objectGroup . fromMaybe ( String16 ( ) ) <nl> + : scope . objectGroupName ( ) , <nl> + std : : move ( callback ) ) ; <nl> + } else { <nl> + int contextId = 0 ; <nl> + Response response = <nl> + ensureContext ( m_inspector , m_session - > contextGroupId ( ) , <nl> + std : : move ( executionContextId . fromJust ( ) ) , & contextId ) ; <nl> + if ( ! response . isSuccess ( ) ) { <nl> + callback - > sendFailure ( response ) ; <nl> + return ; <nl> + } <nl> + InjectedScript : : ContextScope scope ( m_session , contextId ) ; <nl> + response = scope . initialize ( ) ; <nl> + if ( ! response . isSuccess ( ) ) { <nl> + callback - > sendFailure ( response ) ; <nl> + return ; <nl> + } <nl> + innerCallFunctionOn ( <nl> + m_session , scope , scope . context ( ) - > Global ( ) , expression , <nl> + std : : move ( optionalArguments ) , silent . fromMaybe ( false ) , <nl> + returnByValue . fromMaybe ( false ) , generatePreview . fromMaybe ( false ) , <nl> + userGesture . fromMaybe ( false ) , awaitPromise . fromMaybe ( false ) , <nl> + objectGroup . fromMaybe ( " " ) , std : : move ( callback ) ) ; <nl> } <nl> - <nl> - scope . injectedScript ( ) - > addPromiseCallback ( <nl> - m_session , maybeResultValue , scope . objectGroupName ( ) , <nl> - returnByValue . fromMaybe ( false ) , generatePreview . fromMaybe ( false ) , <nl> - EvaluateCallbackWrapper < CallFunctionOnCallback > : : wrap ( <nl> - std : : move ( callback ) ) ) ; <nl> } <nl> <nl> Response V8RuntimeAgentImpl : : getProperties ( <nl> mmm a / src / inspector / v8 - runtime - agent - impl . h <nl> ppp b / src / inspector / v8 - runtime - agent - impl . h <nl> class V8RuntimeAgentImpl : public protocol : : Runtime : : Backend { <nl> Maybe < bool > generatePreview , <nl> std : : unique_ptr < AwaitPromiseCallback > ) override ; <nl> void callFunctionOn ( <nl> - const String16 & objectId , const String16 & expression , <nl> + const String16 & expression , Maybe < String16 > objectId , <nl> Maybe < protocol : : Array < protocol : : Runtime : : CallArgument > > optionalArguments , <nl> Maybe < bool > silent , Maybe < bool > returnByValue , <nl> Maybe < bool > generatePreview , Maybe < bool > userGesture , <nl> - Maybe < bool > awaitPromise , <nl> + Maybe < bool > awaitPromise , Maybe < int > executionContextId , <nl> + Maybe < String16 > objectGroup , <nl> std : : unique_ptr < CallFunctionOnCallback > ) override ; <nl> Response releaseObject ( const String16 & objectId ) override ; <nl> Response getProperties ( <nl> mmm a / test / inspector / runtime / call - function - on - async - expected . txt <nl> ppp b / test / inspector / runtime / call - function - on - async - expected . txt <nl> Running test : testExceptionInFunctionExpression <nl> exceptionId : < exceptionId > <nl> lineNumber : 0 <nl> scriptId : < scriptId > <nl> + stackTrace : { <nl> + callFrames : [ <nl> + [ 0 ] : { <nl> + columnNumber : 21 <nl> + functionName : <nl> + lineNumber : 0 <nl> + scriptId : < scriptId > <nl> + url : <nl> + } <nl> + [ 1 ] : { <nl> + columnNumber : 35 <nl> + functionName : <nl> + lineNumber : 0 <nl> + scriptId : < scriptId > <nl> + url : <nl> + } <nl> + ] <nl> + } <nl> text : Uncaught <nl> } <nl> result : { <nl> Running test : testFunctionReturnRejectedPromise <nl> } <nl> } <nl> } <nl> + <nl> + Running test : testEvaluateOnExecutionContext <nl> + { <nl> + id : < messageId > <nl> + result : { <nl> + result : { <nl> + description : 70 <nl> + type : number <nl> + value : 70 <nl> + } <nl> + } <nl> + } <nl> + <nl> + Running test : testPassingBothObjectIdAndExecutionContextId <nl> + { <nl> + error : { <nl> + code : - 32000 <nl> + message : ObjectId must not be specified together with executionContextId <nl> + } <nl> + id : < messageId > <nl> + } <nl> mmm a / test / inspector / runtime / call - function - on - async . js <nl> ppp b / test / inspector / runtime / call - function - on - async . js <nl> let callFunctionOn = Protocol . Runtime . callFunctionOn . bind ( Protocol . Runtime ) ; <nl> <nl> let remoteObject1 ; <nl> let remoteObject2 ; <nl> + let executionContextId ; <nl> <nl> - InspectorTest . runAsyncTestSuite ( [ <nl> + Protocol . Runtime . enable ( ) ; <nl> + Protocol . Runtime . onExecutionContextCreated ( messageObject = > { <nl> + executionContextId = messageObject . params . context . id ; <nl> + InspectorTest . runAsyncTestSuite ( testSuite ) ; <nl> + } ) ; <nl> + <nl> + let testSuite = [ <nl> async function prepareTestSuite ( ) { <nl> let result = await Protocol . Runtime . evaluate ( { expression : ' ( { a : 1 } ) ' } ) ; <nl> remoteObject1 = result . result . result ; <nl> result = await Protocol . Runtime . evaluate ( { expression : ' ( { a : 2 } ) ' } ) ; <nl> remoteObject2 = result . result . result ; <nl> + <nl> + await Protocol . Runtime . evaluate ( { expression : ' globalObjectProperty = 42 ; ' } ) ; <nl> } , <nl> <nl> async function testArguments ( ) { <nl> InspectorTest . runAsyncTestSuite ( [ <nl> generatePreview : false , <nl> awaitPromise : true <nl> } ) ) ; <nl> - } <nl> - ] ) ; <nl> + } , <nl> + <nl> + async function testEvaluateOnExecutionContext ( ) { <nl> + InspectorTest . logMessage ( await callFunctionOn ( { <nl> + executionContextId , <nl> + functionDeclaration : ' ( function ( arg ) { return this . globalObjectProperty + arg ; } ) ' , <nl> + arguments : prepareArguments ( [ 28 ] ) , <nl> + returnByValue : true , <nl> + generatePreview : false , <nl> + awaitPromise : false <nl> + } ) ) ; <nl> + } , <nl> + <nl> + async function testPassingBothObjectIdAndExecutionContextId ( ) { <nl> + InspectorTest . logMessage ( await callFunctionOn ( { <nl> + executionContextId , <nl> + objectId : remoteObject1 . objectId , <nl> + functionDeclaration : ' ( function ( ) { return 42 ; } ) ' , <nl> + arguments : prepareArguments ( [ ] ) , <nl> + returnByValue : true , <nl> + generatePreview : false , <nl> + awaitPromise : false <nl> + } ) ) ; <nl> + } , <nl> + ] ; <nl> <nl> function prepareArguments ( args ) { <nl> return args . map ( arg = > { <nl>
Reland of Inspector : Runtime . callFunctionOn to accept executionContextId
v8/v8
257f9494a6dc62487b209aca73dfff02c3efa359
2017-08-31T02:23:06Z
mmm a / third - party <nl> ppp b / third - party <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit db9419a856864c54820c9a140e94578d616817d3 <nl> + Subproject commit 04d993623ff1b8c37e1c63b4d95c099a349811ee <nl>
Update third - party revision
facebook/hhvm
5911a3f888b661253ae994018c8b8447bdb782ac
2016-08-11T22:28:57Z
mmm a / tools / http2_interop / doc . go <nl> ppp b / tools / http2_interop / doc . go <nl> <nl> + / / Copyright 2019 The 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> / / http2interop project doc . go <nl> <nl> / * <nl> mmm a / tools / http2_interop / frame . go <nl> ppp b / tools / http2_interop / frame . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / frameheader . go <nl> ppp b / tools / http2_interop / frameheader . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / goaway . go <nl> ppp b / tools / http2_interop / goaway . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / http1frame . go <nl> ppp b / tools / http2_interop / http1frame . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / http2interop . go <nl> ppp b / tools / http2_interop / http2interop . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / http2interop_test . go <nl> ppp b / tools / http2_interop / http2interop_test . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / ping . go <nl> ppp b / tools / http2_interop / ping . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / s6 . 5 . go <nl> ppp b / tools / http2_interop / s6 . 5 . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / s6 . 5_test . go <nl> ppp b / tools / http2_interop / s6 . 5_test . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / settings . go <nl> ppp b / tools / http2_interop / settings . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / testsuite . go <nl> ppp b / tools / http2_interop / testsuite . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl> mmm a / tools / http2_interop / unknownframe . go <nl> ppp b / tools / http2_interop / unknownframe . go <nl> <nl> + / / Copyright 2019 The 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> package http2interop <nl> <nl> import ( <nl>
Add copyright headers
grpc/grpc
0f7450b728980dae8e3ddb6c0a51be993d70859d
2019-02-21T07:44:56Z
deleted file mode 100644 <nl> index 9bffcc0ff97b . . 000000000000 <nl> mmm a / caffe2 / operators / quantized / server / dnnlowp_fc_perf_comparison . py <nl> ppp / dev / null <nl> <nl> - from __future__ import absolute_import , division , print_function , unicode_literals <nl> - <nl> - import argparse <nl> - import operator <nl> - <nl> - import numpy as np <nl> - from caffe2 . python import core , dyndep , workspace <nl> - <nl> - <nl> - dyndep . InitOpsLibrary ( " @ / caffe2 / caffe2 / fb / operators : fully_connected_op_skinny " ) <nl> - dyndep . InitOpsLibrary ( " / / caffe2 / caffe2 / operators / quantized / server : dnnlowp_ops " ) <nl> - <nl> - <nl> - def GetArgumentParser ( ) : <nl> - parser = argparse . ArgumentParser ( <nl> - description = " Caffe2 benchmark . Extra args will be passed to Caffe2 " <nl> - ) <nl> - parser . add_argument ( " - - batch_size " , type = int , default = 20 , help = " The batch size . " ) <nl> - parser . add_argument ( <nl> - " - - input_dim " , type = int , default = 463 , help = " The input dense dimension . " <nl> - ) <nl> - parser . add_argument ( <nl> - " - - output_dim " , type = int , default = 128 , help = " The output dense dimension . " <nl> - ) <nl> - parser . add_argument ( <nl> - " - - l3_cache_size " , <nl> - type = int , <nl> - default = 30 * 2 * * 20 / / 4 , <nl> - help = " used to wipe caches between runs " , <nl> - ) <nl> - parser . add_argument ( <nl> - " - - num_runs " , type = int , default = 1000 , help = " how many times to run each op " <nl> - ) <nl> - parser . add_argument ( <nl> - " - - all_shapes " , <nl> - default = False , <nl> - action = " store_true " , <nl> - help = " use all collected input shapes . " , <nl> - ) <nl> - parser . add_argument ( <nl> - " - - quantize_input " , <nl> - default = False , <nl> - action = " store_true " , <nl> - help = " Use int8 inputs in FC " , <nl> - ) <nl> - parser . add_argument ( <nl> - " - - quantize_output " , <nl> - default = False , <nl> - action = " store_true " , <nl> - help = " Do not dequantize outputs in FC " , <nl> - ) <nl> - return parser <nl> - <nl> - <nl> - # { M , N , K } <nl> - # NMT <nl> - input_shapes_nmt = np . array ( <nl> - [ <nl> - [ 1 , 128 , 512 ] , <nl> - [ 1 , 1024 , 256 ] , <nl> - [ 1 , 2048 , 512 ] , <nl> - [ 1 , 4096 , 1024 ] , <nl> - [ 6 , 256 , 1024 ] , <nl> - [ 6 , 256 , 2048 ] , <nl> - [ 6 , 512 , 512 ] , <nl> - [ 6 , 1024 , 256 ] , <nl> - [ 6 , 2048 , 256 ] , <nl> - [ 6 , 2048 , 512 ] , <nl> - [ 6 , 4096 , 256 ] , <nl> - [ 6 , 4096 , 1024 ] , <nl> - [ 6 , 4096 , 2048 ] , <nl> - [ 10 , 2048 , 256 ] , <nl> - [ 10 , 4096 , 1024 ] , <nl> - [ 20 , 2048 , 256 ] , <nl> - [ 20 , 4096 , 1024 ] , <nl> - [ 102 , 1024 , 512 ] , <nl> - [ 102 , 2323 , 256 ] , <nl> - [ 102 , 512 , 256 ] , <nl> - ] <nl> - ) <nl> - <nl> - # Speech <nl> - input_shapes_speech = np . array ( [ [ 1 , 800 , 3200 ] , [ 1 , 800 , 8000 ] ] ) <nl> - <nl> - <nl> - # Ads <nl> - input_shapes_ads = np . array ( <nl> - [ <nl> - [ 16 , 256 , 1500 ] , <nl> - [ 16 , 256 , 1567 ] , <nl> - [ 1 , 128 , 2876 ] , <nl> - [ 16 , 128 , 1567 ] , <nl> - [ 1 , 128 , 2722 ] , <nl> - [ 16 , 256 , 512 ] , <nl> - ] <nl> - ) <nl> - <nl> - <nl> - def main ( ) : <nl> - parser = GetArgumentParser ( ) <nl> - args , extra_args = parser . parse_known_args ( ) <nl> - core . GlobalInit ( <nl> - [ <nl> - " dnnlowp_fc_perf_bench " , <nl> - " - - caffe2_logging_operator_dyno_sampling_rate = 0 " , <nl> - ] <nl> - + extra_args <nl> - ) <nl> - if args . all_shapes : <nl> - for input_shape in input_shapes_nmt : <nl> - compare_fcs ( input_shape [ 0 ] , input_shape [ 2 ] , input_shape [ 1 ] , args ) <nl> - for input_shape in input_shapes_speech : <nl> - compare_fcs ( input_shape [ 0 ] , input_shape [ 2 ] , input_shape [ 1 ] , args ) <nl> - for input_shape in input_shapes_ads : <nl> - compare_fcs ( input_shape [ 0 ] , input_shape [ 2 ] , input_shape [ 1 ] , args ) <nl> - else : <nl> - compare_fcs ( args . batch_size , args . input_dim , args . output_dim , args ) <nl> - <nl> - <nl> - def compare_fcs ( M , K , N , args ) : <nl> - X = np . random . rand ( M , K ) . astype ( np . float32 ) - 0 . 5 <nl> - W = np . random . rand ( N , K ) . astype ( np . float32 ) - 0 . 5 <nl> - b = np . random . rand ( N ) . astype ( np . float32 ) - 0 . 5 <nl> - <nl> - def fc ( X , W , b ) : <nl> - return np . dot ( X , np . transpose ( W ) ) + b <nl> - <nl> - ground = np . array ( fc ( X , W , b ) ) <nl> - Y_scale = ( ground . max ( ) - ground . min ( ) ) / 255 <nl> - print ( " min " , ground . min ( ) , " max " , ground . max ( ) , " scale " , Y_scale ) <nl> - print ( " l3_cache_size " , args . l3_cache_size * 4 / 2 * * 20 , " MB " ) <nl> - workspace . FeedBlob ( " X " , X ) <nl> - workspace . FeedBlob ( " W " , W ) <nl> - workspace . FeedBlob ( " WT " , W . T ) <nl> - workspace . FeedBlob ( " b " , b ) <nl> - workspace . FeedBlob ( <nl> - " huge_blob " , np . random . randn ( args . l3_cache_size ) . astype ( np . float32 ) <nl> - ) <nl> - <nl> - net = core . Net ( " test " ) <nl> - <nl> - net . FC ( [ " X " , " W " , " b " ] , " Y_default " ) <nl> - net . FCTransposed ( [ " X " , " WT " , " b " ] , " Y_pretranspose " ) <nl> - <nl> - if args . quantize_input : <nl> - quantize_X = core . CreateOperator ( " Quantize " , [ " X " ] , [ " X_q " ] , engine = " DNNLOWP " ) <nl> - net . Proto ( ) . op . extend ( [ quantize_X ] ) <nl> - quantize_W = core . CreateOperator ( " Quantize " , [ " W " ] , [ " W_q " ] , engine = " DNNLOWP " ) <nl> - net . Proto ( ) . op . extend ( [ quantize_W ] ) <nl> - <nl> - fc_i8_rowwise = core . CreateOperator ( <nl> - " Int8FCRowWise " , <nl> - [ " X_q " , " W " , " b " ] if args . quantize_input else [ " X " , " W " , " b " ] , <nl> - " Y_rowwise_dnnlowp " , <nl> - dequantize_output = 0 if args . quantize_output else 1 , <nl> - Y_scale = Y_scale , <nl> - Y_zero_point = 0 , <nl> - engine = " DNNLOWP " , <nl> - ) <nl> - net . Proto ( ) . op . extend ( [ fc_i8_rowwise ] ) <nl> - <nl> - fc_i8 = core . CreateOperator ( <nl> - " Int8FC " , <nl> - [ " X_q " , " W_q " , " b " ] if args . quantize_input else [ " X " , " W " , " b " ] , <nl> - " Y_dnnlowp " , <nl> - dequantize_output = 0 if args . quantize_output else 1 , <nl> - Y_scale = Y_scale , <nl> - Y_zero_point = 0 , <nl> - engine = " DNNLOWP " , <nl> - ) <nl> - net . Proto ( ) . op . extend ( [ fc_i8 ] ) <nl> - <nl> - pack_w = core . CreateOperator ( " FbGemmPack " , [ " W " ] , " W_packed " ) <nl> - net . Proto ( ) . op . extend ( [ pack_w ] ) <nl> - fc_fp16 = core . CreateOperator ( " FbFCPacked " , [ " X " , " W_packed " , " b " ] , [ " Y_fp16 " ] ) <nl> - net . Proto ( ) . op . extend ( [ fc_fp16 ] ) <nl> - <nl> - ops = [ op for op in net . Proto ( ) . op ] <nl> - del net . Proto ( ) . op [ : ] <nl> - for op in ops : <nl> - net . Proto ( ) . op . extend ( [ op ] ) <nl> - # wipe caches <nl> - net . Scale ( " huge_blob " , " huge_blob_2x " , value = 2 . 0 ) <nl> - <nl> - workspace . CreateNet ( net ) <nl> - workspace . RunNet ( net ) <nl> - <nl> - # makes sure that results are good . <nl> - outputs = [ op . output [ 0 ] for op in net . Proto ( ) . op if " FC " in op . type ] <nl> - for Y in outputs : <nl> - if " i8 " in Y or " fp16 " in Y or " dnnlowp " in Y : <nl> - continue <nl> - np . testing . assert_allclose ( <nl> - workspace . FetchBlob ( outputs [ 0 ] ) , <nl> - workspace . FetchBlob ( Y ) , <nl> - atol = 1e - 2 , <nl> - rtol = 1e - 2 , <nl> - ) <nl> - <nl> - runtimes = workspace . BenchmarkNet ( <nl> - net . Name ( ) , 1 , args . num_runs , True # warmup # run induvidual ops <nl> - ) [ 1 : ] <nl> - <nl> - results = { <nl> - op . output [ 0 ] : runtime <nl> - for op , runtime in zip ( net . Proto ( ) . op , runtimes ) <nl> - if " FC " in op . type <nl> - } <nl> - <nl> - def get_gflops ( time , m , k , n ) : <nl> - return round ( m * n * k * 2 / time / 10 * * 6 * 10 ) / 10 <nl> - <nl> - results = [ <nl> - ( out , time , " { } GFLOPS " . format ( get_gflops ( time , M , K , N ) ) ) <nl> - for out , time in results . items ( ) <nl> - ] <nl> - # results = sorted ( results , key = operator . itemgetter ( 1 ) ) <nl> - <nl> - print ( " input shape M , N , K : { } { } { } " . format ( M , N , K ) ) <nl> - for output , time , flops in results : <nl> - print ( " { } : { : . 4f } ms { } " . format ( output , time , flops ) ) <nl> - <nl> - <nl> - if __name__ = = " __main__ " : <nl> - main ( ) <nl> deleted file mode 100644 <nl> index 6d04a68aa149 . . 000000000000 <nl> mmm a / caffe2 / operators / quantized / server / plot_hist . py <nl> ppp / dev / null <nl> <nl> - from __future__ import absolute_import , division , print_function <nl> - <nl> - import csv <nl> - import sys <nl> - <nl> - import matplotlib . pyplot as plt <nl> - import numpy as np <nl> - <nl> - <nl> - with open ( sys . argv [ 1 ] ) as f : <nl> - reader = csv . reader ( f , delimiter = " " ) <nl> - for row in reader : <nl> - tensor_name = row [ 3 ] <nl> - minimum = float ( row [ 4 ] ) <nl> - maximum = float ( row [ 5 ] ) <nl> - nbins = int ( row [ 6 ] ) <nl> - <nl> - bins = np . linspace ( minimum , maximum , nbins ) <nl> - hist = row [ 7 : ] <nl> - <nl> - # y_pos = np . arrange ( len ( bins ) ) <nl> - <nl> - plt . bar ( bins , hist , bins [ 1 ] - bins [ 0 ] ) <nl> - # plt . xticks ( y_pos , bins ) <nl> - plt . savefig ( tensor_name . replace ( " / " , " _ " ) + " . png " ) <nl> - plt . close ( ) <nl>
remove unnecessary files ( )
pytorch/pytorch
2a6850bf73b4beda1c8e6b4db6c0f29c4b02c037
2018-11-04T08:01:28Z
mmm a / project / cmake / addons / addons / pvr . iptvsimple / pvr . iptvsimple . txt <nl> ppp b / project / cmake / addons / addons / pvr . iptvsimple / pvr . iptvsimple . txt <nl> @ @ - 1 + 1 @ @ <nl> - pvr . iptvsimple https : / / github . com / kodi - pvr / pvr . iptvsimple 4e1e7f6 <nl> + pvr . iptvsimple https : / / github . com / kodi - pvr / pvr . iptvsimple 69e6a6f <nl>
Merge pull request from afedchin / sync_pvr . iptvsimple
xbmc/xbmc
11c1a8b01ed5691acdde9d338c3d884f54e36002
2015-03-24T08:48:55Z
mmm a / src / h5 - render / src / components / embed . js <nl> ppp b / src / h5 - render / src / components / embed . js <nl> Embed . prototype . initWeex = function ( ) { <nl> var config = { <nl> appId : this . id , <nl> source : this . source , <nl> + bundleUrl : this . source , <nl> loader : this . loader , <nl> width : this . node . getBoundingClientRect ( ) . width , <nl> rootId : this . id <nl>
Merge pull request from alibaba / html5 - bugfix - embed - bundleUrl
apache/incubator-weex
642dc1a25afc5a23b49c7e8015f77994a39c6d2a
2016-05-17T08:24:45Z
mmm a / dlib / algs . h <nl> ppp b / dlib / algs . h <nl> namespace dlib <nl> / * ! A is_pointer_type <nl> <nl> This is a template where is_pointer_type < T > : : value = = true when T is a pointer <nl> - type ane false otherwise . <nl> + type and false otherwise . <nl> ! * / <nl> <nl> template < <nl> namespace dlib <nl> / * ! A is_const_type <nl> <nl> This is a template where is_const_type < T > : : value = = true when T is a const <nl> - type ane false otherwise . <nl> + type and false otherwise . <nl> ! * / <nl> <nl> template < typename T > <nl> namespace dlib <nl> static const bool value = true ; <nl> } ; <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + / * ! A is_reference_type <nl> + <nl> + This is a template where is_reference_type < T > : : value = = true when T is a reference <nl> + type and false otherwise . <nl> + ! * / <nl> + <nl> + template < typename T > <nl> + struct is_reference_type <nl> + { <nl> + static const bool value = false ; <nl> + } ; <nl> + <nl> + template < typename T > struct is_reference_type < const T & > { static const bool value = true ; } ; <nl> + template < typename T > struct is_reference_type < T & > { static const bool value = true ; } ; <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> / * ! A is_same_type <nl>
Added is_reference_type
davisking/dlib
be080797c0e1a60f6178e1cdbf416399fb2c93f8
2010-05-13T23:12:53Z
mmm a / docs / api / web - contents . md <nl> ppp b / docs / api / web - contents . md <nl> Mute the audio on the current web page . <nl> <nl> Returns whether this page has been muted . <nl> <nl> + # # # # ` contents . setZoomFactor ( factor ) ` <nl> + <nl> + * ` factor ` Number - Zoom factor . <nl> + <nl> + Changes the zoom factor to the specified factor . Zoom factor is <nl> + zoom percent divided by 100 , so 300 % = 3 . 0 . <nl> + <nl> + # # # # ` contents . getZoomFactor ( callback ) ` <nl> + <nl> + ` callback ` is called with the current zoom factor <nl> + <nl> + # # # # ` contents . setZoomLevel ( level ) ` <nl> + <nl> + * ` level ` Number - Zoom level <nl> + <nl> + Changes the zoom level to the specified level . The original size is 0 and each <nl> + increment above or below represents zooming 20 % larger or smaller to default <nl> + limits of 300 % and 50 % of original size , respectively . <nl> + <nl> + # # # # ` contents . getZoomLevel ( callback ) ` <nl> + <nl> + ` callback ` is called with the current zoom level <nl> + <nl> + # # # # ` contents . setZoomLevelLimits ( minimumLevel , maximumLevel ) ` <nl> + <nl> + * ` minimumLevel ` Number <nl> + * ` maximumLevel ` Number <nl> + <nl> + Sets the maximum and minimum zoom level . ` <nl> + <nl> # # # # ` contents . undo ( ) ` <nl> <nl> Executes the editing command ` undo ` in web page . <nl> mmm a / lib / browser / api / web - contents . js <nl> ppp b / lib / browser / api / web - contents . js <nl> const webFrameMethods = [ <nl> ' setZoomLevelLimits ' <nl> ] <nl> <nl> + const webFrameMethodsWithResult = [ <nl> + ' getZoomFactor ' , <nl> + ' getZoomLevel ' <nl> + ] <nl> + <nl> / / Add JavaScript wrappers for WebContents class . <nl> const wrapWebContents = function ( webContents ) { <nl> / / webContents is an EventEmitter . <nl> const wrapWebContents = function ( webContents ) { <nl> } <nl> } <nl> <nl> + const asyncWebFrameMethods = function ( requestId , method , callback , . . . args ) { <nl> + this . send ( ' ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD ' , requestId , method , args ) <nl> + ipcMain . once ( ` ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_ $ { requestId } ` , function ( event , result ) { <nl> + if ( callback ) callback ( result ) <nl> + } ) <nl> + } <nl> + <nl> + const syncWebFrameMethods = function ( requestId , method , callback , . . . args ) { <nl> + this . send ( ' ELECTRON_INTERNAL_RENDERER_SYNC_WEB_FRAME_METHOD ' , requestId , method , args ) <nl> + ipcMain . once ( ` ELECTRON_INTERNAL_BROWSER_SYNC_WEB_FRAME_RESPONSE_ $ { requestId } ` , function ( event , result ) { <nl> + if ( callback ) callback ( result ) <nl> + } ) <nl> + } <nl> + <nl> / / Mapping webFrame methods . <nl> for ( const method of webFrameMethods ) { <nl> webContents [ method ] = function ( . . . args ) { <nl> const wrapWebContents = function ( webContents ) { <nl> } <nl> } <nl> <nl> - const asyncWebFrameMethods = function ( requestId , method , callback , . . . args ) { <nl> - this . send ( ' ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD ' , requestId , method , args ) <nl> - ipcMain . once ( ` ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_ $ { requestId } ` , function ( event , result ) { <nl> - if ( callback ) callback ( result ) <nl> - } ) <nl> + for ( const method of webFrameMethodsWithResult ) { <nl> + webContents [ method ] = function ( . . . args ) { <nl> + const callback = args [ args . length - 1 ] <nl> + const actualArgs = args . slice ( 0 , args . length - 2 ) <nl> + syncWebFrameMethods . call ( this , getNextId ( ) , method , callback , . . . actualArgs ) <nl> + } <nl> } <nl> <nl> / / Make sure webContents . executeJavaScript would run the code only when the <nl> mmm a / lib / renderer / init . js <nl> ppp b / lib / renderer / init . js <nl> electron . ipcRenderer . on ( ' ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD ' , ( event , m <nl> electron . webFrame [ method ] . apply ( electron . webFrame , args ) <nl> } ) <nl> <nl> + electron . ipcRenderer . on ( ' ELECTRON_INTERNAL_RENDERER_SYNC_WEB_FRAME_METHOD ' , ( event , requestId , method , args ) = > { <nl> + const result = electron . webFrame [ method ] . apply ( electron . webFrame , args ) <nl> + event . sender . send ( ` ELECTRON_INTERNAL_BROWSER_SYNC_WEB_FRAME_RESPONSE_ $ { requestId } ` , result ) <nl> + } ) <nl> + <nl> electron . ipcRenderer . on ( ' ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD ' , ( event , requestId , method , args ) = > { <nl> const responseCallback = function ( result ) { <nl> event . sender . send ( ` ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_ $ { requestId } ` , result ) <nl>
Merge pull request from electron / document - contents - zoom
electron/electron
56b1abd64a64e5da249218b5342a5d7a9d00261f
2016-08-02T05:41:09Z
mmm a / src / csharp / Grpc . Core . Tests / ChannelConnectivityTest . cs <nl> ppp b / src / csharp / Grpc . Core . Tests / ChannelConnectivityTest . cs <nl> public void Cleanup ( ) <nl> [ Test ] <nl> public async Task Channel_WaitForStateChangedAsync ( ) <nl> { <nl> - helper . UnaryHandler = new UnaryServerMethod < string , string > ( ( request , context ) = > <nl> - { <nl> - return Task . FromResult ( request ) ; <nl> - } ) ; <nl> - <nl> Assert . ThrowsAsync ( typeof ( TaskCanceledException ) , <nl> - async ( ) = > await channel . WaitForStateChangedAsync ( channel . State , DateTime . UtcNow . AddMilliseconds ( 10 ) ) ) ; <nl> + async ( ) = > await channel . WaitForStateChangedAsync ( channel . State , DateTime . UtcNow . AddMilliseconds ( 0 ) ) ) ; <nl> <nl> var stateChangedTask = channel . WaitForStateChangedAsync ( channel . State ) ; <nl> + await channel . ConnectAsync ( DateTime . UtcNow . AddMilliseconds ( 5000 ) ) ; <nl> + await stateChangedTask ; <nl> + Assert . AreEqual ( ChannelState . Ready , channel . State ) ; <nl> + } <nl> <nl> - await Calls . AsyncUnaryCall ( helper . CreateUnaryCall ( ) , " abc " ) ; <nl> + [ Test ] <nl> + public async Task Channel_TryWaitForStateChangedAsync ( ) <nl> + { <nl> + Assert . IsFalse ( await channel . TryWaitForStateChangedAsync ( channel . State , DateTime . UtcNow . AddMilliseconds ( 0 ) ) ) ; <nl> <nl> - await stateChangedTask ; <nl> + var stateChangedTask = channel . TryWaitForStateChangedAsync ( channel . State ) ; <nl> + await channel . ConnectAsync ( DateTime . UtcNow . AddMilliseconds ( 5000 ) ) ; <nl> + Assert . IsTrue ( await stateChangedTask ) ; <nl> Assert . AreEqual ( ChannelState . Ready , channel . State ) ; <nl> } <nl> <nl> mmm a / src / csharp / Grpc . Core / Channel . cs <nl> ppp b / src / csharp / Grpc . Core / Channel . cs <nl> public ChannelState State <nl> / / / < / summary > <nl> public async Task WaitForStateChangedAsync ( ChannelState lastObservedState , DateTime ? deadline = null ) <nl> { <nl> - var result = await WaitForStateChangedInternalAsync ( lastObservedState , deadline ) . ConfigureAwait ( false ) ; <nl> + var result = await TryWaitForStateChangedAsync ( lastObservedState , deadline ) . ConfigureAwait ( false ) ; <nl> if ( ! result ) <nl> { <nl> throw new TaskCanceledException ( " Reached deadline . " ) ; <nl> public async Task WaitForStateChangedAsync ( ChannelState lastObservedState , DateT <nl> / / / Returned tasks completes once channel state has become different from <nl> / / / given lastObservedState ( < c > true < / c > is returned ) or if the wait has timed out ( < c > false < / c > is returned ) . <nl> / / / < / summary > <nl> - internal Task < bool > WaitForStateChangedInternalAsync ( ChannelState lastObservedState , DateTime ? deadline = null ) <nl> + public Task < bool > TryWaitForStateChangedAsync ( ChannelState lastObservedState , DateTime ? deadline = null ) <nl> { <nl> GrpcPreconditions . CheckArgument ( lastObservedState ! = ChannelState . Shutdown , <nl> " Shutdown is a terminal state . No further state changes can occur . " ) ; <nl>
Merge pull request from jtattermusch / csharp_expose_trywaitforstatechanged
grpc/grpc
db1b6ac1661b7561150eb0a65cf30a8d4a249c2a
2018-09-05T19:10:22Z
mmm a / test / ParseableInterface / ModuleCache / module - cache - diagnostics . swift <nl> ppp b / test / ParseableInterface / ModuleCache / module - cache - diagnostics . swift <nl> <nl> / / <nl> / / Setup phase 2 : build modules , pushing timestamps of inputs and intermediates into the past as we go . <nl> / / <nl> - / / RUN : % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> / / RUN : % target - swift - frontend - I % t - emit - parseable - module - interface - path % t / LeafModule . swiftinterface - module - name LeafModule % t / leaf . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - parseable - module - interface - path % t / OtherModule . swiftinterface - module - name OtherModule % t / other . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> / / <nl> / / <nl> / / Actual test : add an inlinable func with an unused var to LeafModule . swiftinterface ( which should emit a warning ) ; check we do get a rebuild , but no warning . <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : echo " @ inlinable func foo ( ) { var x = 10 } " > > % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / LeafModule . swiftinterface <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s > % t / warn . txt 2 > & 1 <nl> - / / RUN : % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / " check warn . txt exists and is empty " <nl> / / RUN : test - e % t / warn . txt - a ! - s % t / warn . txt <nl> / / <nl> / / <nl> / / Next test : make LeafModule . swiftinterface import NotAModule ( which should emit an error ) ; check we do not get a rebuild , do get an error . <nl> / / <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / * . swiftmodule % t / * . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / * . swiftmodule % t / * . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : echo " import NotAModule " > > % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / LeafModule . swiftinterface <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : not % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s > % t / err . txt 2 > & 1 <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : % FileCheck % s - check - prefix = CHECK - ERROR < % t / err . txt <nl> / / CHECK - ERROR : LeafModule . swiftinterface : 6 : 8 : error : no such module ' NotAModule ' <nl> / / CHECK - ERROR : OtherModule . swiftinterface : 4 : 8 : error : no such module ' LeafModule ' <nl> <nl> / / <nl> / / Next test : same as above , but with a . dia file <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : not % target - swift - frontend - I % t - module - cache - path % t / modulecache - serialize - diagnostics - serialize - diagnostics - path % t / err . dia - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : c - index - test - read - diagnostics % t / err . dia 2 > & 1 | % FileCheck % s - check - prefix = CHECK - ERROR <nl> <nl> import OtherModule <nl> mmm a / test / ParseableInterface / ModuleCache / module - cache - intermediate - hash - change - rebuilds - only - intermediate . swift <nl> ppp b / test / ParseableInterface / ModuleCache / module - cache - intermediate - hash - change - rebuilds - only - intermediate . swift <nl> <nl> / / <nl> / / Setup phase 2 : build modules , pushing timestamps of inputs and intermediates into the past as we go . <nl> / / <nl> - / / RUN : % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> / / RUN : % target - swift - frontend - I % t - emit - parseable - module - interface - path % t / LeafModule . swiftinterface - module - name LeafModule % t / leaf . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - parseable - module - interface - path % t / OtherModule . swiftinterface - module - name OtherModule % t / other . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> / / <nl> / / <nl> / / Actual test : Change a byte in OtherModule . swiftinterface , check we only rebuild its cached module . <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : sed - e ' s / OtherFunc2 / OtterFunc2 / ' - i . prev % t / OtherModule . swiftinterface <nl> - / / RUN : % S / Inputs / make - old . py % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / OtherModule . swiftinterface <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / LeafModule - * . swiftmodule <nl> <nl> import OtherModule <nl> <nl> mmm a / test / ParseableInterface / ModuleCache / module - cache - intermediate - size - change - rebuilds - only - intermediate . swift <nl> ppp b / test / ParseableInterface / ModuleCache / module - cache - intermediate - size - change - rebuilds - only - intermediate . swift <nl> <nl> / / <nl> / / Setup phase 2 : build modules , pushing timestamps of inputs and intermediates into the past as we go . <nl> / / <nl> - / / RUN : % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> / / RUN : % target - swift - frontend - I % t - emit - parseable - module - interface - path % t / LeafModule . swiftinterface - module - name LeafModule % t / leaf . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - parseable - module - interface - path % t / OtherModule . swiftinterface - module - name OtherModule % t / other . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> / / <nl> / / <nl> / / Actual test : make OtherModule . swiftinterface change size without changing mtime , check we only rebuild its cached module . <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : echo " / / size change " > > % t / OtherModule . swiftinterface <nl> - / / RUN : % S / Inputs / make - old . py % t / OtherModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / LeafModule - * . swiftmodule <nl> <nl> import OtherModule <nl> <nl> mmm a / test / ParseableInterface / ModuleCache / module - cache - leaf - hash - change - rebuilds - all . swift <nl> ppp b / test / ParseableInterface / ModuleCache / module - cache - leaf - hash - change - rebuilds - all . swift <nl> <nl> / / <nl> / / Actual test : Change a byte in LeafModule . swiftinterface , check both cached modules get rebuilt . <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : sed - e ' s / LeafFunc2 / LoafFunc2 / ' - i . prev % t / LeafModule . swiftinterface <nl> / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> <nl> import OtherModule <nl> <nl> mmm a / test / ParseableInterface / ModuleCache / module - cache - leaf - size - change - rebuilds - all . swift <nl> ppp b / test / ParseableInterface / ModuleCache / module - cache - leaf - size - change - rebuilds - all . swift <nl> <nl> / / <nl> / / Setup phase 2 : build modules , pushing timestamps of inputs and intermediates into the past as we go . <nl> / / <nl> - / / RUN : % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> / / RUN : % target - swift - frontend - I % t - emit - parseable - module - interface - path % t / LeafModule . swiftinterface - module - name LeafModule % t / leaf . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - parseable - module - interface - path % t / OtherModule . swiftinterface - module - name OtherModule % t / other . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> / / <nl> / / <nl> / / Actual test : make LeafModule . swiftinterface change size without changing mtime , check both cached modules get rebuilt . <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : echo " / / size change " > > % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / LeafModule . swiftinterface <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - new . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> <nl> import OtherModule <nl> <nl> mmm a / test / ParseableInterface / ModuleCache / module - cache - no - rebuild . swift <nl> ppp b / test / ParseableInterface / ModuleCache / module - cache - no - rebuild . swift <nl> <nl> / / <nl> / / Setup phase 2 : build modules , pushing timestamps of inputs and intermediates into the past as we go . <nl> / / <nl> - / / RUN : % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / leaf . swift % t / other . swift <nl> / / RUN : % target - swift - frontend - I % t - emit - parseable - module - interface - path % t / LeafModule . swiftinterface - module - name LeafModule % t / leaf . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / LeafModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - parseable - module - interface - path % t / OtherModule . swiftinterface - module - name OtherModule % t / other . swift - emit - module - o / dev / null <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / LeafModule - * . swiftmodule % t / OtherModule . swiftinterface <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / make - old . py % t / modulecache / OtherModule - * . swiftmodule <nl> / / <nl> / / <nl> / / Actual test : rebuild output , check no intermediates gets rebuilt . <nl> / / <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> / / RUN : rm % t / TestModule . swiftmodule <nl> / / RUN : % target - swift - frontend - I % t - module - cache - path % t / modulecache - enable - parseable - module - interface - emit - module - o % t / TestModule . swiftmodule - module - name TestModule % s <nl> - / / RUN : % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> - / / RUN : % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / OtherModule . swiftinterface % t / LeafModule . swiftinterface <nl> + / / RUN : % { python } % S / Inputs / check - is - old . py % t / modulecache / OtherModule - * . swiftmodule % t / modulecache / LeafModule - * . swiftmodule <nl> <nl> import OtherModule <nl> <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
80909cfa83cb8965d35b2527c832ff5e0675d2ff
2018-12-13T03:30:38Z
mmm a / Telegram / SourceFiles / apiwrap . cpp <nl> ppp b / Telegram / SourceFiles / apiwrap . cpp <nl> For license and copyright information please follow this link : <nl> # include " data / data_sparse_ids . h " <nl> # include " data / data_search_controller . h " <nl> # include " data / data_channel_admins . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace { <nl> <nl> mmm a / Telegram / SourceFiles / app . cpp <nl> ppp b / Telegram / SourceFiles / app . cpp <nl> For license and copyright information please follow this link : <nl> # include " styles / style_boxes . h " <nl> # include " lang / lang_keys . h " <nl> # include " data / data_abstract_structure . h " <nl> + # include " data / data_session . h " <nl> # include " history / history_service_layout . h " <nl> # include " history / history_location_manager . h " <nl> # include " history / history_media_types . h " <nl> mmm a / Telegram / SourceFiles / auth_session . cpp <nl> ppp b / Telegram / SourceFiles / auth_session . cpp <nl> For license and copyright information please follow this link : <nl> # include " storage / localstorage . h " <nl> # include " storage / storage_facade . h " <nl> # include " storage / serialize_common . h " <nl> - # include " data / data_feed . h " <nl> - # include " history / history_item_components . h " <nl> + # include " data / data_session . h " <nl> # include " window / notifications_manager . h " <nl> # include " window / themes / window_theme . h " <nl> # include " platform / platform_specific . h " <nl> For license and copyright information please follow this link : <nl> # include " window / section_widget . h " <nl> # include " chat_helpers / tabbed_selector . h " <nl> # include " boxes / send_files_box . h " <nl> - # include " observer_peer . h " <nl> <nl> namespace { <nl> <nl> constexpr auto kAutoLockTimeoutLateMs = TimeMs ( 3000 ) ; <nl> <nl> } / / namespace <nl> <nl> - AuthSessionData : : AuthSessionData ( ) { <nl> - Notify : : PeerUpdateViewer ( <nl> - Notify : : PeerUpdate : : Flag : : UserIsContact <nl> - ) | rpl : : map ( [ ] ( const Notify : : PeerUpdate & update ) { <nl> - return update . peer - > asUser ( ) ; <nl> - } ) | rpl : : filter ( [ ] ( UserData * user ) { <nl> - return user ! = nullptr ; <nl> - } ) | rpl : : start_with_next ( [ = ] ( not_null < UserData * > user ) { <nl> - userIsContactUpdated ( user ) ; <nl> - } , _lifetime ) ; <nl> - } <nl> - <nl> - AuthSessionData : : ~ AuthSessionData ( ) = default ; <nl> - <nl> - AuthSessionData : : Variables : : Variables ( ) <nl> + AuthSessionSettings : : Variables : : Variables ( ) <nl> : sendFilesWay ( SendFilesWay : : Album ) <nl> , selectorTab ( ChatHelpers : : SelectorTab : : Emoji ) <nl> , floatPlayerColumn ( Window : : Column : : Second ) <nl> , floatPlayerCorner ( RectPart : : TopRight ) { <nl> } <nl> <nl> - QByteArray AuthSessionData : : serialize ( ) const { <nl> + QByteArray AuthSessionSettings : : serialize ( ) const { <nl> auto size = sizeof ( qint32 ) * 10 ; <nl> for ( auto i = _variables . soundOverrides . cbegin ( ) , e = _variables . soundOverrides . cend ( ) ; i ! = e ; + + i ) { <nl> size + = Serialize : : stringSize ( i . key ( ) ) + Serialize : : stringSize ( i . value ( ) ) ; <nl> QByteArray AuthSessionData : : serialize ( ) const { <nl> return result ; <nl> } <nl> <nl> - void AuthSessionData : : constructFromSerialized ( const QByteArray & serialized ) { <nl> + void AuthSessionSettings : : constructFromSerialized ( const QByteArray & serialized ) { <nl> if ( serialized . isEmpty ( ) ) { <nl> return ; <nl> } <nl> void AuthSessionData : : constructFromSerialized ( const QByteArray & serialized ) { <nl> thirdSectionExtendedBy = value ; <nl> } <nl> if ( stream . status ( ) ! = QDataStream : : Ok ) { <nl> - LOG ( ( " App Error : Bad data for AuthSessionData : : constructFromSerialized ( ) " ) ) ; <nl> + LOG ( ( " App Error : " <nl> + " Bad data for AuthSessionSettings : : constructFromSerialized ( ) " ) ) ; <nl> return ; <nl> } <nl> <nl> void AuthSessionData : : constructFromSerialized ( const QByteArray & serialized ) { <nl> } <nl> } <nl> <nl> - void AuthSessionData : : markItemLayoutChanged ( not_null < const HistoryItem * > item ) { <nl> - _itemLayoutChanged . fire_copy ( item ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < const HistoryItem * > > AuthSessionData : : itemLayoutChanged ( ) const { <nl> - return _itemLayoutChanged . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : requestItemRepaint ( not_null < const HistoryItem * > item ) { <nl> - _itemRepaintRequest . fire_copy ( item ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < const HistoryItem * > > AuthSessionData : : itemRepaintRequest ( ) const { <nl> - return _itemRepaintRequest . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : markItemRemoved ( not_null < const HistoryItem * > item ) { <nl> - _itemRemoved . fire_copy ( item ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < const HistoryItem * > > AuthSessionData : : itemRemoved ( ) const { <nl> - return _itemRemoved . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : markHistoryUnloaded ( not_null < const History * > history ) { <nl> - _historyUnloaded . fire_copy ( history ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < const History * > > AuthSessionData : : historyUnloaded ( ) const { <nl> - return _historyUnloaded . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : markHistoryCleared ( not_null < const History * > history ) { <nl> - _historyCleared . fire_copy ( history ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < const History * > > AuthSessionData : : historyCleared ( ) const { <nl> - return _historyCleared . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : removeMegagroupParticipant ( <nl> - not_null < ChannelData * > channel , <nl> - not_null < UserData * > user ) { <nl> - _megagroupParticipantRemoved . fire ( { channel , user } ) ; <nl> - } <nl> - <nl> - auto AuthSessionData : : megagroupParticipantRemoved ( ) const - > rpl : : producer < MegagroupParticipant > { <nl> - return _megagroupParticipantRemoved . events ( ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < UserData * > > AuthSessionData : : megagroupParticipantRemoved ( <nl> - not_null < ChannelData * > channel ) const { <nl> - return megagroupParticipantRemoved ( <nl> - ) | rpl : : filter ( [ channel ] ( auto updateChannel , auto user ) { <nl> - return ( updateChannel = = channel ) ; <nl> - } ) | rpl : : map ( [ ] ( auto updateChannel , auto user ) { <nl> - return user ; <nl> - } ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : addNewMegagroupParticipant ( <nl> - not_null < ChannelData * > channel , <nl> - not_null < UserData * > user ) { <nl> - _megagroupParticipantAdded . fire ( { channel , user } ) ; <nl> - } <nl> - <nl> - auto AuthSessionData : : megagroupParticipantAdded ( ) const - > rpl : : producer < MegagroupParticipant > { <nl> - return _megagroupParticipantAdded . events ( ) ; <nl> - } <nl> - <nl> - rpl : : producer < not_null < UserData * > > AuthSessionData : : megagroupParticipantAdded ( <nl> - not_null < ChannelData * > channel ) const { <nl> - return megagroupParticipantAdded ( <nl> - ) | rpl : : filter ( [ channel ] ( auto updateChannel , auto user ) { <nl> - return ( updateChannel = = channel ) ; <nl> - } ) | rpl : : map ( [ ] ( auto updateChannel , auto user ) { <nl> - return user ; <nl> - } ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : setTabbedSelectorSectionEnabled ( bool enabled ) { <nl> + void AuthSessionSettings : : setTabbedSelectorSectionEnabled ( bool enabled ) { <nl> _variables . tabbedSelectorSectionEnabled = enabled ; <nl> if ( enabled ) { <nl> setThirdSectionInfoEnabled ( false ) ; <nl> void AuthSessionData : : setTabbedSelectorSectionEnabled ( bool enabled ) { <nl> setTabbedReplacedWithInfo ( false ) ; <nl> } <nl> <nl> - rpl : : producer < bool > AuthSessionData : : tabbedReplacedWithInfoValue ( ) const { <nl> + rpl : : producer < bool > AuthSessionSettings : : tabbedReplacedWithInfoValue ( ) const { <nl> return _tabbedReplacedWithInfoValue . events_starting_with ( <nl> tabbedReplacedWithInfo ( ) ) ; <nl> } <nl> <nl> - void AuthSessionData : : setThirdSectionInfoEnabled ( bool enabled ) { <nl> + void AuthSessionSettings : : setThirdSectionInfoEnabled ( bool enabled ) { <nl> if ( _variables . thirdSectionInfoEnabled ! = enabled ) { <nl> _variables . thirdSectionInfoEnabled = enabled ; <nl> if ( enabled ) { <nl> void AuthSessionData : : setThirdSectionInfoEnabled ( bool enabled ) { <nl> } <nl> } <nl> <nl> - rpl : : producer < bool > AuthSessionData : : thirdSectionInfoEnabledValue ( ) const { <nl> + rpl : : producer < bool > AuthSessionSettings : : thirdSectionInfoEnabledValue ( ) const { <nl> return _thirdSectionInfoEnabledValue . events_starting_with ( <nl> thirdSectionInfoEnabled ( ) ) ; <nl> } <nl> <nl> - void AuthSessionData : : setTabbedReplacedWithInfo ( bool enabled ) { <nl> + void AuthSessionSettings : : setTabbedReplacedWithInfo ( bool enabled ) { <nl> if ( _tabbedReplacedWithInfo ! = enabled ) { <nl> _tabbedReplacedWithInfo = enabled ; <nl> _tabbedReplacedWithInfoValue . fire_copy ( enabled ) ; <nl> } <nl> } <nl> <nl> - QString AuthSessionData : : getSoundPath ( const QString & key ) const { <nl> + QString AuthSessionSettings : : getSoundPath ( const QString & key ) const { <nl> auto it = _variables . soundOverrides . constFind ( key ) ; <nl> if ( it ! = _variables . soundOverrides . end ( ) ) { <nl> return it . value ( ) ; <nl> QString AuthSessionData : : getSoundPath ( const QString & key ) const { <nl> return qsl ( " : / sounds / " ) + key + qsl ( " . mp3 " ) ; <nl> } <nl> <nl> - void AuthSessionData : : setDialogsWidthRatio ( float64 ratio ) { <nl> + void AuthSessionSettings : : setDialogsWidthRatio ( float64 ratio ) { <nl> _variables . dialogsWidthRatio = ratio ; <nl> } <nl> <nl> - float64 AuthSessionData : : dialogsWidthRatio ( ) const { <nl> + float64 AuthSessionSettings : : dialogsWidthRatio ( ) const { <nl> return _variables . dialogsWidthRatio . current ( ) ; <nl> } <nl> <nl> - rpl : : producer < float64 > AuthSessionData : : dialogsWidthRatioChanges ( ) const { <nl> + rpl : : producer < float64 > AuthSessionSettings : : dialogsWidthRatioChanges ( ) const { <nl> return _variables . dialogsWidthRatio . changes ( ) ; <nl> } <nl> <nl> - void AuthSessionData : : setThirdColumnWidth ( int width ) { <nl> + void AuthSessionSettings : : setThirdColumnWidth ( int width ) { <nl> _variables . thirdColumnWidth = width ; <nl> } <nl> <nl> - int AuthSessionData : : thirdColumnWidth ( ) const { <nl> + int AuthSessionSettings : : thirdColumnWidth ( ) const { <nl> return _variables . thirdColumnWidth . current ( ) ; <nl> } <nl> <nl> - rpl : : producer < int > AuthSessionData : : thirdColumnWidthChanges ( ) const { <nl> + rpl : : producer < int > AuthSessionSettings : : thirdColumnWidthChanges ( ) const { <nl> return _variables . thirdColumnWidth . changes ( ) ; <nl> } <nl> <nl> - void AuthSessionData : : markStickersUpdated ( ) { <nl> - _stickersUpdated . fire ( { } ) ; <nl> - } <nl> - <nl> - rpl : : producer < > AuthSessionData : : stickersUpdated ( ) const { <nl> - return _stickersUpdated . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : markSavedGifsUpdated ( ) { <nl> - _savedGifsUpdated . fire ( { } ) ; <nl> - } <nl> - <nl> - rpl : : producer < > AuthSessionData : : savedGifsUpdated ( ) const { <nl> - return _savedGifsUpdated . events ( ) ; <nl> - } <nl> - <nl> - void AuthSessionData : : userIsContactUpdated ( not_null < UserData * > user ) { <nl> - const auto & items = App : : sharedContactItems ( ) ; <nl> - const auto i = items . constFind ( peerToUser ( user - > id ) ) ; <nl> - if ( i ! = items . cend ( ) ) { <nl> - for ( const auto item : std : : as_const ( i . value ( ) ) ) { <nl> - item - > setPendingInitDimensions ( ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - HistoryItemsList AuthSessionData : : idsToItems ( <nl> - const MessageIdsList & ids ) const { <nl> - return ranges : : view : : all ( <nl> - ids <nl> - ) | ranges : : view : : transform ( [ ] ( const FullMsgId & fullId ) { <nl> - return App : : histItemById ( fullId ) ; <nl> - } ) | ranges : : view : : filter ( [ ] ( HistoryItem * item ) { <nl> - return item ! = nullptr ; <nl> - } ) | ranges : : view : : transform ( [ ] ( HistoryItem * item ) { <nl> - return not_null < HistoryItem * > ( item ) ; <nl> - } ) | ranges : : to_vector ; <nl> - } <nl> - <nl> - MessageIdsList AuthSessionData : : itemsToIds ( <nl> - const HistoryItemsList & items ) const { <nl> - return ranges : : view : : all ( <nl> - items <nl> - ) | ranges : : view : : transform ( [ ] ( not_null < HistoryItem * > item ) { <nl> - return item - > fullId ( ) ; <nl> - } ) | ranges : : to_vector ; <nl> - } <nl> - <nl> - MessageIdsList AuthSessionData : : groupToIds ( <nl> - not_null < HistoryMessageGroup * > group ) const { <nl> - auto result = itemsToIds ( group - > others ) ; <nl> - result . push_back ( group - > leader - > fullId ( ) ) ; <nl> - return result ; <nl> - } <nl> - <nl> - not_null < Data : : Feed * > AuthSessionData : : feed ( FeedId id ) { <nl> - if ( const auto result = feedLoaded ( id ) ) { <nl> - return result ; <nl> - } <nl> - const auto [ it , ok ] = _feeds . emplace ( <nl> - id , <nl> - std : : make_unique < Data : : Feed > ( id ) ) ; <nl> - return it - > second . get ( ) ; <nl> - } <nl> - <nl> - Data : : Feed * AuthSessionData : : feedLoaded ( FeedId id ) { <nl> - const auto it = _feeds . find ( id ) ; <nl> - return ( it = = _feeds . end ( ) ) ? nullptr : it - > second . get ( ) ; <nl> - } <nl> - <nl> AuthSession & Auth ( ) { <nl> auto result = Messenger : : Instance ( ) . authSession ( ) ; <nl> Assert ( result ! = nullptr ) ; <nl> AuthSession & Auth ( ) { <nl> AuthSession : : AuthSession ( UserId userId ) <nl> : _userId ( userId ) <nl> , _autoLockTimer ( [ this ] { checkAutoLock ( ) ; } ) <nl> + , _data ( std : : make_unique < Data : : Session > ( ) ) <nl> , _api ( std : : make_unique < ApiWrap > ( this ) ) <nl> , _calls ( std : : make_unique < Calls : : Instance > ( ) ) <nl> , _downloader ( std : : make_unique < Storage : : Downloader > ( ) ) <nl> bool AuthSession : : validateSelf ( const MTPUser & user ) { <nl> return true ; <nl> } <nl> <nl> - void AuthSession : : saveDataDelayed ( TimeMs delay ) { <nl> + void AuthSession : : saveSettingsDelayed ( TimeMs delay ) { <nl> Expects ( this = = & Auth ( ) ) ; <nl> _saveDataTimer . callOnce ( delay ) ; <nl> } <nl> void AuthSession : : checkAutoLock ( ) { <nl> auto now = getms ( true ) ; <nl> auto shouldLockInMs = Global : : AutoLock ( ) * 1000LL ; <nl> auto idleForMs = psIdleTime ( ) ; <nl> - auto notPlayingVideoForMs = now - data ( ) . lastTimeVideoPlayedAt ( ) ; <nl> + auto notPlayingVideoForMs = now - settings ( ) . lastTimeVideoPlayedAt ( ) ; <nl> auto checkTimeMs = qMin ( idleForMs , notPlayingVideoForMs ) ; <nl> if ( checkTimeMs > = shouldLockInMs | | ( _shouldLockAt > 0 & & now > _shouldLockAt + kAutoLockTimeoutLateMs ) ) { <nl> Messenger : : Instance ( ) . setupPasscode ( ) ; <nl> mmm a / Telegram / SourceFiles / auth_session . h <nl> ppp b / Telegram / SourceFiles / auth_session . h <nl> For license and copyright information please follow this link : <nl> # include < rpl / filter . h > <nl> # include < rpl / variable . h > <nl> # include " base / timer . h " <nl> - # include " chat_helpers / stickers . h " <nl> <nl> class ApiWrap ; <nl> enum class SendFilesWay ; <nl> <nl> namespace Data { <nl> - class Feed ; <nl> + class Session ; <nl> } / / namespace Data <nl> <nl> namespace Storage { <nl> namespace Core { <nl> class Changelogs ; <nl> } / / namespace Core <nl> <nl> - class AuthSessionData final { <nl> + class AuthSessionSettings final { <nl> public : <nl> - AuthSessionData ( ) ; <nl> - ~ AuthSessionData ( ) ; <nl> - <nl> - base : : Variable < bool > & contactsLoaded ( ) { <nl> - return _contactsLoaded ; <nl> - } <nl> - base : : Variable < bool > & allChatsLoaded ( ) { <nl> - return _allChatsLoaded ; <nl> - } <nl> - base : : Observable < void > & moreChatsLoaded ( ) { <nl> - return _moreChatsLoaded ; <nl> - } <nl> - base : : Observable < void > & pendingHistoryResize ( ) { <nl> - return _pendingHistoryResize ; <nl> - } <nl> - struct ItemVisibilityQuery { <nl> - not_null < HistoryItem * > item ; <nl> - not_null < bool * > isVisible ; <nl> - } ; <nl> - base : : Observable < ItemVisibilityQuery > & queryItemVisibility ( ) { <nl> - return _queryItemVisibility ; <nl> - } <nl> - void markItemLayoutChanged ( not_null < const HistoryItem * > item ) ; <nl> - rpl : : producer < not_null < const HistoryItem * > > itemLayoutChanged ( ) const ; <nl> - void requestItemRepaint ( not_null < const HistoryItem * > item ) ; <nl> - rpl : : producer < not_null < const HistoryItem * > > itemRepaintRequest ( ) const ; <nl> - void markItemRemoved ( not_null < const HistoryItem * > item ) ; <nl> - rpl : : producer < not_null < const HistoryItem * > > itemRemoved ( ) const ; <nl> - void markHistoryUnloaded ( not_null < const History * > history ) ; <nl> - rpl : : producer < not_null < const History * > > historyUnloaded ( ) const ; <nl> - void markHistoryCleared ( not_null < const History * > history ) ; <nl> - rpl : : producer < not_null < const History * > > historyCleared ( ) const ; <nl> - using MegagroupParticipant = std : : tuple < <nl> - not_null < ChannelData * > , <nl> - not_null < UserData * > > ; <nl> - void removeMegagroupParticipant ( <nl> - not_null < ChannelData * > channel , <nl> - not_null < UserData * > user ) ; <nl> - rpl : : producer < MegagroupParticipant > megagroupParticipantRemoved ( ) const ; <nl> - rpl : : producer < not_null < UserData * > > megagroupParticipantRemoved ( <nl> - not_null < ChannelData * > channel ) const ; <nl> - void addNewMegagroupParticipant ( <nl> - not_null < ChannelData * > channel , <nl> - not_null < UserData * > user ) ; <nl> - rpl : : producer < MegagroupParticipant > megagroupParticipantAdded ( ) const ; <nl> - rpl : : producer < not_null < UserData * > > megagroupParticipantAdded ( <nl> - not_null < ChannelData * > channel ) const ; <nl> - <nl> - void moveFrom ( AuthSessionData & & other ) { <nl> + void moveFrom ( AuthSessionSettings & & other ) { <nl> _variables = std : : move ( other . _variables ) ; <nl> } <nl> QByteArray serialize ( ) const ; <nl> void constructFromSerialized ( const QByteArray & serialized ) ; <nl> <nl> - bool lastSeenWarningSeen ( ) const { <nl> - return _variables . lastSeenWarningSeen ; <nl> - } <nl> void setLastSeenWarningSeen ( bool lastSeenWarningSeen ) { <nl> _variables . lastSeenWarningSeen = lastSeenWarningSeen ; <nl> } <nl> + bool lastSeenWarningSeen ( ) const { <nl> + return _variables . lastSeenWarningSeen ; <nl> + } <nl> void setSendFilesWay ( SendFilesWay way ) { <nl> _variables . sendFilesWay = way ; <nl> } <nl> class AuthSessionData final { <nl> int thirdColumnWidth ( ) const ; <nl> rpl : : producer < int > thirdColumnWidthChanges ( ) const ; <nl> <nl> - void markStickersUpdated ( ) ; <nl> - rpl : : producer < > stickersUpdated ( ) const ; <nl> - void markSavedGifsUpdated ( ) ; <nl> - rpl : : producer < > savedGifsUpdated ( ) const ; <nl> void setGroupStickersSectionHidden ( PeerId peerId ) { <nl> _variables . groupStickersSectionHidden . insert ( peerId ) ; <nl> } <nl> class AuthSessionData final { <nl> void removeGroupStickersSectionHidden ( PeerId peerId ) { <nl> _variables . groupStickersSectionHidden . remove ( peerId ) ; <nl> } <nl> - bool stickersUpdateNeeded ( TimeMs now ) const { <nl> - return stickersUpdateNeeded ( _lastStickersUpdate , now ) ; <nl> - } <nl> - void setLastStickersUpdate ( TimeMs update ) { <nl> - _lastStickersUpdate = update ; <nl> - } <nl> - bool recentStickersUpdateNeeded ( TimeMs now ) const { <nl> - return stickersUpdateNeeded ( _lastRecentStickersUpdate , now ) ; <nl> - } <nl> - void setLastRecentStickersUpdate ( TimeMs update ) { <nl> - _lastRecentStickersUpdate = update ; <nl> - } <nl> - bool favedStickersUpdateNeeded ( TimeMs now ) const { <nl> - return stickersUpdateNeeded ( _lastFavedStickersUpdate , now ) ; <nl> - } <nl> - void setLastFavedStickersUpdate ( TimeMs update ) { <nl> - _lastFavedStickersUpdate = update ; <nl> - } <nl> - bool featuredStickersUpdateNeeded ( TimeMs now ) const { <nl> - return stickersUpdateNeeded ( _lastFeaturedStickersUpdate , now ) ; <nl> - } <nl> - void setLastFeaturedStickersUpdate ( TimeMs update ) { <nl> - _lastFeaturedStickersUpdate = update ; <nl> - } <nl> - bool savedGifsUpdateNeeded ( TimeMs now ) const { <nl> - return stickersUpdateNeeded ( _lastSavedGifsUpdate , now ) ; <nl> - } <nl> - void setLastSavedGifsUpdate ( TimeMs update ) { <nl> - _lastSavedGifsUpdate = update ; <nl> - } <nl> - int featuredStickerSetsUnreadCount ( ) const { <nl> - return _featuredStickerSetsUnreadCount . current ( ) ; <nl> - } <nl> - void setFeaturedStickerSetsUnreadCount ( int count ) { <nl> - _featuredStickerSetsUnreadCount = count ; <nl> - } <nl> - rpl : : producer < int > featuredStickerSetsUnreadCountValue ( ) const { <nl> - return _featuredStickerSetsUnreadCount . value ( ) ; <nl> - } <nl> - const Stickers : : Sets & stickerSets ( ) const { <nl> - return _stickerSets ; <nl> - } <nl> - Stickers : : Sets & stickerSetsRef ( ) { <nl> - return _stickerSets ; <nl> - } <nl> - const Stickers : : Order & stickerSetsOrder ( ) const { <nl> - return _stickerSetsOrder ; <nl> - } <nl> - Stickers : : Order & stickerSetsOrderRef ( ) { <nl> - return _stickerSetsOrder ; <nl> - } <nl> - const Stickers : : Order & featuredStickerSetsOrder ( ) const { <nl> - return _featuredStickerSetsOrder ; <nl> - } <nl> - Stickers : : Order & featuredStickerSetsOrderRef ( ) { <nl> - return _featuredStickerSetsOrder ; <nl> - } <nl> - const Stickers : : Order & archivedStickerSetsOrder ( ) const { <nl> - return _archivedStickerSetsOrder ; <nl> - } <nl> - Stickers : : Order & archivedStickerSetsOrderRef ( ) { <nl> - return _archivedStickerSetsOrder ; <nl> - } <nl> - const Stickers : : SavedGifs & savedGifs ( ) const { <nl> - return _savedGifs ; <nl> - } <nl> - Stickers : : SavedGifs & savedGifsRef ( ) { <nl> - return _savedGifs ; <nl> - } <nl> - <nl> - HistoryItemsList idsToItems ( const MessageIdsList & ids ) const ; <nl> - MessageIdsList itemsToIds ( const HistoryItemsList & items ) const ; <nl> - MessageIdsList groupToIds ( not_null < HistoryMessageGroup * > group ) const ; <nl> - <nl> - not_null < Data : : Feed * > feed ( FeedId id ) ; <nl> - Data : : Feed * feedLoaded ( FeedId id ) ; <nl> <nl> private : <nl> struct Variables { <nl> class AuthSessionData final { <nl> = kDefaultThirdColumnWidth ; / / per - window <nl> } ; <nl> <nl> - bool stickersUpdateNeeded ( TimeMs lastUpdate , TimeMs now ) const { <nl> - constexpr auto kStickersUpdateTimeout = TimeMs ( 3600 ' 000 ) ; <nl> - return ( lastUpdate = = 0 ) <nl> - | | ( now > = lastUpdate + kStickersUpdateTimeout ) ; <nl> - } <nl> - void userIsContactUpdated ( not_null < UserData * > user ) ; <nl> - <nl> - base : : Variable < bool > _contactsLoaded = { false } ; <nl> - base : : Variable < bool > _allChatsLoaded = { false } ; <nl> - base : : Observable < void > _moreChatsLoaded ; <nl> - base : : Observable < void > _pendingHistoryResize ; <nl> - base : : Observable < ItemVisibilityQuery > _queryItemVisibility ; <nl> - rpl : : event_stream < not_null < const HistoryItem * > > _itemLayoutChanged ; <nl> - rpl : : event_stream < not_null < const HistoryItem * > > _itemRepaintRequest ; <nl> - rpl : : event_stream < not_null < const HistoryItem * > > _itemRemoved ; <nl> - rpl : : event_stream < not_null < const History * > > _historyUnloaded ; <nl> - rpl : : event_stream < not_null < const History * > > _historyCleared ; <nl> - rpl : : event_stream < MegagroupParticipant > _megagroupParticipantRemoved ; <nl> - rpl : : event_stream < MegagroupParticipant > _megagroupParticipantAdded ; <nl> - <nl> - rpl : : event_stream < > _stickersUpdated ; <nl> - rpl : : event_stream < > _savedGifsUpdated ; <nl> - TimeMs _lastStickersUpdate = 0 ; <nl> - TimeMs _lastRecentStickersUpdate = 0 ; <nl> - TimeMs _lastFavedStickersUpdate = 0 ; <nl> - TimeMs _lastFeaturedStickersUpdate = 0 ; <nl> - TimeMs _lastSavedGifsUpdate = 0 ; <nl> - rpl : : variable < int > _featuredStickerSetsUnreadCount = 0 ; <nl> - Stickers : : Sets _stickerSets ; <nl> - Stickers : : Order _stickerSetsOrder ; <nl> - Stickers : : Order _featuredStickerSetsOrder ; <nl> - Stickers : : Order _archivedStickerSetsOrder ; <nl> - Stickers : : SavedGifs _savedGifs ; <nl> - <nl> - base : : flat_map < FeedId , std : : unique_ptr < Data : : Feed > > _feeds ; <nl> - <nl> rpl : : event_stream < bool > _thirdSectionInfoEnabledValue ; <nl> bool _tabbedReplacedWithInfo = false ; <nl> rpl : : event_stream < bool > _tabbedReplacedWithInfoValue ; <nl> class AuthSessionData final { <nl> Variables _variables ; <nl> TimeMs _lastTimeVideoPlayedAt = 0 ; <nl> <nl> - rpl : : lifetime _lifetime ; <nl> - <nl> } ; <nl> <nl> / / One per Messenger . <nl> class AuthSession final : private base : : Subscriber { <nl> return * _notifications ; <nl> } <nl> <nl> - AuthSessionData & data ( ) { <nl> - return _data ; <nl> + Data : : Session & data ( ) { <nl> + return * _data ; <nl> + } <nl> + AuthSessionSettings & settings ( ) { <nl> + return _settings ; <nl> } <nl> - void saveDataDelayed ( TimeMs delay = kDefaultSaveDelay ) ; <nl> + void saveSettingsDelayed ( TimeMs delay = kDefaultSaveDelay ) ; <nl> <nl> ApiWrap & api ( ) { <nl> return * _api ; <nl> class AuthSession final : private base : : Subscriber { <nl> static constexpr auto kDefaultSaveDelay = TimeMs ( 1000 ) ; <nl> <nl> const UserId _userId = 0 ; <nl> - AuthSessionData _data ; <nl> + AuthSessionSettings _settings ; <nl> base : : Timer _saveDataTimer ; <nl> <nl> TimeMs _shouldLockAt = 0 ; <nl> base : : Timer _autoLockTimer ; <nl> <nl> + const std : : unique_ptr < Data : : Session > _data ; <nl> const std : : unique_ptr < ApiWrap > _api ; <nl> const std : : unique_ptr < Calls : : Instance > _calls ; <nl> const std : : unique_ptr < Storage : : Downloader > _downloader ; <nl> mmm a / Telegram / SourceFiles / boxes / peer_list_controllers . cpp <nl> ppp b / Telegram / SourceFiles / boxes / peer_list_controllers . cpp <nl> For license and copyright information please follow this link : <nl> # include " observer_peer . h " <nl> # include " ui / widgets / checkbox . h " <nl> # include " auth_session . h " <nl> + # include " data / data_session . h " <nl> # include " apiwrap . h " <nl> # include " mainwidget . h " <nl> # include " lang / lang_keys . h " <nl> mmm a / Telegram / SourceFiles / boxes / send_files_box . cpp <nl> ppp b / Telegram / SourceFiles / boxes / send_files_box . cpp <nl> void SendFilesBox : : initSendWay ( ) { <nl> ? SendFilesWay : : Album <nl> : SendFilesWay : : Photos ; <nl> } <nl> - const auto currentWay = Auth ( ) . data ( ) . sendFilesWay ( ) ; <nl> + const auto currentWay = Auth ( ) . settings ( ) . sendFilesWay ( ) ; <nl> if ( currentWay = = SendFilesWay : : Files ) { <nl> return currentWay ; <nl> } else if ( currentWay = = SendFilesWay : : Album ) { <nl> void SendFilesBox : : send ( bool ctrlShiftEnter ) { <nl> const auto way = _sendWay ? _sendWay - > value ( ) : Way : : Files ; <nl> <nl> if ( _compressConfirm = = CompressConfirm : : Auto ) { <nl> - const auto oldWay = Auth ( ) . data ( ) . sendFilesWay ( ) ; <nl> + const auto oldWay = Auth ( ) . settings ( ) . sendFilesWay ( ) ; <nl> if ( way ! = oldWay ) { <nl> / / Check if the user _could_ use the old value , but didn ' t . <nl> if ( ( oldWay = = Way : : Album & & _sendAlbum ) <nl> void SendFilesBox : : send ( bool ctrlShiftEnter ) { <nl> | | ( oldWay = = Way : : Files & & _sendFiles ) <nl> | | ( way = = Way : : Files & & ( _sendAlbum | | _sendPhotos ) ) ) { <nl> / / And in that case save it to settings . <nl> - Auth ( ) . data ( ) . setSendFilesWay ( way ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + Auth ( ) . settings ( ) . setSendFilesWay ( way ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> } <nl> } <nl> } <nl> mmm a / Telegram / SourceFiles / boxes / sticker_set_box . cpp <nl> ppp b / Telegram / SourceFiles / boxes / sticker_set_box . cpp <nl> For license and copyright information please follow this link : <nl> # include " boxes / sticker_set_box . h " <nl> <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " lang / lang_keys . h " <nl> # include " mainwidget . h " <nl> # include " mainwindow . h " <nl> mmm a / Telegram / SourceFiles / boxes / stickers_box . cpp <nl> ppp b / Telegram / SourceFiles / boxes / stickers_box . cpp <nl> For license and copyright information please follow this link : <nl> # include " stickers_box . h " <nl> <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " lang / lang_keys . h " <nl> # include " mainwidget . h " <nl> # include " chat_helpers / stickers . h " <nl> mmm a / Telegram / SourceFiles / calls / calls_box_controller . cpp <nl> ppp b / Telegram / SourceFiles / calls / calls_box_controller . cpp <nl> For license and copyright information please follow this link : <nl> # include " history / history_media_types . h " <nl> # include " mainwidget . h " <nl> # include " auth_session . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace Calls { <nl> namespace { <nl> mmm a / Telegram / SourceFiles / calls / calls_call . cpp <nl> ppp b / Telegram / SourceFiles / calls / calls_call . cpp <nl> QString Call : : getDebugLog ( ) const { <nl> <nl> void Call : : startWaitingTrack ( ) { <nl> _waitingTrack = Media : : Audio : : Current ( ) . createTrack ( ) ; <nl> - auto trackFileName = Auth ( ) . data ( ) . getSoundPath ( ( _type = = Type : : Outgoing ) ? qsl ( " call_outgoing " ) : qsl ( " call_incoming " ) ) ; <nl> + auto trackFileName = Auth ( ) . settings ( ) . getSoundPath ( <nl> + ( _type = = Type : : Outgoing ) <nl> + ? qsl ( " call_outgoing " ) <nl> + : qsl ( " call_incoming " ) ) ; <nl> _waitingTrack - > samplePeakEach ( kSoundSampleMs ) ; <nl> _waitingTrack - > fillFromFile ( trackFileName ) ; <nl> _waitingTrack - > playInLoop ( ) ; <nl> mmm a / Telegram / SourceFiles / calls / calls_instance . cpp <nl> ppp b / Telegram / SourceFiles / calls / calls_instance . cpp <nl> void Instance : : playSound ( Sound sound ) { <nl> case Sound : : Busy : { <nl> if ( ! _callBusyTrack ) { <nl> _callBusyTrack = Media : : Audio : : Current ( ) . createTrack ( ) ; <nl> - _callBusyTrack - > fillFromFile ( Auth ( ) . data ( ) . getSoundPath ( qsl ( " call_busy " ) ) ) ; <nl> + _callBusyTrack - > fillFromFile ( <nl> + Auth ( ) . settings ( ) . getSoundPath ( qsl ( " call_busy " ) ) ) ; <nl> } <nl> _callBusyTrack - > playOnce ( ) ; <nl> } break ; <nl> void Instance : : playSound ( Sound sound ) { <nl> case Sound : : Ended : { <nl> if ( ! _callEndedTrack ) { <nl> _callEndedTrack = Media : : Audio : : Current ( ) . createTrack ( ) ; <nl> - _callEndedTrack - > fillFromFile ( Auth ( ) . data ( ) . getSoundPath ( qsl ( " call_end " ) ) ) ; <nl> + _callEndedTrack - > fillFromFile ( <nl> + Auth ( ) . settings ( ) . getSoundPath ( qsl ( " call_end " ) ) ) ; <nl> } <nl> _callEndedTrack - > playOnce ( ) ; <nl> } break ; <nl> void Instance : : playSound ( Sound sound ) { <nl> case Sound : : Connecting : { <nl> if ( ! _callConnectingTrack ) { <nl> _callConnectingTrack = Media : : Audio : : Current ( ) . createTrack ( ) ; <nl> - _callConnectingTrack - > fillFromFile ( Auth ( ) . data ( ) . getSoundPath ( qsl ( " call_connect " ) ) ) ; <nl> + _callConnectingTrack - > fillFromFile ( <nl> + Auth ( ) . settings ( ) . getSoundPath ( qsl ( " call_connect " ) ) ) ; <nl> } <nl> _callConnectingTrack - > playOnce ( ) ; <nl> } break ; <nl> mmm a / Telegram / SourceFiles / chat_helpers / gifs_list_widget . cpp <nl> ppp b / Telegram / SourceFiles / chat_helpers / gifs_list_widget . cpp <nl> For license and copyright information please follow this link : <nl> <nl> # include " data / data_photo . h " <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " styles / style_chat_helpers . h " <nl> # include " ui / widgets / buttons . h " <nl> # include " ui / widgets / input_fields . h " <nl> mmm a / Telegram / SourceFiles / chat_helpers / stickers . cpp <nl> ppp b / Telegram / SourceFiles / chat_helpers / stickers . cpp <nl> For license and copyright information please follow this link : <nl> # include " stickers . h " <nl> <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " boxes / stickers_box . h " <nl> # include " boxes / confirm_box . h " <nl> # include " lang / lang_keys . h " <nl> mmm a / Telegram / SourceFiles / chat_helpers / stickers_list_widget . cpp <nl> ppp b / Telegram / SourceFiles / chat_helpers / stickers_list_widget . cpp <nl> For license and copyright information please follow this link : <nl> # include " chat_helpers / stickers_list_widget . h " <nl> <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " ui / widgets / buttons . h " <nl> # include " ui / effects / ripple_animation . h " <nl> # include " boxes / stickers_box . h " <nl> void StickersListWidget : : refreshMegagroupStickers ( GroupStickersPlace place ) { <nl> } ; <nl> if ( _megagroupSet - > mgInfo - > stickerSet . type ( ) = = mtpc_inputStickerSetEmpty ) { <nl> if ( canEdit ) { <nl> - auto hidden = Auth ( ) . data ( ) . isGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> + auto hidden = Auth ( ) . settings ( ) . isGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> if ( isShownHere ( hidden ) ) { <nl> _mySets . push_back ( Set ( Stickers : : MegagroupSetId , MTPDstickerSet_ClientFlag : : f_special | 0 , lang ( lng_group_stickers ) , 0 ) ) ; <nl> } <nl> } <nl> return ; <nl> } <nl> - auto hidden = Auth ( ) . data ( ) . isGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> + auto hidden = Auth ( ) . settings ( ) . isGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> auto removeHiddenForGroup = [ this , & hidden ] { <nl> if ( hidden ) { <nl> - Auth ( ) . data ( ) . removeGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> + Auth ( ) . settings ( ) . removeGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> Local : : writeUserSettings ( ) ; <nl> hidden = false ; <nl> } <nl> void StickersListWidget : : installSet ( uint64 setId ) { <nl> <nl> void StickersListWidget : : removeMegagroupSet ( bool locally ) { <nl> if ( locally ) { <nl> - Auth ( ) . data ( ) . setGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> + Auth ( ) . settings ( ) . setGroupStickersSectionHidden ( _megagroupSet - > id ) ; <nl> Local : : writeUserSettings ( ) ; <nl> refreshStickers ( ) ; <nl> return ; <nl> mmm a / Telegram / SourceFiles / chat_helpers / stickers_list_widget . h <nl> ppp b / Telegram / SourceFiles / chat_helpers / stickers_list_widget . h <nl> For license and copyright information please follow this link : <nl> # pragma once <nl> <nl> # include " chat_helpers / tabbed_selector . h " <nl> + # include " chat_helpers / stickers . h " <nl> # include " base / variant . h " <nl> <nl> namespace Window { <nl> mmm a / Telegram / SourceFiles / chat_helpers / tabbed_selector . cpp <nl> ppp b / Telegram / SourceFiles / chat_helpers / tabbed_selector . cpp <nl> TabbedSelector : : TabbedSelector ( QWidget * parent , not_null < Window : : Controller * > co <nl> Tab { SelectorTab : : Stickers , object_ptr < StickersListWidget > ( this , controller ) } , <nl> Tab { SelectorTab : : Gifs , object_ptr < GifsListWidget > ( this , controller ) } , <nl> } } <nl> - , _currentTabType ( Auth ( ) . data ( ) . selectorTab ( ) ) { <nl> + , _currentTabType ( Auth ( ) . settings ( ) . selectorTab ( ) ) { <nl> resize ( st : : emojiPanWidth , st : : emojiPanMaxHeight ) ; <nl> <nl> for ( auto & tab : _tabs ) { <nl> void TabbedSelector : : switchTab ( ) { <nl> _a_slide . start ( [ this ] { update ( ) ; } , 0 . , 1 . , st : : emojiPanSlideDuration , anim : : linear ) ; <nl> update ( ) ; <nl> <nl> - Auth ( ) . data ( ) . setSelectorTab ( _currentTabType ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + Auth ( ) . settings ( ) . setSelectorTab ( _currentTabType ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> } <nl> <nl> not_null < EmojiListWidget * > TabbedSelector : : emoji ( ) const { <nl> mmm a / Telegram / SourceFiles / core / changelogs . cpp <nl> ppp b / Telegram / SourceFiles / core / changelogs . cpp <nl> For license and copyright information please follow this link : <nl> <nl> # include " storage / localstorage . h " <nl> # include " lang / lang_keys . h " <nl> + # include " data / data_session . h " <nl> # include " mainwindow . h " <nl> # include " apiwrap . h " <nl> <nl> mmm a / Telegram / SourceFiles / data / data_document . cpp <nl> ppp b / Telegram / SourceFiles / data / data_document . cpp <nl> For license and copyright information please follow this link : <nl> * / <nl> # include " data / data_document . h " <nl> <nl> + # include " data / data_session . h " <nl> # include " lang / lang_keys . h " <nl> # include " inline_bots / inline_bot_layout_item . h " <nl> # include " mainwidget . h " <nl> mmm a / Telegram / SourceFiles / data / data_peer . cpp <nl> ppp b / Telegram / SourceFiles / data / data_peer . cpp <nl> For license and copyright information please follow this link : <nl> # include " data / data_channel_admins . h " <nl> # include " data / data_photo . h " <nl> # include " data / data_feed . h " <nl> + # include " data / data_session . h " <nl> # include " lang / lang_keys . h " <nl> # include " observer_peer . h " <nl> # include " mainwidget . h " <nl> mmm a / Telegram / SourceFiles / data / data_photo . cpp <nl> ppp b / Telegram / SourceFiles / data / data_photo . cpp <nl> For license and copyright information please follow this link : <nl> * / <nl> # include " data / data_photo . h " <nl> <nl> + # include " data / data_session . h " <nl> # include " mainwidget . h " <nl> # include " history / history_media_types . h " <nl> # include " auth_session . h " <nl> mmm a / Telegram / SourceFiles / data / data_search_controller . cpp <nl> ppp b / Telegram / SourceFiles / data / data_search_controller . cpp <nl> For license and copyright information please follow this link : <nl> # include " data / data_search_controller . h " <nl> <nl> # include " auth_session . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace Api { <nl> namespace { <nl> new file mode 100644 <nl> index 00000000000 . . cedeb541f78 <nl> mmm / dev / null <nl> ppp b / Telegram / SourceFiles / data / data_session . cpp <nl> <nl> + / * <nl> + This file is part of Telegram Desktop , <nl> + the official desktop application for the Telegram messaging service . <nl> + <nl> + For license and copyright information please follow this link : <nl> + https : / / github . com / telegramdesktop / tdesktop / blob / master / LEGAL <nl> + * / <nl> + # include " data / data_session . h " <nl> + <nl> + # include " observer_peer . h " <nl> + # include " history / history_item_components . h " <nl> + # include " data / data_feed . h " <nl> + <nl> + namespace Data { <nl> + <nl> + Session : : Session ( ) { <nl> + Notify : : PeerUpdateViewer ( <nl> + Notify : : PeerUpdate : : Flag : : UserIsContact <nl> + ) | rpl : : map ( [ ] ( const Notify : : PeerUpdate & update ) { <nl> + return update . peer - > asUser ( ) ; <nl> + } ) | rpl : : filter ( [ ] ( UserData * user ) { <nl> + return user ! = nullptr ; <nl> + } ) | rpl : : start_with_next ( [ = ] ( not_null < UserData * > user ) { <nl> + userIsContactUpdated ( user ) ; <nl> + } , _lifetime ) ; <nl> + } <nl> + <nl> + Session : : ~ Session ( ) = default ; <nl> + <nl> + void Session : : markItemLayoutChanged ( not_null < const HistoryItem * > item ) { <nl> + _itemLayoutChanged . fire_copy ( item ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < const HistoryItem * > > Session : : itemLayoutChanged ( ) const { <nl> + return _itemLayoutChanged . events ( ) ; <nl> + } <nl> + <nl> + void Session : : requestItemRepaint ( not_null < const HistoryItem * > item ) { <nl> + _itemRepaintRequest . fire_copy ( item ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < const HistoryItem * > > Session : : itemRepaintRequest ( ) const { <nl> + return _itemRepaintRequest . events ( ) ; <nl> + } <nl> + <nl> + void Session : : markItemRemoved ( not_null < const HistoryItem * > item ) { <nl> + _itemRemoved . fire_copy ( item ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < const HistoryItem * > > Session : : itemRemoved ( ) const { <nl> + return _itemRemoved . events ( ) ; <nl> + } <nl> + <nl> + void Session : : markHistoryUnloaded ( not_null < const History * > history ) { <nl> + _historyUnloaded . fire_copy ( history ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < const History * > > Session : : historyUnloaded ( ) const { <nl> + return _historyUnloaded . events ( ) ; <nl> + } <nl> + <nl> + void Session : : markHistoryCleared ( not_null < const History * > history ) { <nl> + _historyCleared . fire_copy ( history ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < const History * > > Session : : historyCleared ( ) const { <nl> + return _historyCleared . events ( ) ; <nl> + } <nl> + <nl> + void Session : : removeMegagroupParticipant ( <nl> + not_null < ChannelData * > channel , <nl> + not_null < UserData * > user ) { <nl> + _megagroupParticipantRemoved . fire ( { channel , user } ) ; <nl> + } <nl> + <nl> + auto Session : : megagroupParticipantRemoved ( ) const <nl> + - > rpl : : producer < MegagroupParticipant > { <nl> + return _megagroupParticipantRemoved . events ( ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < UserData * > > Session : : megagroupParticipantRemoved ( <nl> + not_null < ChannelData * > channel ) const { <nl> + return megagroupParticipantRemoved ( <nl> + ) | rpl : : filter ( [ channel ] ( auto updateChannel , auto user ) { <nl> + return ( updateChannel = = channel ) ; <nl> + } ) | rpl : : map ( [ ] ( auto updateChannel , auto user ) { <nl> + return user ; <nl> + } ) ; <nl> + } <nl> + <nl> + void Session : : addNewMegagroupParticipant ( <nl> + not_null < ChannelData * > channel , <nl> + not_null < UserData * > user ) { <nl> + _megagroupParticipantAdded . fire ( { channel , user } ) ; <nl> + } <nl> + <nl> + auto Session : : megagroupParticipantAdded ( ) const <nl> + - > rpl : : producer < MegagroupParticipant > { <nl> + return _megagroupParticipantAdded . events ( ) ; <nl> + } <nl> + <nl> + rpl : : producer < not_null < UserData * > > Session : : megagroupParticipantAdded ( <nl> + not_null < ChannelData * > channel ) const { <nl> + return megagroupParticipantAdded ( <nl> + ) | rpl : : filter ( [ channel ] ( auto updateChannel , auto user ) { <nl> + return ( updateChannel = = channel ) ; <nl> + } ) | rpl : : map ( [ ] ( auto updateChannel , auto user ) { <nl> + return user ; <nl> + } ) ; <nl> + } <nl> + <nl> + void Session : : markStickersUpdated ( ) { <nl> + _stickersUpdated . fire ( { } ) ; <nl> + } <nl> + <nl> + rpl : : producer < > Session : : stickersUpdated ( ) const { <nl> + return _stickersUpdated . events ( ) ; <nl> + } <nl> + <nl> + void Session : : markSavedGifsUpdated ( ) { <nl> + _savedGifsUpdated . fire ( { } ) ; <nl> + } <nl> + <nl> + rpl : : producer < > Session : : savedGifsUpdated ( ) const { <nl> + return _savedGifsUpdated . events ( ) ; <nl> + } <nl> + <nl> + void Session : : userIsContactUpdated ( not_null < UserData * > user ) { <nl> + const auto & items = App : : sharedContactItems ( ) ; <nl> + const auto i = items . constFind ( peerToUser ( user - > id ) ) ; <nl> + if ( i ! = items . cend ( ) ) { <nl> + for ( const auto item : std : : as_const ( i . value ( ) ) ) { <nl> + item - > setPendingInitDimensions ( ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + HistoryItemsList Session : : idsToItems ( <nl> + const MessageIdsList & ids ) const { <nl> + return ranges : : view : : all ( <nl> + ids <nl> + ) | ranges : : view : : transform ( [ ] ( const FullMsgId & fullId ) { <nl> + return App : : histItemById ( fullId ) ; <nl> + } ) | ranges : : view : : filter ( [ ] ( HistoryItem * item ) { <nl> + return item ! = nullptr ; <nl> + } ) | ranges : : view : : transform ( [ ] ( HistoryItem * item ) { <nl> + return not_null < HistoryItem * > ( item ) ; <nl> + } ) | ranges : : to_vector ; <nl> + } <nl> + <nl> + MessageIdsList Session : : itemsToIds ( <nl> + const HistoryItemsList & items ) const { <nl> + return ranges : : view : : all ( <nl> + items <nl> + ) | ranges : : view : : transform ( [ ] ( not_null < HistoryItem * > item ) { <nl> + return item - > fullId ( ) ; <nl> + } ) | ranges : : to_vector ; <nl> + } <nl> + <nl> + MessageIdsList Session : : groupToIds ( <nl> + not_null < HistoryMessageGroup * > group ) const { <nl> + auto result = itemsToIds ( group - > others ) ; <nl> + result . push_back ( group - > leader - > fullId ( ) ) ; <nl> + return result ; <nl> + } <nl> + <nl> + not_null < Data : : Feed * > Session : : feed ( FeedId id ) { <nl> + if ( const auto result = feedLoaded ( id ) ) { <nl> + return result ; <nl> + } <nl> + const auto [ it , ok ] = _feeds . emplace ( <nl> + id , <nl> + std : : make_unique < Data : : Feed > ( id ) ) ; <nl> + return it - > second . get ( ) ; <nl> + } <nl> + <nl> + Data : : Feed * Session : : feedLoaded ( FeedId id ) { <nl> + const auto it = _feeds . find ( id ) ; <nl> + return ( it = = _feeds . end ( ) ) ? nullptr : it - > second . get ( ) ; <nl> + } <nl> + <nl> + } / / namespace Data <nl> new file mode 100644 <nl> index 00000000000 . . 80ace497a89 <nl> mmm / dev / null <nl> ppp b / Telegram / SourceFiles / data / data_session . h <nl> <nl> + / * <nl> + This file is part of Telegram Desktop , <nl> + the official desktop application for the Telegram messaging service . <nl> + <nl> + For license and copyright information please follow this link : <nl> + https : / / github . com / telegramdesktop / tdesktop / blob / master / LEGAL <nl> + * / <nl> + # pragma once <nl> + <nl> + # include " chat_helpers / stickers . h " <nl> + <nl> + namespace Data { <nl> + <nl> + class Feed ; <nl> + <nl> + class Session final { <nl> + public : <nl> + Session ( ) ; <nl> + ~ Session ( ) ; <nl> + <nl> + base : : Variable < bool > & contactsLoaded ( ) { <nl> + return _contactsLoaded ; <nl> + } <nl> + base : : Variable < bool > & allChatsLoaded ( ) { <nl> + return _allChatsLoaded ; <nl> + } <nl> + base : : Observable < void > & moreChatsLoaded ( ) { <nl> + return _moreChatsLoaded ; <nl> + } <nl> + base : : Observable < void > & pendingHistoryResize ( ) { <nl> + return _pendingHistoryResize ; <nl> + } <nl> + struct ItemVisibilityQuery { <nl> + not_null < HistoryItem * > item ; <nl> + not_null < bool * > isVisible ; <nl> + } ; <nl> + base : : Observable < ItemVisibilityQuery > & queryItemVisibility ( ) { <nl> + return _queryItemVisibility ; <nl> + } <nl> + void markItemLayoutChanged ( not_null < const HistoryItem * > item ) ; <nl> + rpl : : producer < not_null < const HistoryItem * > > itemLayoutChanged ( ) const ; <nl> + void requestItemRepaint ( not_null < const HistoryItem * > item ) ; <nl> + rpl : : producer < not_null < const HistoryItem * > > itemRepaintRequest ( ) const ; <nl> + void markItemRemoved ( not_null < const HistoryItem * > item ) ; <nl> + rpl : : producer < not_null < const HistoryItem * > > itemRemoved ( ) const ; <nl> + void markHistoryUnloaded ( not_null < const History * > history ) ; <nl> + rpl : : producer < not_null < const History * > > historyUnloaded ( ) const ; <nl> + void markHistoryCleared ( not_null < const History * > history ) ; <nl> + rpl : : producer < not_null < const History * > > historyCleared ( ) const ; <nl> + using MegagroupParticipant = std : : tuple < <nl> + not_null < ChannelData * > , <nl> + not_null < UserData * > > ; <nl> + void removeMegagroupParticipant ( <nl> + not_null < ChannelData * > channel , <nl> + not_null < UserData * > user ) ; <nl> + rpl : : producer < MegagroupParticipant > megagroupParticipantRemoved ( ) const ; <nl> + rpl : : producer < not_null < UserData * > > megagroupParticipantRemoved ( <nl> + not_null < ChannelData * > channel ) const ; <nl> + void addNewMegagroupParticipant ( <nl> + not_null < ChannelData * > channel , <nl> + not_null < UserData * > user ) ; <nl> + rpl : : producer < MegagroupParticipant > megagroupParticipantAdded ( ) const ; <nl> + rpl : : producer < not_null < UserData * > > megagroupParticipantAdded ( <nl> + not_null < ChannelData * > channel ) const ; <nl> + <nl> + void markStickersUpdated ( ) ; <nl> + rpl : : producer < > stickersUpdated ( ) const ; <nl> + void markSavedGifsUpdated ( ) ; <nl> + rpl : : producer < > savedGifsUpdated ( ) const ; <nl> + <nl> + bool stickersUpdateNeeded ( TimeMs now ) const { <nl> + return stickersUpdateNeeded ( _lastStickersUpdate , now ) ; <nl> + } <nl> + void setLastStickersUpdate ( TimeMs update ) { <nl> + _lastStickersUpdate = update ; <nl> + } <nl> + bool recentStickersUpdateNeeded ( TimeMs now ) const { <nl> + return stickersUpdateNeeded ( _lastRecentStickersUpdate , now ) ; <nl> + } <nl> + void setLastRecentStickersUpdate ( TimeMs update ) { <nl> + _lastRecentStickersUpdate = update ; <nl> + } <nl> + bool favedStickersUpdateNeeded ( TimeMs now ) const { <nl> + return stickersUpdateNeeded ( _lastFavedStickersUpdate , now ) ; <nl> + } <nl> + void setLastFavedStickersUpdate ( TimeMs update ) { <nl> + _lastFavedStickersUpdate = update ; <nl> + } <nl> + bool featuredStickersUpdateNeeded ( TimeMs now ) const { <nl> + return stickersUpdateNeeded ( _lastFeaturedStickersUpdate , now ) ; <nl> + } <nl> + void setLastFeaturedStickersUpdate ( TimeMs update ) { <nl> + _lastFeaturedStickersUpdate = update ; <nl> + } <nl> + bool savedGifsUpdateNeeded ( TimeMs now ) const { <nl> + return stickersUpdateNeeded ( _lastSavedGifsUpdate , now ) ; <nl> + } <nl> + void setLastSavedGifsUpdate ( TimeMs update ) { <nl> + _lastSavedGifsUpdate = update ; <nl> + } <nl> + int featuredStickerSetsUnreadCount ( ) const { <nl> + return _featuredStickerSetsUnreadCount . current ( ) ; <nl> + } <nl> + void setFeaturedStickerSetsUnreadCount ( int count ) { <nl> + _featuredStickerSetsUnreadCount = count ; <nl> + } <nl> + rpl : : producer < int > featuredStickerSetsUnreadCountValue ( ) const { <nl> + return _featuredStickerSetsUnreadCount . value ( ) ; <nl> + } <nl> + const Stickers : : Sets & stickerSets ( ) const { <nl> + return _stickerSets ; <nl> + } <nl> + Stickers : : Sets & stickerSetsRef ( ) { <nl> + return _stickerSets ; <nl> + } <nl> + const Stickers : : Order & stickerSetsOrder ( ) const { <nl> + return _stickerSetsOrder ; <nl> + } <nl> + Stickers : : Order & stickerSetsOrderRef ( ) { <nl> + return _stickerSetsOrder ; <nl> + } <nl> + const Stickers : : Order & featuredStickerSetsOrder ( ) const { <nl> + return _featuredStickerSetsOrder ; <nl> + } <nl> + Stickers : : Order & featuredStickerSetsOrderRef ( ) { <nl> + return _featuredStickerSetsOrder ; <nl> + } <nl> + const Stickers : : Order & archivedStickerSetsOrder ( ) const { <nl> + return _archivedStickerSetsOrder ; <nl> + } <nl> + Stickers : : Order & archivedStickerSetsOrderRef ( ) { <nl> + return _archivedStickerSetsOrder ; <nl> + } <nl> + const Stickers : : SavedGifs & savedGifs ( ) const { <nl> + return _savedGifs ; <nl> + } <nl> + Stickers : : SavedGifs & savedGifsRef ( ) { <nl> + return _savedGifs ; <nl> + } <nl> + <nl> + HistoryItemsList idsToItems ( const MessageIdsList & ids ) const ; <nl> + MessageIdsList itemsToIds ( const HistoryItemsList & items ) const ; <nl> + MessageIdsList groupToIds ( not_null < HistoryMessageGroup * > group ) const ; <nl> + <nl> + not_null < Data : : Feed * > feed ( FeedId id ) ; <nl> + Data : : Feed * feedLoaded ( FeedId id ) ; <nl> + <nl> + private : <nl> + bool stickersUpdateNeeded ( TimeMs lastUpdate , TimeMs now ) const { <nl> + constexpr auto kStickersUpdateTimeout = TimeMs ( 3600 ' 000 ) ; <nl> + return ( lastUpdate = = 0 ) <nl> + | | ( now > = lastUpdate + kStickersUpdateTimeout ) ; <nl> + } <nl> + void userIsContactUpdated ( not_null < UserData * > user ) ; <nl> + <nl> + base : : Variable < bool > _contactsLoaded = { false } ; <nl> + base : : Variable < bool > _allChatsLoaded = { false } ; <nl> + base : : Observable < void > _moreChatsLoaded ; <nl> + base : : Observable < void > _pendingHistoryResize ; <nl> + base : : Observable < ItemVisibilityQuery > _queryItemVisibility ; <nl> + rpl : : event_stream < not_null < const HistoryItem * > > _itemLayoutChanged ; <nl> + rpl : : event_stream < not_null < const HistoryItem * > > _itemRepaintRequest ; <nl> + rpl : : event_stream < not_null < const HistoryItem * > > _itemRemoved ; <nl> + rpl : : event_stream < not_null < const History * > > _historyUnloaded ; <nl> + rpl : : event_stream < not_null < const History * > > _historyCleared ; <nl> + rpl : : event_stream < MegagroupParticipant > _megagroupParticipantRemoved ; <nl> + rpl : : event_stream < MegagroupParticipant > _megagroupParticipantAdded ; <nl> + <nl> + rpl : : event_stream < > _stickersUpdated ; <nl> + rpl : : event_stream < > _savedGifsUpdated ; <nl> + TimeMs _lastStickersUpdate = 0 ; <nl> + TimeMs _lastRecentStickersUpdate = 0 ; <nl> + TimeMs _lastFavedStickersUpdate = 0 ; <nl> + TimeMs _lastFeaturedStickersUpdate = 0 ; <nl> + TimeMs _lastSavedGifsUpdate = 0 ; <nl> + rpl : : variable < int > _featuredStickerSetsUnreadCount = 0 ; <nl> + Stickers : : Sets _stickerSets ; <nl> + Stickers : : Order _stickerSetsOrder ; <nl> + Stickers : : Order _featuredStickerSetsOrder ; <nl> + Stickers : : Order _archivedStickerSetsOrder ; <nl> + Stickers : : SavedGifs _savedGifs ; <nl> + <nl> + base : : flat_map < FeedId , std : : unique_ptr < Data : : Feed > > _feeds ; <nl> + <nl> + rpl : : lifetime _lifetime ; <nl> + <nl> + } ; <nl> + <nl> + } / / namespace Data <nl> mmm a / Telegram / SourceFiles / dialogs / dialogs_inner_widget . cpp <nl> ppp b / Telegram / SourceFiles / dialogs / dialogs_inner_widget . cpp <nl> For license and copyright information please follow this link : <nl> # include " ui / text_options . h " <nl> # include " data / data_drafts . h " <nl> # include " data / data_feed . h " <nl> + # include " data / data_session . h " <nl> # include " lang / lang_keys . h " <nl> # include " mainwindow . h " <nl> # include " mainwidget . h " <nl> mmm a / Telegram / SourceFiles / dialogs / dialogs_widget . cpp <nl> ppp b / Telegram / SourceFiles / dialogs / dialogs_widget . cpp <nl> For license and copyright information please follow this link : <nl> # include " window / window_slide_animation . h " <nl> # include " profile / profile_channel_controllers . h " <nl> # include " storage / storage_media_prepare . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace { <nl> <nl> mmm a / Telegram / SourceFiles / facades . cpp <nl> ppp b / Telegram / SourceFiles / facades . cpp <nl> For license and copyright information please follow this link : <nl> # include " base / observer . h " <nl> # include " history / history_media . h " <nl> # include " styles / style_history . h " <nl> + # include " data / data_session . h " <nl> <nl> Q_DECLARE_METATYPE ( ClickHandlerPtr ) ; <nl> Q_DECLARE_METATYPE ( Qt : : MouseButton ) ; <nl> mmm a / Telegram / SourceFiles / history / history . cpp <nl> ppp b / Telegram / SourceFiles / history / history . cpp <nl> For license and copyright information please follow this link : <nl> # include " dialogs / dialogs_indexed_list . h " <nl> # include " styles / style_dialogs . h " <nl> # include " data / data_drafts . h " <nl> + # include " data / data_session . h " <nl> # include " lang / lang_keys . h " <nl> # include " apiwrap . h " <nl> # include " mainwidget . h " <nl> mmm a / Telegram / SourceFiles / history / history_admin_log_inner . cpp <nl> ppp b / Telegram / SourceFiles / history / history_admin_log_inner . cpp <nl> For license and copyright information please follow this link : <nl> # include " base / overload . h " <nl> # include " lang / lang_keys . h " <nl> # include " boxes / edit_participant_box . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace AdminLog { <nl> namespace { <nl> InnerWidget : : InnerWidget ( <nl> } <nl> } , lifetime ( ) ) ; <nl> subscribe ( Auth ( ) . data ( ) . pendingHistoryResize ( ) , [ this ] { handlePendingHistoryResize ( ) ; } ) ; <nl> - subscribe ( Auth ( ) . data ( ) . queryItemVisibility ( ) , [ this ] ( const AuthSessionData : : ItemVisibilityQuery & query ) { <nl> + subscribe ( Auth ( ) . data ( ) . queryItemVisibility ( ) , [ this ] ( const Data : : Session : : ItemVisibilityQuery & query ) { <nl> if ( _history ! = query . item - > history ( ) | | ! query . item - > isLogEntry ( ) | | ! isVisible ( ) ) { <nl> return ; <nl> } <nl> mmm a / Telegram / SourceFiles / history / history_inner_widget . cpp <nl> ppp b / Telegram / SourceFiles / history / history_inner_widget . cpp <nl> For license and copyright information please follow this link : <nl> # include " messenger . h " <nl> # include " apiwrap . h " <nl> # include " lang / lang_keys . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace { <nl> <nl> mmm a / Telegram / SourceFiles / history / history_item . cpp <nl> ppp b / Telegram / SourceFiles / history / history_item . cpp <nl> For license and copyright information please follow this link : <nl> # include " mainwindow . h " <nl> # include " window / window_controller . h " <nl> # include " core / crash_reports . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace { <nl> <nl> mmm a / Telegram / SourceFiles / history / history_media_types . cpp <nl> ppp b / Telegram / SourceFiles / history / history_media_types . cpp <nl> For license and copyright information please follow this link : <nl> # include " ui / empty_userpic . h " <nl> # include " ui / grouped_layout . h " <nl> # include " ui / text_options . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace { <nl> <nl> mmm a / Telegram / SourceFiles / history / history_message . cpp <nl> ppp b / Telegram / SourceFiles / history / history_message . cpp <nl> For license and copyright information please follow this link : <nl> # include " window / window_controller . h " <nl> # include " observer_peer . h " <nl> # include " storage / storage_shared_media . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace { <nl> <nl> mmm a / Telegram / SourceFiles / history / history_top_bar_widget . cpp <nl> ppp b / Telegram / SourceFiles / history / history_top_bar_widget . cpp <nl> HistoryTopBarWidget : : HistoryTopBarWidget ( <nl> } ) ; <nl> <nl> rpl : : combine ( <nl> - Auth ( ) . data ( ) . thirdSectionInfoEnabledValue ( ) , <nl> - Auth ( ) . data ( ) . tabbedReplacedWithInfoValue ( ) <nl> + Auth ( ) . settings ( ) . thirdSectionInfoEnabledValue ( ) , <nl> + Auth ( ) . settings ( ) . tabbedReplacedWithInfoValue ( ) <nl> ) | rpl : : start_with_next ( <nl> [ this ] { updateInfoToggleActive ( ) ; } , <nl> lifetime ( ) ) ; <nl> void HistoryTopBarWidget : : showMenu ( ) { <nl> <nl> void HistoryTopBarWidget : : toggleInfoSection ( ) { <nl> if ( Adaptive : : ThreeColumn ( ) <nl> - & & ( Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) <nl> - | | Auth ( ) . data ( ) . tabbedReplacedWithInfo ( ) ) ) { <nl> + & & ( Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) <nl> + | | Auth ( ) . settings ( ) . tabbedReplacedWithInfo ( ) ) ) { <nl> _controller - > closeThirdSection ( ) ; <nl> } else if ( _historyPeer ) { <nl> if ( _controller - > canShowThirdSection ( ) ) { <nl> - Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> if ( Adaptive : : ThreeColumn ( ) ) { <nl> _controller - > showSection ( <nl> Info : : Memento : : Default ( _historyPeer ) , <nl> void HistoryTopBarWidget : : updateUnreadBadge ( ) { <nl> <nl> void HistoryTopBarWidget : : updateInfoToggleActive ( ) { <nl> auto infoThirdActive = Adaptive : : ThreeColumn ( ) <nl> - & & ( Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) <nl> - | | Auth ( ) . data ( ) . tabbedReplacedWithInfo ( ) ) ; <nl> + & & ( Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) <nl> + | | Auth ( ) . settings ( ) . tabbedReplacedWithInfo ( ) ) ; <nl> auto iconOverride = infoThirdActive <nl> ? & st : : topBarInfoActive <nl> : nullptr ; <nl> mmm a / Telegram / SourceFiles / history / history_widget . cpp <nl> ppp b / Telegram / SourceFiles / history / history_widget . cpp <nl> For license and copyright information please follow this link : <nl> # include " ui / effects / ripple_animation . h " <nl> # include " inline_bots / inline_bot_result . h " <nl> # include " data / data_drafts . h " <nl> + # include " data / data_session . h " <nl> # include " history / history_message . h " <nl> # include " history / history_service_layout . h " <nl> # include " history / history_media_types . h " <nl> HistoryWidget : : HistoryWidget ( QWidget * parent , not_null < Window : : Controller * > cont <nl> } <nl> } ) ) ; <nl> subscribe ( Auth ( ) . data ( ) . pendingHistoryResize ( ) , [ this ] { handlePendingHistoryUpdate ( ) ; } ) ; <nl> - subscribe ( Auth ( ) . data ( ) . queryItemVisibility ( ) , [ this ] ( const AuthSessionData : : ItemVisibilityQuery & query ) { <nl> + subscribe ( Auth ( ) . data ( ) . queryItemVisibility ( ) , [ this ] ( const Data : : Session : : ItemVisibilityQuery & query ) { <nl> if ( _a_show . animating ( ) | | _history ! = query . item - > history ( ) | | query . item - > detached ( ) | | ! isVisible ( ) ) { <nl> return ; <nl> } <nl> void HistoryWidget : : pushTabbedSelectorToThirdSection ( <nl> if ( ! _history | | ! _tabbedPanel ) { <nl> return ; <nl> } else if ( ! _canSendMessages ) { <nl> - Auth ( ) . data ( ) . setTabbedReplacedWithInfo ( true ) ; <nl> + Auth ( ) . settings ( ) . setTabbedReplacedWithInfo ( true ) ; <nl> controller ( ) - > showPeerInfo ( _peer , params . withThirdColumn ( ) ) ; <nl> return ; <nl> } <nl> - Auth ( ) . data ( ) . setTabbedReplacedWithInfo ( false ) ; <nl> + Auth ( ) . settings ( ) . setTabbedReplacedWithInfo ( false ) ; <nl> _tabbedSelectorToggle - > setColorOverrides ( <nl> & st : : historyAttachEmojiActive , <nl> & st : : historyRecordVoiceFgActive , <nl> void HistoryWidget : : toggleTabbedSelectorMode ( ) { <nl> if ( _tabbedPanel ) { <nl> if ( controller ( ) - > canShowThirdSection ( ) <nl> & & ! Adaptive : : OneColumn ( ) ) { <nl> - Auth ( ) . data ( ) . setTabbedSelectorSectionEnabled ( true ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + Auth ( ) . settings ( ) . setTabbedSelectorSectionEnabled ( true ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> pushTabbedSelectorToThirdSection ( <nl> Window : : SectionShow : : Way : : ClearStack ) ; <nl> } else { <nl> mmm a / Telegram / SourceFiles / info / info_layer_widget . cpp <nl> ppp b / Telegram / SourceFiles / info / info_layer_widget . cpp <nl> bool LayerWidget : : takeToThirdSection ( ) { <nl> / / / / shrink the window size . <nl> / / / / <nl> / / / / See https : / / github . com / telegramdesktop / tdesktop / issues / 4091 <nl> - / / Auth ( ) . data ( ) . setThirdSectionExtendedBy ( 0 ) ; <nl> + / / Auth ( ) . settings ( ) . setThirdSectionExtendedBy ( 0 ) ; <nl> <nl> - / / Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> - / / Auth ( ) . saveDataDelayed ( ) ; <nl> + / / Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> + / / Auth ( ) . saveSettingsDelayed ( ) ; <nl> / / localCopy - > showSection ( <nl> / / std : : move ( memento ) , <nl> / / Window : : SectionShow ( <nl> mmm a / Telegram / SourceFiles / info / media / info_media_list_widget . cpp <nl> ppp b / Telegram / SourceFiles / info / media / info_media_list_widget . cpp <nl> For license and copyright information please follow this link : <nl> # include " boxes / peer_list_controllers . h " <nl> # include " boxes / confirm_box . h " <nl> # include " core / file_utilities . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace Layout = Overview : : Layout ; <nl> <nl> mmm a / Telegram / SourceFiles / inline_bots / inline_bot_layout_internal . cpp <nl> ppp b / Telegram / SourceFiles / inline_bots / inline_bot_layout_internal . cpp <nl> For license and copyright information please follow this link : <nl> <nl> # include " data / data_photo . h " <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " styles / style_overview . h " <nl> # include " styles / style_history . h " <nl> # include " styles / style_chat_helpers . h " <nl> mmm a / Telegram / SourceFiles / mainwidget . cpp <nl> ppp b / Telegram / SourceFiles / mainwidget . cpp <nl> For license and copyright information please follow this link : <nl> # include " window / section_memento . h " <nl> # include " window / section_widget . h " <nl> # include " data / data_drafts . h " <nl> + # include " data / data_session . h " <nl> # include " ui / widgets / dropdown_menu . h " <nl> # include " ui / focus_persister . h " <nl> # include " ui / resize_area . h " <nl> MainWidget : : MainWidget ( <nl> updateDialogsWidthAnimated ( ) ; <nl> } ) ; <nl> rpl : : merge ( <nl> - Auth ( ) . data ( ) . dialogsWidthRatioChanges ( ) <nl> + Auth ( ) . settings ( ) . dialogsWidthRatioChanges ( ) <nl> | rpl : : map ( [ ] { return rpl : : empty_value ( ) ; } ) , <nl> - Auth ( ) . data ( ) . thirdColumnWidthChanges ( ) <nl> + Auth ( ) . settings ( ) . thirdColumnWidthChanges ( ) <nl> | rpl : : map ( [ ] { return rpl : : empty_value ( ) ; } ) <nl> ) | rpl : : start_with_next ( <nl> [ this ] { updateControlsGeometry ( ) ; } , <nl> void MainWidget : : checkCurrentFloatPlayer ( ) { <nl> } , [ this ] ( not_null < Float * > instance , bool closed ) { <nl> finishFloatPlayerDrag ( instance , closed ) ; <nl> } ) ) ; <nl> - currentFloatPlayer ( ) - > column = Auth ( ) . data ( ) . floatPlayerColumn ( ) ; <nl> - currentFloatPlayer ( ) - > corner = Auth ( ) . data ( ) . floatPlayerCorner ( ) ; <nl> + currentFloatPlayer ( ) - > column = Auth ( ) . settings ( ) . floatPlayerColumn ( ) ; <nl> + currentFloatPlayer ( ) - > corner = Auth ( ) . settings ( ) . floatPlayerCorner ( ) ; <nl> checkFloatPlayerVisibility ( ) ; <nl> } <nl> } <nl> void MainWidget : : updateFloatPlayerColumnCorner ( QPoint center ) { <nl> Expects ( ! _playerFloats . empty ( ) ) ; <nl> auto size = _playerFloats . back ( ) - > widget - > size ( ) ; <nl> auto min = INT_MAX ; <nl> - auto column = Auth ( ) . data ( ) . floatPlayerColumn ( ) ; <nl> - auto corner = Auth ( ) . data ( ) . floatPlayerCorner ( ) ; <nl> + auto column = Auth ( ) . settings ( ) . floatPlayerColumn ( ) ; <nl> + auto corner = Auth ( ) . settings ( ) . floatPlayerCorner ( ) ; <nl> auto checkSection = [ this , center , size , & min , & column , & corner ] ( <nl> Window : : AbstractSectionWidget * widget , <nl> Window : : Column widgetColumn ) { <nl> void MainWidget : : updateFloatPlayerColumnCorner ( QPoint center ) { <nl> checkSection ( _dialogs , Window : : Column : : First ) ; <nl> } <nl> } <nl> - if ( Auth ( ) . data ( ) . floatPlayerColumn ( ) ! = column ) { <nl> - Auth ( ) . data ( ) . setFloatPlayerColumn ( column ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + if ( Auth ( ) . settings ( ) . floatPlayerColumn ( ) ! = column ) { <nl> + Auth ( ) . settings ( ) . setFloatPlayerColumn ( column ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> } <nl> - if ( Auth ( ) . data ( ) . floatPlayerCorner ( ) ! = corner ) { <nl> - Auth ( ) . data ( ) . setFloatPlayerCorner ( corner ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + if ( Auth ( ) . settings ( ) . floatPlayerCorner ( ) ! = corner ) { <nl> + Auth ( ) . settings ( ) . setFloatPlayerCorner ( corner ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> } <nl> } <nl> <nl> void MainWidget : : finishFloatPlayerDrag ( not_null < Float * > instance , bool closed ) { <nl> instance - > animationSide = getFloatPlayerSide ( center ) ; <nl> } <nl> updateFloatPlayerColumnCorner ( center ) ; <nl> - instance - > column = Auth ( ) . data ( ) . floatPlayerColumn ( ) ; <nl> - instance - > corner = Auth ( ) . data ( ) . floatPlayerCorner ( ) ; <nl> + instance - > column = Auth ( ) . settings ( ) . floatPlayerColumn ( ) ; <nl> + instance - > corner = Auth ( ) . settings ( ) . floatPlayerCorner ( ) ; <nl> <nl> instance - > draggedAnimation . finish ( ) ; <nl> instance - > draggedAnimation . start ( [ this , instance ] { updateFloatPlayerPosition ( instance ) ; } , 0 . , 1 . , st : : slideDuration , anim : : sineInOut ) ; <nl> void MainWidget : : resizeEvent ( QResizeEvent * e ) { <nl> <nl> void MainWidget : : updateControlsGeometry ( ) { <nl> updateWindowAdaptiveLayout ( ) ; <nl> - if ( Auth ( ) . data ( ) . dialogsWidthRatio ( ) > 0 ) { <nl> + if ( Auth ( ) . settings ( ) . dialogsWidthRatio ( ) > 0 ) { <nl> _a_dialogsWidth . finish ( ) ; <nl> } <nl> if ( ! _a_dialogsWidth . animating ( ) ) { <nl> void MainWidget : : updateControlsGeometry ( ) { <nl> Window : : SectionShow : : Way : : ClearStack , <nl> anim : : type : : instant , <nl> anim : : activation : : background ) ; <nl> - if ( Auth ( ) . data ( ) . tabbedSelectorSectionEnabled ( ) ) { <nl> + if ( Auth ( ) . settings ( ) . tabbedSelectorSectionEnabled ( ) ) { <nl> _history - > pushTabbedSelectorToThirdSection ( params ) ; <nl> - } else if ( Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) ) { <nl> + } else if ( Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) ) { <nl> _history - > pushInfoToThirdSection ( params ) ; <nl> } <nl> } <nl> void MainWidget : : ensureFirstColumnResizeAreaCreated ( ) { <nl> auto newRatio = ( newWidth < st : : columnMinimalWidthLeft / 2 ) <nl> ? 0 . <nl> : float64 ( newWidth ) / width ( ) ; <nl> - Auth ( ) . data ( ) . setDialogsWidthRatio ( newRatio ) ; <nl> + Auth ( ) . settings ( ) . setDialogsWidthRatio ( newRatio ) ; <nl> } ; <nl> auto moveFinishedCallback = [ = ] { <nl> if ( Adaptive : : OneColumn ( ) ) { <nl> return ; <nl> } <nl> - if ( Auth ( ) . data ( ) . dialogsWidthRatio ( ) > 0 ) { <nl> - Auth ( ) . data ( ) . setDialogsWidthRatio ( <nl> + if ( Auth ( ) . settings ( ) . dialogsWidthRatio ( ) > 0 ) { <nl> + Auth ( ) . settings ( ) . setDialogsWidthRatio ( <nl> float64 ( _dialogsWidth ) / width ( ) ) ; <nl> } <nl> Local : : writeUserSettings ( ) ; <nl> void MainWidget : : ensureThirdColumnResizeAreaCreated ( ) { <nl> } <nl> auto moveLeftCallback = [ = ] ( int globalLeft ) { <nl> auto newWidth = mapToGlobal ( QPoint ( width ( ) , 0 ) ) . x ( ) - globalLeft ; <nl> - Auth ( ) . data ( ) . setThirdColumnWidth ( newWidth ) ; <nl> + Auth ( ) . settings ( ) . setThirdColumnWidth ( newWidth ) ; <nl> } ; <nl> auto moveFinishedCallback = [ = ] { <nl> if ( ! Adaptive : : ThreeColumn ( ) | | ! _thirdSection ) { <nl> return ; <nl> } <nl> - Auth ( ) . data ( ) . setThirdColumnWidth ( snap ( <nl> - Auth ( ) . data ( ) . thirdColumnWidth ( ) , <nl> + Auth ( ) . settings ( ) . setThirdColumnWidth ( snap ( <nl> + Auth ( ) . settings ( ) . thirdColumnWidth ( ) , <nl> st : : columnMinimalWidthThird , <nl> st : : columnMaximalWidthThird ) ) ; <nl> Local : : writeUserSettings ( ) ; <nl> void MainWidget : : ensureThirdColumnResizeAreaCreated ( ) { <nl> } <nl> <nl> void MainWidget : : updateDialogsWidthAnimated ( ) { <nl> - if ( Auth ( ) . data ( ) . dialogsWidthRatio ( ) > 0 ) { <nl> + if ( Auth ( ) . settings ( ) . dialogsWidthRatio ( ) > 0 ) { <nl> return ; <nl> } <nl> auto dialogsWidth = _dialogsWidth ; <nl> updateWindowAdaptiveLayout ( ) ; <nl> - if ( ! Auth ( ) . data ( ) . dialogsWidthRatio ( ) <nl> + if ( ! Auth ( ) . settings ( ) . dialogsWidthRatio ( ) <nl> & & ( _dialogsWidth ! = dialogsWidth <nl> | | _a_dialogsWidth . animating ( ) ) ) { <nl> _dialogs - > startWidthAnimation ( ) ; <nl> void MainWidget : : updateThirdColumnToCurrentPeer ( <nl> / / Like in _controller - > showPeerInfo ( ) <nl> / / <nl> if ( Adaptive : : ThreeColumn ( ) <nl> - & & ! Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) ) { <nl> - Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + & & ! Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) ) { <nl> + Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> } <nl> <nl> _controller - > showSection ( <nl> void MainWidget : : updateThirdColumnToCurrentPeer ( <nl> _history - > pushTabbedSelectorToThirdSection ( params ) ; <nl> } ; <nl> if ( Adaptive : : ThreeColumn ( ) <nl> - & & Auth ( ) . data ( ) . tabbedSelectorSectionEnabled ( ) <nl> + & & Auth ( ) . settings ( ) . tabbedSelectorSectionEnabled ( ) <nl> & & peer ) { <nl> if ( ! canWrite ) { <nl> switchInfoFast ( ) ; <nl> - Auth ( ) . data ( ) . setTabbedSelectorSectionEnabled ( true ) ; <nl> - Auth ( ) . data ( ) . setTabbedReplacedWithInfo ( true ) ; <nl> - } else if ( Auth ( ) . data ( ) . tabbedReplacedWithInfo ( ) ) { <nl> - Auth ( ) . data ( ) . setTabbedReplacedWithInfo ( false ) ; <nl> + Auth ( ) . settings ( ) . setTabbedSelectorSectionEnabled ( true ) ; <nl> + Auth ( ) . settings ( ) . setTabbedReplacedWithInfo ( true ) ; <nl> + } else if ( Auth ( ) . settings ( ) . tabbedReplacedWithInfo ( ) ) { <nl> + Auth ( ) . settings ( ) . setTabbedReplacedWithInfo ( false ) ; <nl> switchTabbedFast ( ) ; <nl> } <nl> } else { <nl> - Auth ( ) . data ( ) . setTabbedReplacedWithInfo ( false ) ; <nl> + Auth ( ) . settings ( ) . setTabbedReplacedWithInfo ( false ) ; <nl> if ( ! peer ) { <nl> if ( _thirdSection ) { <nl> _thirdSection . destroy ( ) ; <nl> void MainWidget : : updateThirdColumnToCurrentPeer ( <nl> updateControlsGeometry ( ) ; <nl> } <nl> } else if ( Adaptive : : ThreeColumn ( ) <nl> - & & Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) ) { <nl> + & & Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) ) { <nl> switchInfoFast ( ) ; <nl> } <nl> } <nl> void MainWidget : : handleAdaptiveLayoutUpdate ( ) { <nl> <nl> void MainWidget : : updateWindowAdaptiveLayout ( ) { <nl> auto layout = _controller - > computeColumnLayout ( ) ; <nl> - auto dialogsWidthRatio = Auth ( ) . data ( ) . dialogsWidthRatio ( ) ; <nl> + auto dialogsWidthRatio = Auth ( ) . settings ( ) . dialogsWidthRatio ( ) ; <nl> <nl> / / Check if we are in a single - column layout in a wide enough window <nl> / / for the normal layout . If so , switch to the normal layout . <nl> if ( layout . windowLayout = = Adaptive : : WindowLayout : : OneColumn ) { <nl> auto chatWidth = layout . chatWidth ; <nl> - / / if ( Auth ( ) . data ( ) . tabbedSelectorSectionEnabled ( ) <nl> + / / if ( Auth ( ) . settings ( ) . tabbedSelectorSectionEnabled ( ) <nl> / / & & chatWidth > = _history - > minimalWidthForTabbedSelectorSection ( ) ) { <nl> / / chatWidth - = _history - > tabbedSelectorSectionWidth ( ) ; <nl> / / } <nl> void MainWidget : : updateWindowAdaptiveLayout ( ) { <nl> / / } <nl> } <nl> <nl> - Auth ( ) . data ( ) . setDialogsWidthRatio ( dialogsWidthRatio ) ; <nl> + Auth ( ) . settings ( ) . setDialogsWidthRatio ( dialogsWidthRatio ) ; <nl> <nl> auto useSmallColumnWidth = ! Adaptive : : OneColumn ( ) <nl> & & ! dialogsWidthRatio <nl> mmm a / Telegram / SourceFiles / media / player / media_player_float . cpp <nl> ppp b / Telegram / SourceFiles / media / player / media_player_float . cpp <nl> For license and copyright information please follow this link : <nl> <nl> # include < rpl / merge . h > <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " history / history_media . h " <nl> # include " media / media_clip_reader . h " <nl> # include " media / view / media_clip_playback . h " <nl> mmm a / Telegram / SourceFiles / mediaview . cpp <nl> ppp b / Telegram / SourceFiles / mediaview . cpp <nl> void MediaView : : onVideoPlayProgress ( const AudioMsgId & audioId ) { <nl> if ( state . length ) { <nl> updateVideoPlaybackState ( state ) ; <nl> } <nl> - Auth ( ) . data ( ) . setLastTimeVideoPlayedAt ( getms ( true ) ) ; <nl> + Auth ( ) . settings ( ) . setLastTimeVideoPlayedAt ( getms ( true ) ) ; <nl> } <nl> } <nl> <nl> mmm a / Telegram / SourceFiles / messenger . cpp <nl> ppp b / Telegram / SourceFiles / messenger . cpp <nl> Messenger * Messenger : : InstancePointer ( ) { <nl> <nl> struct Messenger : : Private { <nl> UserId authSessionUserId = 0 ; <nl> - std : : unique_ptr < AuthSessionData > storedAuthSession ; <nl> + std : : unique_ptr < AuthSessionSettings > storedAuthSession ; <nl> MTP : : Instance : : Config mtpConfig ; <nl> MTP : : AuthKeysList mtpKeysToDestroy ; <nl> base : : Timer quitTimer ; <nl> void Messenger : : setAuthSessionUserId ( UserId userId ) { <nl> _private - > authSessionUserId = userId ; <nl> } <nl> <nl> - void Messenger : : setAuthSessionFromStorage ( std : : unique_ptr < AuthSessionData > data ) { <nl> + void Messenger : : setAuthSessionFromStorage ( std : : unique_ptr < AuthSessionSettings > data ) { <nl> Expects ( ! authSession ( ) ) ; <nl> _private - > storedAuthSession = std : : move ( data ) ; <nl> } <nl> <nl> - AuthSessionData * Messenger : : getAuthSessionData ( ) { <nl> + AuthSessionSettings * Messenger : : getAuthSessionSettings ( ) { <nl> if ( _private - > authSessionUserId ) { <nl> - return _private - > storedAuthSession ? _private - > storedAuthSession . get ( ) : nullptr ; <nl> + return _private - > storedAuthSession <nl> + ? _private - > storedAuthSession . get ( ) <nl> + : nullptr ; <nl> } else if ( _authSession ) { <nl> - return & _authSession - > data ( ) ; <nl> + return & _authSession - > settings ( ) ; <nl> } <nl> return nullptr ; <nl> } <nl> void Messenger : : startMtp ( ) { <nl> } <nl> if ( _private - > storedAuthSession ) { <nl> if ( _authSession ) { <nl> - _authSession - > data ( ) . moveFrom ( <nl> + _authSession - > settings ( ) . moveFrom ( <nl> std : : move ( * _private - > storedAuthSession ) ) ; <nl> } <nl> _private - > storedAuthSession . reset ( ) ; <nl> mmm a / Telegram / SourceFiles / messenger . h <nl> ppp b / Telegram / SourceFiles / messenger . h <nl> For license and copyright information please follow this link : <nl> # include " base / timer . h " <nl> <nl> class AuthSession ; <nl> - class AuthSessionData ; <nl> + class AuthSessionSettings ; <nl> class MainWidget ; <nl> class FileUploader ; <nl> class Translator ; <nl> class Messenger final : public QObject , public RPCSender , private base : : Subscrib <nl> void setMtpMainDcId ( MTP : : DcId mainDcId ) ; <nl> void setMtpKey ( MTP : : DcId dcId , const MTP : : AuthKey : : Data & keyData ) ; <nl> void setAuthSessionUserId ( UserId userId ) ; <nl> - void setAuthSessionFromStorage ( std : : unique_ptr < AuthSessionData > data ) ; <nl> - AuthSessionData * getAuthSessionData ( ) ; <nl> + void setAuthSessionFromStorage ( <nl> + std : : unique_ptr < AuthSessionSettings > data ) ; <nl> + AuthSessionSettings * getAuthSessionSettings ( ) ; <nl> <nl> / / Serialization . <nl> QByteArray serializeMtpAuthorization ( ) const ; <nl> mmm a / Telegram / SourceFiles / overview / overview_layout . cpp <nl> ppp b / Telegram / SourceFiles / overview / overview_layout . cpp <nl> For license and copyright information please follow this link : <nl> # include " overview / overview_layout . h " <nl> <nl> # include " data / data_document . h " <nl> + # include " data / data_session . h " <nl> # include " styles / style_overview . h " <nl> # include " styles / style_history . h " <nl> # include " core / file_utilities . h " <nl> mmm a / Telegram / SourceFiles / profile / profile_channel_controllers . cpp <nl> ppp b / Telegram / SourceFiles / profile / profile_channel_controllers . cpp <nl> For license and copyright information please follow this link : <nl> # include " observer_peer . h " <nl> # include " dialogs / dialogs_indexed_list . h " <nl> # include " data / data_peer_values . h " <nl> + # include " data / data_session . h " <nl> # include " ui / widgets / popup_menu . h " <nl> # include " window / window_controller . h " <nl> <nl> mmm a / Telegram / SourceFiles / settings / settings_privacy_controllers . cpp <nl> ppp b / Telegram / SourceFiles / settings / settings_privacy_controllers . cpp <nl> QString LastSeenPrivacyController : : exceptionsDescription ( ) { <nl> } <nl> <nl> void LastSeenPrivacyController : : confirmSave ( bool someAreDisallowed , base : : lambda_once < void ( ) > saveCallback ) { <nl> - if ( someAreDisallowed & & ! Auth ( ) . data ( ) . lastSeenWarningSeen ( ) ) { <nl> + if ( someAreDisallowed & & ! Auth ( ) . settings ( ) . lastSeenWarningSeen ( ) ) { <nl> auto weakBox = std : : make_shared < QPointer < ConfirmBox > > ( ) ; <nl> auto callback = [ weakBox , saveCallback = std : : move ( saveCallback ) ] ( ) mutable { <nl> if ( auto box = * weakBox ) { <nl> box - > closeBox ( ) ; <nl> } <nl> saveCallback ( ) ; <nl> - Auth ( ) . data ( ) . setLastSeenWarningSeen ( true ) ; <nl> + Auth ( ) . settings ( ) . setLastSeenWarningSeen ( true ) ; <nl> Local : : writeUserSettings ( ) ; <nl> } ; <nl> auto box = Box < ConfirmBox > ( lang ( lng_edit_privacy_lastseen_warning ) , lang ( lng_continue ) , lang ( lng_cancel ) , std : : move ( callback ) ) ; <nl> mmm a / Telegram / SourceFiles / settings / settings_widget . cpp <nl> ppp b / Telegram / SourceFiles / settings / settings_widget . cpp <nl> void fillCodes ( ) { <nl> if ( track - > failed ( ) ) { <nl> Ui : : show ( Box < InformBox > ( " Could not audio : ( Errors in ' log . txt ' . " ) ) ; <nl> } else { <nl> - Auth ( ) . data ( ) . setSoundOverride ( key , result . paths . front ( ) ) ; <nl> + Auth ( ) . settings ( ) . setSoundOverride ( key , result . paths . front ( ) ) ; <nl> Local : : writeUserSettings ( ) ; <nl> } <nl> } <nl> void fillCodes ( ) { <nl> } <nl> Codes . insert ( qsl ( " sounds_reset " ) , [ ] { <nl> if ( AuthSession : : Exists ( ) ) { <nl> - Auth ( ) . data ( ) . clearSoundOverrides ( ) ; <nl> + Auth ( ) . settings ( ) . clearSoundOverrides ( ) ; <nl> Local : : writeUserSettings ( ) ; <nl> Ui : : show ( Box < InformBox > ( " All sound overrides were reset . " ) ) ; <nl> } <nl> mmm a / Telegram / SourceFiles / storage / localstorage . cpp <nl> ppp b / Telegram / SourceFiles / storage / localstorage . cpp <nl> For license and copyright information please follow this link : <nl> # include " auth_session . h " <nl> # include " window / window_controller . h " <nl> # include " base / flags . h " <nl> + # include " data / data_session . h " <nl> <nl> # include < openssl / evp . h > <nl> <nl> enum { <nl> dbiDcOptions = 0x4a , <nl> dbiMtpAuthorization = 0x4b , <nl> dbiLastSeenWarningSeenOld = 0x4c , <nl> - dbiAuthSessionData = 0x4d , <nl> + dbiAuthSessionSettings = 0x4d , <nl> dbiLangPackKey = 0x4e , <nl> dbiConnectionType = 0x4f , <nl> dbiStickersFavedLimit = 0x50 , <nl> enum class WriteMapWhen { <nl> Soon , <nl> } ; <nl> <nl> - std : : unique_ptr < AuthSessionData > StoredAuthSessionCache ; <nl> - AuthSessionData & GetStoredAuthSessionCache ( ) { <nl> + std : : unique_ptr < AuthSessionSettings > StoredAuthSessionCache ; <nl> + AuthSessionSettings & GetStoredAuthSessionCache ( ) { <nl> if ( ! StoredAuthSessionCache ) { <nl> - StoredAuthSessionCache = std : : make_unique < AuthSessionData > ( ) ; <nl> + StoredAuthSessionCache = std : : make_unique < AuthSessionSettings > ( ) ; <nl> } <nl> return * StoredAuthSessionCache ; <nl> } <nl> bool _readSetting ( quint32 blockId , QDataStream & stream , int version , ReadSetting <nl> GetStoredAuthSessionCache ( ) . setLastSeenWarningSeen ( v = = 1 ) ; <nl> } break ; <nl> <nl> - case dbiAuthSessionData : { <nl> + case dbiAuthSessionSettings : { <nl> QByteArray v ; <nl> stream > > v ; <nl> if ( ! _checkStreamStatus ( stream ) ) return false ; <nl> void _writeUserSettings ( ) { <nl> recentEmojiPreloadData . push_back ( qMakePair ( item . first - > id ( ) , item . second ) ) ; <nl> } <nl> } <nl> - auto userDataInstance = StoredAuthSessionCache ? StoredAuthSessionCache . get ( ) : Messenger : : Instance ( ) . getAuthSessionData ( ) ; <nl> - auto userData = userDataInstance ? userDataInstance - > serialize ( ) : QByteArray ( ) ; <nl> + auto userDataInstance = StoredAuthSessionCache <nl> + ? StoredAuthSessionCache . get ( ) <nl> + : Messenger : : Instance ( ) . getAuthSessionSettings ( ) ; <nl> + auto userData = userDataInstance <nl> + ? userDataInstance - > serialize ( ) <nl> + : QByteArray ( ) ; <nl> <nl> uint32 size = 21 * ( sizeof ( quint32 ) + sizeof ( qint32 ) ) ; <nl> size + = sizeof ( quint32 ) + Serialize : : stringSize ( Global : : AskDownloadPath ( ) ? QString ( ) : Global : : DownloadPath ( ) ) + Serialize : : bytearraySize ( Global : : AskDownloadPath ( ) ? QByteArray ( ) : Global : : DownloadPathBookmark ( ) ) ; <nl> void _writeUserSettings ( ) { <nl> data . stream < < quint32 ( dbiAutoPlay ) < < qint32 ( cAutoPlayGif ( ) ? 1 : 0 ) ; <nl> data . stream < < quint32 ( dbiUseExternalVideoPlayer ) < < qint32 ( cUseExternalVideoPlayer ( ) ) ; <nl> if ( ! userData . isEmpty ( ) ) { <nl> - data . stream < < quint32 ( dbiAuthSessionData ) < < userData ; <nl> + data . stream < < quint32 ( dbiAuthSessionSettings ) < < userData ; <nl> } <nl> <nl> { <nl> mmm a / Telegram / SourceFiles / window / notifications_manager . cpp <nl> ppp b / Telegram / SourceFiles / window / notifications_manager . cpp <nl> void System : : ensureSoundCreated ( ) { <nl> } <nl> <nl> _soundTrack = Media : : Audio : : Current ( ) . createTrack ( ) ; <nl> - _soundTrack - > fillFromFile ( Auth ( ) . data ( ) . getSoundPath ( qsl ( " msg_incoming " ) ) ) ; <nl> + _soundTrack - > fillFromFile ( <nl> + Auth ( ) . settings ( ) . getSoundPath ( qsl ( " msg_incoming " ) ) ) ; <nl> } <nl> <nl> void System : : updateAll ( ) { <nl> mmm a / Telegram / SourceFiles / window / window_controller . cpp <nl> ppp b / Telegram / SourceFiles / window / window_controller . cpp <nl> Controller : : ColumnLayout Controller : : computeColumnLayout ( ) const { <nl> if ( bodyWidth < minimalThreeColumnWidth ( ) ) { <nl> return true ; <nl> } <nl> - if ( ! Auth ( ) . data ( ) . tabbedSelectorSectionEnabled ( ) <nl> - & & ! Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) ) { <nl> + if ( ! Auth ( ) . settings ( ) . tabbedSelectorSectionEnabled ( ) <nl> + & & ! Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) ) { <nl> return true ; <nl> } <nl> return false ; <nl> Controller : : ColumnLayout Controller : : computeColumnLayout ( ) const { <nl> } <nl> <nl> int Controller : : countDialogsWidthFromRatio ( int bodyWidth ) const { <nl> - auto result = qRound ( bodyWidth * Auth ( ) . data ( ) . dialogsWidthRatio ( ) ) ; <nl> + auto result = qRound ( bodyWidth * Auth ( ) . settings ( ) . dialogsWidthRatio ( ) ) ; <nl> accumulate_max ( result , st : : columnMinimalWidthLeft ) ; <nl> / / accumulate_min ( result , st : : columnMaximalWidthLeft ) ; <nl> return result ; <nl> } <nl> <nl> int Controller : : countThirdColumnWidthFromRatio ( int bodyWidth ) const { <nl> - auto result = Auth ( ) . data ( ) . thirdColumnWidth ( ) ; <nl> + auto result = Auth ( ) . settings ( ) . thirdColumnWidth ( ) ; <nl> accumulate_max ( result , st : : columnMinimalWidthThird ) ; <nl> accumulate_min ( result , st : : columnMaximalWidthThird ) ; <nl> return result ; <nl> void Controller : : resizeForThirdSection ( ) { <nl> <nl> auto layout = computeColumnLayout ( ) ; <nl> auto tabbedSelectorSectionEnabled = <nl> - Auth ( ) . data ( ) . tabbedSelectorSectionEnabled ( ) ; <nl> + Auth ( ) . settings ( ) . tabbedSelectorSectionEnabled ( ) ; <nl> auto thirdSectionInfoEnabled = <nl> - Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) ; <nl> - Auth ( ) . data ( ) . setTabbedSelectorSectionEnabled ( false ) ; <nl> - Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( false ) ; <nl> + Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) ; <nl> + Auth ( ) . settings ( ) . setTabbedSelectorSectionEnabled ( false ) ; <nl> + Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( false ) ; <nl> <nl> auto wanted = countThirdColumnWidthFromRatio ( layout . bodyWidth ) ; <nl> auto minimal = st : : columnMinimalWidthThird ; <nl> void Controller : : resizeForThirdSection ( ) { <nl> return window ( ) - > tryToExtendWidthBy ( minimal ) ; <nl> } ( ) ; <nl> if ( extendedBy ) { <nl> - if ( extendBy ! = Auth ( ) . data ( ) . thirdColumnWidth ( ) ) { <nl> - Auth ( ) . data ( ) . setThirdColumnWidth ( extendBy ) ; <nl> + if ( extendBy ! = Auth ( ) . settings ( ) . thirdColumnWidth ( ) ) { <nl> + Auth ( ) . settings ( ) . setThirdColumnWidth ( extendBy ) ; <nl> } <nl> auto newBodyWidth = layout . bodyWidth + extendedBy ; <nl> - auto currentRatio = Auth ( ) . data ( ) . dialogsWidthRatio ( ) ; <nl> - Auth ( ) . data ( ) . setDialogsWidthRatio ( <nl> + auto currentRatio = Auth ( ) . settings ( ) . dialogsWidthRatio ( ) ; <nl> + Auth ( ) . settings ( ) . setDialogsWidthRatio ( <nl> ( currentRatio * layout . bodyWidth ) / newBodyWidth ) ; <nl> } <nl> auto savedValue = ( extendedBy = = extendBy ) ? - 1 : extendedBy ; <nl> - Auth ( ) . data ( ) . setThirdSectionExtendedBy ( savedValue ) ; <nl> + Auth ( ) . settings ( ) . setThirdSectionExtendedBy ( savedValue ) ; <nl> <nl> - Auth ( ) . data ( ) . setTabbedSelectorSectionEnabled ( <nl> + Auth ( ) . settings ( ) . setTabbedSelectorSectionEnabled ( <nl> tabbedSelectorSectionEnabled ) ; <nl> - Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( <nl> + Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( <nl> thirdSectionInfoEnabled ) ; <nl> } <nl> <nl> void Controller : : closeThirdSection ( ) { <nl> if ( layout . windowLayout = = Adaptive : : WindowLayout : : ThreeColumn ) { <nl> auto noResize = window ( ) - > isFullScreen ( ) <nl> | | window ( ) - > isMaximized ( ) ; <nl> - auto savedValue = Auth ( ) . data ( ) . thirdSectionExtendedBy ( ) ; <nl> + auto savedValue = Auth ( ) . settings ( ) . thirdSectionExtendedBy ( ) ; <nl> auto extendedBy = ( savedValue = = - 1 ) <nl> ? layout . thirdWidth <nl> : savedValue ; <nl> auto newBodyWidth = noResize <nl> ? layout . bodyWidth <nl> : ( layout . bodyWidth - extendedBy ) ; <nl> - auto currentRatio = Auth ( ) . data ( ) . dialogsWidthRatio ( ) ; <nl> - Auth ( ) . data ( ) . setDialogsWidthRatio ( <nl> + auto currentRatio = Auth ( ) . settings ( ) . dialogsWidthRatio ( ) ; <nl> + Auth ( ) . settings ( ) . setDialogsWidthRatio ( <nl> ( currentRatio * layout . bodyWidth ) / newBodyWidth ) ; <nl> newWindowSize = QSize ( <nl> window ( ) - > width ( ) + ( newBodyWidth - layout . bodyWidth ) , <nl> window ( ) - > height ( ) ) ; <nl> } <nl> - Auth ( ) . data ( ) . setTabbedSelectorSectionEnabled ( false ) ; <nl> - Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( false ) ; <nl> - Auth ( ) . saveDataDelayed ( ) ; <nl> + Auth ( ) . settings ( ) . setTabbedSelectorSectionEnabled ( false ) ; <nl> + Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( false ) ; <nl> + Auth ( ) . saveSettingsDelayed ( ) ; <nl> if ( window ( ) - > size ( ) ! = newWindowSize ) { <nl> window ( ) - > resize ( newWindowSize ) ; <nl> } else { <nl> void Navigation : : showPeerInfo ( <nl> PeerId peerId , <nl> const SectionShow & params ) { <nl> / / if ( Adaptive : : ThreeColumn ( ) <nl> - / / & & ! Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) ) { <nl> - / / Auth ( ) . data ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> - / / Auth ( ) . saveDataDelayed ( ) ; <nl> + / / & & ! Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) ) { <nl> + / / Auth ( ) . settings ( ) . setThirdSectionInfoEnabled ( true ) ; <nl> + / / Auth ( ) . saveSettingsDelayed ( ) ; <nl> / / } <nl> showSection ( Info : : Memento ( peerId ) , params ) ; <nl> } <nl> mmm a / Telegram / SourceFiles / window / window_peer_menu . cpp <nl> ppp b / Telegram / SourceFiles / window / window_peer_menu . cpp <nl> For license and copyright information please follow this link : <nl> # include " observer_peer . h " <nl> # include " styles / style_boxes . h " <nl> # include " window / window_controller . h " <nl> + # include " data / data_session . h " <nl> <nl> namespace Window { <nl> namespace { <nl> bool Filler : : showInfo ( ) { <nl> } else if ( ! Adaptive : : ThreeColumn ( ) ) { <nl> return true ; <nl> } else if ( <nl> - ! Auth ( ) . data ( ) . thirdSectionInfoEnabled ( ) & & <nl> - ! Auth ( ) . data ( ) . tabbedReplacedWithInfo ( ) ) { <nl> + ! Auth ( ) . settings ( ) . thirdSectionInfoEnabled ( ) & & <nl> + ! Auth ( ) . settings ( ) . tabbedReplacedWithInfo ( ) ) { <nl> return true ; <nl> } <nl> return false ; <nl> mmm a / Telegram / gyp / telegram_sources . txt <nl> ppp b / Telegram / gyp / telegram_sources . txt <nl> <nl> < ( src_loc ) / data / data_photo . h <nl> < ( src_loc ) / data / data_search_controller . cpp <nl> < ( src_loc ) / data / data_search_controller . h <nl> + < ( src_loc ) / data / data_session . cpp <nl> + < ( src_loc ) / data / data_session . h <nl> < ( src_loc ) / data / data_shared_media . cpp <nl> < ( src_loc ) / data / data_shared_media . h <nl> < ( src_loc ) / data / data_sparse_ids . cpp <nl>
Move non - settings session data to Data : : Session .
telegramdesktop/tdesktop
6a9556d42cd13b4f72f318c243153054fd432916
2018-02-08T09:20:46Z
mmm a / docs / en / engines / table - engines / special / join . md <nl> ppp b / docs / en / engines / table - engines / special / join . md <nl> toc_priority : 40 <nl> toc_title : Join <nl> mmm <nl> <nl> - # Join { # join } <nl> + # Join Table Engine { # join } <nl> <nl> - Prepared data structure for using in [ JOIN ] ( . . / . . / . . / sql - reference / statements / select / join . md # select - join ) operations . <nl> + Optional prepared data structure for usage in [ JOIN ] ( . . / . . / . . / sql - reference / statements / select / join . md # select - join ) operations . <nl> + <nl> + ! ! ! note " Note " <nl> + This is not an article about the [ JOIN clause ] ( . . / . . / . . / sql - reference / statements / select / join . md # select - join ) itself . <nl> <nl> # # Creating a Table { # creating - a - table } <nl> <nl>
Update join . md
ClickHouse/ClickHouse
33d4ed893a47d4bbf971866d433fd1c784c4da7a
2020-06-10T20:14:00Z
mmm a / src / mongo / db / ops / modifier_object_replace . cpp <nl> ppp b / src / mongo / db / ops / modifier_object_replace . cpp <nl> namespace mongo { <nl> Status ModifierObjectReplace : : prepare ( mutablebson : : Element root , <nl> const StringData & matchedField , <nl> ExecInfo * execInfo ) { <nl> - BSONObj objOld = root . getDocument ( ) . getObject ( ) ; <nl> + _preparedState . reset ( new PreparedState ( & root . getDocument ( ) ) ) ; <nl> <nl> / / objectSize checked by binaryEqual ( optimization ) <nl> + BSONObj objOld = root . getDocument ( ) . getObject ( ) ; <nl> if ( objOld . binaryEqual ( _val ) ) { <nl> _preparedState - > noOp = true ; <nl> execInfo - > noOp = true ; <nl> } <nl> - _preparedState . reset ( new PreparedState ( & root . getDocument ( ) ) ) ; <nl> + <nl> return Status : : OK ( ) ; <nl> } <nl> <nl>
SERVER - 10037 : move reset first
mongodb/mongo
08439d7693f2c005dd2013eb482526706fb49b7f
2013-07-15T18:59:42Z
mmm a / src / mips / macro - assembler - mips . cc <nl> ppp b / src / mips / macro - assembler - mips . cc <nl> void MacroAssembler : : TestJSArrayForAllocationSiteInfo ( <nl> ExternalReference : : new_space_start ( isolate ( ) ) ; <nl> ExternalReference new_space_allocation_top = <nl> ExternalReference : : new_space_allocation_top_address ( isolate ( ) ) ; <nl> - lw ( scratch_reg , FieldMemOperand ( receiver_reg , <nl> - JSArray : : kSize + AllocationSiteInfo : : kSize - kHeapObjectTag ) ) ; <nl> + Addu ( scratch_reg , receiver_reg , <nl> + Operand ( JSArray : : kSize + AllocationSiteInfo : : kSize - kHeapObjectTag ) ) ; <nl> Branch ( & no_info_available , lt , scratch_reg , Operand ( new_space_start ) ) ; <nl> - Branch ( & no_info_available , gt , scratch_reg , <nl> - Operand ( new_space_allocation_top ) ) ; <nl> + li ( at , Operand ( new_space_allocation_top ) ) ; <nl> + lw ( at , MemOperand ( at ) ) ; <nl> + Branch ( & no_info_available , gt , scratch_reg , Operand ( at ) ) ; <nl> lw ( scratch_reg , MemOperand ( scratch_reg , - AllocationSiteInfo : : kSize ) ) ; <nl> Branch ( allocation_info_present , eq , scratch_reg , <nl> Operand ( Handle < Map > ( isolate ( ) - > heap ( ) - > allocation_site_info_map ( ) ) ) ) ; <nl>
MIPS : Incorrect ARM assembly in MacroAssembler : : TestJSArrayForAllocationSiteInfo
v8/v8
a3de98b4a76474b3a469b3833fa5cb0b9fc95ee1
2013-01-22T16:18:59Z
mmm a / dbms / src / Functions / FunctionsCoding . h <nl> ppp b / dbms / src / Functions / FunctionsCoding . h <nl> class FunctionIPv6CIDRtoIPv6Range : public IFunction <nl> else <nl> { <nl> const size_t shifts_bits = new_byte_offset - bits_to_keep > 8 ? 8 : new_byte_offset - bits_to_keep ; <nl> - UInt8 byte_reference = lower_range ? 0 : 0b11111111 ; <nl> + UInt8 byte_reference = lower_range ? 0 : std : : numeric_limits < UInt8 > : : max ( ) ; <nl> <nl> dst [ offset ] = ( ( src [ offset ] > > shifts_bits < < shifts_bits ) ) <nl> | ( byte_reference > > ( 8 - shifts_bits ) ) ; <nl> class FunctionIPv6CIDRtoIPv6Range : public IFunction <nl> <nl> <nl> static constexpr auto name = " IPv6CIDRtoIPv6Range " ; <nl> - static FunctionPtr create ( const Context & ) { return std : : make_shared < FunctionIPv4CIDRtoIPv4Range > ( ) ; } <nl> + static FunctionPtr create ( const Context & ) { return std : : make_shared < FunctionIPv6CIDRtoIPv6Range > ( ) ; } <nl> <nl> String getName ( ) const override { return name ; } <nl> <nl> class FunctionIPv6CIDRtoIPv6Range : public IFunction <nl> } <nl> } ; <nl> <nl> + class FunctionIPv4CIDRtoIPv4Range : public IFunction <nl> + { <nl> + public : <nl> + template < bool lower_range > <nl> + static UInt32 setCIDRMask ( UInt32 src , UInt8 bits_to_keep ) <nl> + { <nl> + UInt32 byte_reference = lower_range ? 0 : std : : numeric_limits < UInt32 > : : max ( ) ; <nl> + UInt8 shifts_bits = 32 - bits_to_keep ; <nl> + <nl> + return ( src > > shifts_bits < < shifts_bits ) <nl> + | ( byte_reference > > bits_to_keep ) ; <nl> + } <nl> + <nl> + static constexpr auto name = " IPv4CIDRtoIPv4Range " ; <nl> + static FunctionPtr create ( const Context & ) { return std : : make_shared < FunctionIPv4CIDRtoIPv4Range > ( ) ; } <nl> + <nl> + String getName ( ) const override { return name ; } <nl> + <nl> + size_t getNumberOfArguments ( ) const override { return 2 ; } <nl> + bool isInjective ( const Block & ) override { return true ; } <nl> + <nl> + DataTypePtr getReturnTypeImpl ( const DataTypes & arguments ) const override <nl> + { <nl> + if ( ! WhichDataType ( arguments [ 0 ] ) . isUInt32 ( ) ) <nl> + throw Exception ( " Illegal type " + arguments [ 0 ] - > getName ( ) + <nl> + " of first argument of function " + getName ( ) + <nl> + " , expected UInt32 " , <nl> + ErrorCodes : : ILLEGAL_TYPE_OF_ARGUMENT ) ; <nl> + <nl> + <nl> + const DataTypePtr & second_argument = arguments [ 1 ] ; <nl> + if ( ! isNumber ( second_argument ) ) <nl> + throw Exception { " Illegal type " + second_argument - > getName ( ) <nl> + + " of second argument of function " + getName ( ) <nl> + + " , expected numeric type . " , ErrorCodes : : ILLEGAL_TYPE_OF_ARGUMENT } ; <nl> + <nl> + decltype ( arguments ) return_type <nl> + { <nl> + std : : make_shared < DataTypeUInt32 > ( ) , <nl> + std : : make_shared < DataTypeUInt32 > ( ) <nl> + } ; <nl> + return std : : make_shared < DataTypeTuple > ( return_type ) ; <nl> + } <nl> + <nl> + bool useDefaultImplementationForConstants ( ) const override { return true ; } <nl> + <nl> + <nl> + void executeImpl ( Block & block , const ColumnNumbers & arguments , size_t result , size_t / * input_rows_count * / ) override <nl> + { <nl> + const auto & col_type_name_ip = block . getByPosition ( arguments [ 0 ] ) ; <nl> + const ColumnPtr & column_ip = col_type_name_ip . column ; <nl> + <nl> + const auto col_ip_in = checkAndGetColumn < ColumnUInt32 > ( column_ip . get ( ) ) ; <nl> + <nl> + const auto & col_type_name_cidr = block . getByPosition ( arguments [ 1 ] ) ; <nl> + const ColumnPtr & column_cidr = col_type_name_cidr . column ; <nl> + <nl> + const auto col_const_cidr_in = checkAndGetColumnConst < ColumnUInt8 > ( column_cidr . get ( ) ) ; <nl> + const auto col_cidr_in = checkAndGetColumn < ColumnUInt8 > ( column_cidr . get ( ) ) ; <nl> + <nl> + if ( col_ip_in & & ( col_const_cidr_in | | col_cidr_in ) ) <nl> + { <nl> + const auto size = col_ip_in - > size ( ) ; <nl> + const auto & vec_in = col_ip_in - > getData ( ) ; <nl> + <nl> + Columns tuple_columns ( IP_RANGE_TUPLE_SIZE ) ; <nl> + <nl> + auto col_res_lower_range = ColumnUInt32 : : create ( ) ; <nl> + auto col_res_upper_range = ColumnUInt32 : : create ( ) ; <nl> + <nl> + auto & vec_res_lower_range = col_res_lower_range - > getData ( ) ; <nl> + vec_res_lower_range . resize ( size ) ; <nl> + <nl> + auto & vec_res_upper_range = col_res_upper_range - > getData ( ) ; <nl> + vec_res_upper_range . resize ( size ) ; <nl> + <nl> + for ( size_t i = 0 ; i < vec_in . size ( ) ; + + i ) <nl> + { <nl> + UInt8 cidr = col_const_cidr_in <nl> + ? col_const_cidr_in - > getValue < UInt8 > ( ) <nl> + : col_cidr_in - > getData ( ) [ i ] ; <nl> + <nl> + vec_res_lower_range [ i ] = setCIDRMask < true > ( vec_in [ i ] , cidr ) ; <nl> + vec_res_upper_range [ i ] = setCIDRMask < false > ( vec_in [ i ] , cidr ) ; <nl> + } <nl> + <nl> + tuple_columns [ 0 ] = std : : move ( col_res_lower_range ) ; <nl> + tuple_columns [ 1 ] = std : : move ( col_res_upper_range ) ; <nl> + <nl> + block . getByPosition ( result ) . column = ColumnTuple : : create ( tuple_columns ) ; <nl> + } <nl> + else if ( ! col_ip_in ) <nl> + throw Exception ( " Illegal column " + block . getByPosition ( arguments [ 0 ] ) . column - > getName ( ) <nl> + + " of argument of function " + getName ( ) , <nl> + ErrorCodes : : ILLEGAL_COLUMN ) ; <nl> + else <nl> + throw Exception ( " Illegal column " + block . getByPosition ( arguments [ 1 ] ) . column - > getName ( ) <nl> + + " of argument of function " + getName ( ) , <nl> + ErrorCodes : : ILLEGAL_COLUMN ) ; <nl> + <nl> + } <nl> + } ; <nl> + <nl> + <nl> <nl> } <nl>
Add function for get an ipv4 range using an ipv4 and a cidr mask
ClickHouse/ClickHouse
8dee4fe5d198b3ba45d4bd226abe52305104128b
2019-04-23T07:02:23Z
mmm a / tests / test_core . py <nl> ppp b / tests / test_core . py <nl> def test_wasm_builtin_simd ( self , js_engines ) : <nl> self . get_dir ( ) , os . path . join ( self . get_dir ( ) , ' src . cpp ' ) ) <nl> <nl> @ wasm_simd <nl> + @ unittest . skip ( ' Allow max_ { s , u } intrinsic name to roll ' ) <nl> def test_wasm_intrinsics_simd ( self , js_engines ) : <nl> def run ( ) : <nl> self . do_run ( <nl>
Disable SIMD test to allow LLVM roll ( )
emscripten-core/emscripten
86e6f555799de44163894c09e253c5a5caf85317
2020-04-01T01:48:31Z
mmm a / tensorflow / python / kernel_tests / qr_op_test . py <nl> ppp b / tensorflow / python / kernel_tests / qr_op_test . py <nl> def benchmarkQROp ( self ) : <nl> _GetQrOpTest ( dtype , shape , full_matrices , <nl> use_static_shape ) ) <nl> <nl> - # TODO ( pfau ) : Get working with complex types . <nl> # TODO ( pfau ) : Get working with full_matrices when rows > cols <nl> # TODO ( pfau ) : Get working with shapeholders ( dynamic shapes ) <nl> for full_matrices in False , True : <nl> - for dtype in np . float32 , np . float64 : <nl> + for dtype in np . float32 , np . float64 , np . complex64 , np . complex128 : <nl> for rows in 1 , 2 , 5 , 10 : <nl> for cols in 1 , 2 , 5 , 10 : <nl> if rows < = cols or ( not full_matrices and rows > cols ) : <nl> mmm a / tensorflow / python / ops / linalg_grad . py <nl> ppp b / tensorflow / python / ops / linalg_grad . py <nl> def _CholeskyGrad ( op , grad ) : <nl> @ ops . RegisterGradient ( " Qr " ) <nl> def _QrGrad ( op , dq , dr ) : <nl> " " " Gradient for Qr . " " " <nl> + <nl> + # The methodology is explained in detail in https : / / arxiv . org / abs / 2009 . 10071 <nl> + # QR and LQ Decomposition Matrix Backpropagation Algorithms for <nl> + # Square , Wide , and Deep , Real and Complex , Matrices and Their Software Implementation <nl> q , r = op . outputs <nl> - if q . dtype . is_complex : <nl> - raise NotImplementedError ( " QrGrad not implemented for dtype : % s " % q . dtype ) <nl> if ( r . shape . ndims is None or r . shape . as_list ( ) [ - 2 ] is None or <nl> r . shape . as_list ( ) [ - 1 ] is None ) : <nl> raise NotImplementedError ( " QrGrad not implemented with dynamic shapes . " ) <nl> def _QrGradSquareAndDeepMatrices ( q , r , dq , dr ) : <nl> <nl> grad_a = math_ops . matmul ( q , dr + _TriangularSolve ( tril , r ) ) <nl> grad_b = _TriangularSolve ( dq - math_ops . matmul ( q , qdq ) , r ) <nl> - return grad_a + grad_b <nl> + ret = grad_a + grad_b <nl> + <nl> + if q . dtype . is_complex : <nl> + # need to add a correction to the gradient formula for complex case <nl> + m = rdr - _linalg . adjoint ( qdq ) <nl> + eyem = _linalg . set_diag ( array_ops . zeros_like ( m ) , _linalg . diag_part ( m ) ) <nl> + correction = eyem - math_ops . cast ( math_ops . real ( eyem ) , q . dtype ) <nl> + ret = ret + _TriangularSolve ( <nl> + math_ops . matmul ( q , _linalg . adjoint ( correction ) ) , r ) <nl> + <nl> + return ret <nl> <nl> num_rows , num_cols = q . shape . dims [ - 2 ] . value , r . shape . dims [ - 1 ] <nl> <nl> def _QrGradSquareAndDeepMatrices ( q , r , dq , dr ) : <nl> return _QrGradSquareAndDeepMatrices ( q , r , dq , dr ) <nl> <nl> # Partition a = [ x , y ] , r = [ u , v ] and reduce to the square case <nl> - # The methodology is explained in detail in https : / / arxiv . org / abs / 2009 . 10071 <nl> a = op . inputs [ 0 ] <nl> y = a [ . . . , : , num_rows : ] <nl> u = r [ . . . , : , : num_rows ] <nl>
Merge pull request from D - Roberts : complex_qr
tensorflow/tensorflow
a7d64fb21cfdbc1382865277dd65d6f72fdee625
2020-12-28T14:25:13Z
mmm a / src / heap / collection - barrier . cc <nl> ppp b / src / heap / collection - barrier . cc <nl> class BackgroundCollectionInterruptTask : public CancelableTask { <nl> } ; <nl> <nl> void CollectionBarrier : : AwaitCollectionBackground ( ) { <nl> - bool first ; <nl> - <nl> - { <nl> - base : : MutexGuard guard ( & mutex_ ) ; <nl> - first = FirstCollectionRequest ( ) ; <nl> - if ( first ) { <nl> - / / Initialize scope while holding the lock - prevents GC from starting <nl> - / / before setting up this counter <nl> - time_to_collection_scope_ . emplace ( <nl> - heap_ - > isolate ( ) - > counters ( ) - > time_to_collection ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - if ( first ) { <nl> + if ( FirstCollectionRequest ( ) ) { <nl> / / This is the first background thread requesting collection , ask the main <nl> / / thread for GC . <nl> ActivateStackGuardAndPostTask ( ) ; <nl> void CollectionBarrier : : AwaitCollectionBackground ( ) { <nl> <nl> void CollectionBarrier : : StopTimeToCollectionTimer ( ) { <nl> base : : MutexGuard guard ( & mutex_ ) ; <nl> - RequestState old_state = state_ . exchange ( RequestState : : kCollectionStarted , <nl> - std : : memory_order_relaxed ) ; <nl> - USE ( old_state ) ; <nl> - DCHECK ( old_state = = RequestState : : kDefault | | <nl> - old_state = = RequestState : : kCollectionRequested ) ; <nl> time_to_collection_scope_ . reset ( ) ; <nl> } <nl> <nl> void CollectionBarrier : : ActivateStackGuardAndPostTask ( ) { <nl> reinterpret_cast < v8 : : Isolate * > ( isolate ) ) ; <nl> taskrunner - > PostTask ( <nl> std : : make_unique < BackgroundCollectionInterruptTask > ( heap_ ) ) ; <nl> + base : : MutexGuard guard ( & mutex_ ) ; <nl> time_to_collection_scope_ . emplace ( isolate - > counters ( ) - > time_to_collection ( ) ) ; <nl> } <nl> <nl> mmm a / src / heap / collection - barrier . h <nl> ppp b / src / heap / collection - barrier . h <nl> class CollectionBarrier { <nl> kDefault , <nl> <nl> / / Collection was already requested <nl> - kCollectionRequested , <nl> - <nl> - / / Collection was already started <nl> - kCollectionStarted , <nl> + kCollection , <nl> <nl> / / This state is reached after isolate starts to shut down . The main <nl> / / thread can ' t perform any GCs anymore , so all allocations need to be <nl> class CollectionBarrier { <nl> / / The current state . <nl> std : : atomic < RequestState > state_ ; <nl> <nl> + void BlockUntilCollected ( ) ; <nl> + <nl> / / Request GC by activating stack guards and posting a task to perform the <nl> / / GC . <nl> void ActivateStackGuardAndPostTask ( ) ; <nl> class CollectionBarrier { <nl> / / kCollection . <nl> bool FirstCollectionRequest ( ) { <nl> RequestState expected = RequestState : : kDefault ; <nl> - return state_ . compare_exchange_strong ( expected , <nl> - RequestState : : kCollectionRequested ) ; <nl> + return state_ . compare_exchange_strong ( expected , RequestState : : kCollection ) ; <nl> } <nl> <nl> / / Sets state back to kDefault - invoked at end of GC . <nl> void ClearCollectionRequested ( ) { <nl> RequestState old_state = <nl> state_ . exchange ( RequestState : : kDefault , std : : memory_order_relaxed ) ; <nl> - USE ( old_state ) ; <nl> - DCHECK_EQ ( old_state , RequestState : : kCollectionStarted ) ; <nl> + CHECK_NE ( old_state , RequestState : : kShutdown ) ; <nl> } <nl> <nl> public : <nl> class CollectionBarrier { <nl> <nl> / / Checks whether any background thread requested GC . <nl> bool CollectionRequested ( ) { <nl> - return state_ . load ( std : : memory_order_relaxed ) = = <nl> - RequestState : : kCollectionRequested ; <nl> + return state_ . load ( std : : memory_order_relaxed ) = = RequestState : : kCollection ; <nl> } <nl> <nl> void StopTimeToCollectionTimer ( ) ; <nl> - void BlockUntilCollected ( ) ; <nl> <nl> / / Resumes threads waiting for collection . <nl> void ResumeThreadsAwaitingCollection ( ) ; <nl> mmm a / src / heap / heap . cc <nl> ppp b / src / heap / heap . cc <nl> bool Heap : : CollectGarbage ( AllocationSpace space , <nl> this , IsYoungGenerationCollector ( collector ) ? " MinorGC " : " MajorGC " , <nl> GarbageCollectionReasonToString ( gc_reason ) ) ; <nl> <nl> + collection_barrier_ - > StopTimeToCollectionTimer ( ) ; <nl> + <nl> if ( ! CanPromoteYoungAndExpandOldGeneration ( 0 ) ) { <nl> InvokeNearHeapLimitCallback ( ) ; <nl> } <nl> size_t Heap : : PerformGarbageCollection ( <nl> GarbageCollector collector , const v8 : : GCCallbackFlags gc_callback_flags ) { <nl> DisallowJavascriptExecution no_js ( isolate ( ) ) ; <nl> base : : Optional < SafepointScope > optional_safepoint_scope ; <nl> - <nl> - / / Stop time - to - collection timer before safepoint - we do not want to measure <nl> - / / time for safepointing . <nl> - collection_barrier_ - > StopTimeToCollectionTimer ( ) ; <nl> - <nl> if ( FLAG_local_heaps ) { <nl> optional_safepoint_scope . emplace ( this ) ; <nl> } <nl>
Revert " [ heap ] Introduce new state in CollectionBarrier "
v8/v8
f35fef1486d54b0290e009e3469017034ff50710
2020-10-16T15:37:06Z
mmm a / example / example . cpp <nl> ppp b / example / example . cpp <nl> <nl> / / <nl> / / spdlog usage example <nl> / / <nl> + # include " spdlog / spdlog . h " <nl> + # include " spdlog / sinks / ansicolor_sink . h " <nl> + <nl> # include < cstdlib > / / EXIT_FAILURE <nl> # include < iostream > <nl> - # include " spdlog / spdlog . h " <nl> + # include < memory > <nl> <nl> int main ( int , char * [ ] ) <nl> { <nl> int main ( int , char * [ ] ) <nl> syslog_logger - > warn ( " This is warning that will end up in syslog . This is Linux only ! " ) ; <nl> # endif <nl> <nl> + / / <nl> + / / ANSI color logging ( OS X and Linux . Windows only if ansi . sys is loaded . ) <nl> + / / <nl> + <nl> + / / Create a sink to add colors to . <nl> + auto console_out = spdlog : : sinks : : stderr_sink_st : : instance ( ) ; <nl> + auto color_sink = std : : make_shared < spd : : sinks : : ansicolor_sink > ( console_out ) ; / / wraps around another sink <nl> + auto color_logger = spd : : details : : registry : : instance ( ) . create ( " Color " , color_sink ) ; <nl> + color_logger - > set_level ( spd : : level : : trace ) ; <nl> + color_sink - > setColor ( spd : : level : : info , color_sink - > bold + color_sink - > green ) ; <nl> + color_logger - > info ( " Testing color logger . . . " ) ; <nl> + color_logger - > trace ( " Trace " ) ; <nl> + color_logger - > debug ( " Debug " ) ; <nl> + color_logger - > info ( " Info " ) ; <nl> + color_logger - > notice ( " Notice " ) ; <nl> + color_logger - > warn ( " Warning " ) ; <nl> + color_logger - > error ( " Error " ) ; <nl> + color_logger - > critical ( " Critical " ) ; <nl> + color_logger - > alert ( " Alert " ) ; <nl> + color_logger - > emerg ( " Emergency " ) ; <nl> + <nl> / / <nl> / / Release and close all loggers <nl> / / <nl> new file mode 100644 <nl> index 00000000 . . 1bd30db6 <nl> mmm / dev / null <nl> ppp b / include / spdlog / sinks / ansicolor_sink . h <nl> <nl> + / / <nl> + / / Copyright ( c ) 2016 Kevin M . Godby . <nl> + / / Distributed under the MIT License ( http : / / opensource . org / licenses / MIT ) <nl> + / / <nl> + <nl> + # pragma once <nl> + <nl> + # include < spdlog / sinks / base_sink . h > <nl> + # include < spdlog / common . h > <nl> + <nl> + # include < string > <nl> + # include < map > <nl> + <nl> + namespace spdlog { <nl> + namespace sinks { <nl> + <nl> + / * * <nl> + * @ brief The ansi_color_sink is a decorator around another sink and prefixes <nl> + * the output with an ANSI escape sequence color code depending on the severity <nl> + * of the message . <nl> + * / <nl> + class ansicolor_sink : public sink { <nl> + public : <nl> + ansicolor_sink ( sink_ptr sink ) ; <nl> + virtual ~ ansicolor_sink ( ) ; <nl> + <nl> + virtual void log ( const details : : log_msg & msg ) override ; <nl> + virtual void flush ( ) override ; <nl> + <nl> + void setColor ( level : : level_enum level , const std : : string & color ) ; <nl> + <nl> + / / / \ name Formatting codes <nl> + / / @ { <nl> + const std : : string reset = " \ 033 [ 00m " ; <nl> + const std : : string bold = " \ 033 [ 1m " ; <nl> + const std : : string dark = " \ 033 [ 2m " ; <nl> + const std : : string underline = " \ 033 [ 4m " ; <nl> + const std : : string blink = " \ 033 [ 5m " ; <nl> + const std : : string reverse = " \ 033 [ 7m " ; <nl> + const std : : string concealed = " \ 033 [ 8m " ; <nl> + / / @ } <nl> + <nl> + / / / \ name Foreground colors <nl> + / / @ { <nl> + const std : : string grey = " \ 033 [ 30m " ; <nl> + const std : : string red = " \ 033 [ 31m " ; <nl> + const std : : string green = " \ 033 [ 32m " ; <nl> + const std : : string yellow = " \ 033 [ 33m " ; <nl> + const std : : string blue = " \ 033 [ 34m " ; <nl> + const std : : string magenta = " \ 033 [ 35m " ; <nl> + const std : : string cyan = " \ 033 [ 36m " ; <nl> + const std : : string white = " \ 033 [ 37m " ; <nl> + / / @ } <nl> + <nl> + / / / \ name Background colors <nl> + / / @ { <nl> + const std : : string on_grey = " \ 033 [ 40m " ; <nl> + const std : : string on_red = " \ 033 [ 41m " ; <nl> + const std : : string on_green = " \ 033 [ 42m " ; <nl> + const std : : string on_yellow = " \ 033 [ 43m " ; <nl> + const std : : string on_blue = " \ 033 [ 44m " ; <nl> + const std : : string on_magenta = " \ 033 [ 45m " ; <nl> + const std : : string on_cyan = " \ 033 [ 46m " ; <nl> + const std : : string on_white = " \ 033 [ 47m " ; <nl> + / / @ } <nl> + <nl> + <nl> + protected : <nl> + sink_ptr sink_ ; <nl> + std : : map < level : : level_enum , std : : string > colors_ { <nl> + { level : : trace , grey } , <nl> + { level : : debug , white } , <nl> + { level : : info , green } , <nl> + { level : : notice , yellow } , <nl> + { level : : warn , bold + yellow } , <nl> + { level : : err , red } , <nl> + { level : : critical , bold + red } , <nl> + { level : : alert , bold + white + on_red } , <nl> + { level : : emerg , bold + yellow + on_red } , <nl> + { level : : off , reset } <nl> + } ; <nl> + } ; <nl> + <nl> + inline ansicolor_sink : : ansicolor_sink ( sink_ptr sink ) : sink_ ( sink ) <nl> + { <nl> + / / do nothing <nl> + } <nl> + <nl> + inline ansicolor_sink : : ~ ansicolor_sink ( ) <nl> + { <nl> + / / do nothing <nl> + } <nl> + <nl> + inline void ansicolor_sink : : log ( const details : : log_msg & msg ) <nl> + { <nl> + / / Wrap the originally formatted message in color codes <nl> + const std : : string prefix = colors_ [ msg . level ] ; <nl> + const std : : string s = msg . formatted . str ( ) ; <nl> + const std : : string suffix = reset ; <nl> + details : : log_msg m ; <nl> + m . formatted . write ( prefix + s + suffix ) ; <nl> + sink_ - > log ( m ) ; <nl> + } <nl> + <nl> + inline void ansicolor_sink : : flush ( ) <nl> + { <nl> + sink_ - > flush ( ) ; <nl> + } <nl> + <nl> + inline void ansicolor_sink : : setColor ( level : : level_enum level , const std : : string & color ) <nl> + { <nl> + colors_ [ level ] = color ; <nl> + } <nl> + <nl> + } / / namespace sinks <nl> + } / / namespace spdlog <nl> + <nl>
Added ANSI color sink .
gabime/spdlog
1c9f1749d392e1bb8f312af82f945f4c7a56630d
2016-03-16T01:18:08Z
mmm a / protoc - artifacts / build - zip . sh <nl> ppp b / protoc - artifacts / build - zip . sh <nl> Example : <nl> This script will download pre - built protoc or protoc plugin binaries from maven <nl> repository and create . zip packages suitable to be included in the github <nl> release page . If the target is protoc , well - known type . proto files will also be <nl> - included . Each invocation will create 9 zip packages : <nl> + included . Each invocation will create 8 zip packages : <nl> dist / < TARGET > - < VERSION_NUMBER > - win32 . zip <nl> dist / < TARGET > - < VERSION_NUMBER > - win64 . zip <nl> - dist / < TARGET > - < VERSION_NUMBER > - osx - x86_32 . zip <nl> dist / < TARGET > - < VERSION_NUMBER > - osx - x86_64 . zip <nl> dist / < TARGET > - < VERSION_NUMBER > - linux - x86_32 . zip <nl> dist / < TARGET > - < VERSION_NUMBER > - linux - x86_64 . zip <nl> VERSION_NUMBER = $ 2 <nl> declare - a FILE_NAMES = ( \ <nl> win32 . zip windows - x86_32 . exe \ <nl> win64 . zip windows - x86_64 . exe \ <nl> - osx - x86_32 . zip osx - x86_32 . exe \ <nl> osx - x86_64 . zip osx - x86_64 . exe \ <nl> linux - x86_32 . zip linux - x86_32 . exe \ <nl> linux - x86_64 . zip linux - x86_64 . exe \ <nl>
Skip building distribution tar files for 32 bit Mac ( )
protocolbuffers/protobuf
d0bfd5221182da1a7cc280f3337b5e41a89539cf
2020-02-14T20:13:20Z
mmm a / ReactNative / UIManager / Events / EventDispatcher . cs <nl> ppp b / ReactNative / UIManager / Events / EventDispatcher . cs <nl> <nl> using ReactNative . Tracing ; <nl> using System ; <nl> using System . Collections . Generic ; <nl> - using System . Linq ; <nl> + using System . Threading ; <nl> + using Windows . UI . Xaml . Media ; <nl> <nl> namespace ReactNative . UIManager . Events <nl> { <nl> public class EventDispatcher : ILifecycleEventListener <nl> } <nl> } ) ; <nl> <nl> + private readonly object _eventsStagingLock = new object ( ) ; <nl> private readonly object _eventsToDispatchLock = new object ( ) ; <nl> <nl> - private readonly List < Event > _eventsToDispatch = new List < Event > ( ) ; <nl> private readonly IDictionary < long , int > _eventCookieToLastEventIndex = new Dictionary < long , int > ( ) ; <nl> private readonly IDictionary < string , short > _eventNameToEventId = new Dictionary < string , short > ( ) ; <nl> + private readonly List < Event > _eventStaging = new List < Event > ( ) ; <nl> <nl> private readonly ReactContext _reactContext ; <nl> <nl> + private Event [ ] _eventsToDispatch = new Event [ 16 ] ; <nl> + private int _eventsToDispatchSize = 0 ; <nl> private RCTEventEmitter _rctEventEmitter ; <nl> - private EventDispatcherCallback _currentFrameCallback ; <nl> + private bool _hasDispatchScheduled = false ; <nl> <nl> / / / < summary > <nl> / / / Instantiates the < see cref = " EventDispatcher " / > . <nl> public void DispatchEvent ( Event @ event ) <nl> if ( @ event = = null ) <nl> throw new ArgumentNullException ( nameof ( @ event ) ) ; <nl> <nl> - if ( ! @ event . IsInitialized ) <nl> + lock ( _eventsStagingLock ) <nl> { <nl> - throw new ArgumentException ( " Dispatched event has not been initialized . " , nameof ( @ event ) ) ; <nl> - } <nl> - <nl> - CoalesceEvent ( @ event ) ; <nl> - <nl> - var currentFrameCallback = _currentFrameCallback ; <nl> - if ( currentFrameCallback ! = null ) <nl> - { <nl> - currentFrameCallback . Reschedule ( ) ; <nl> + _eventStaging . Add ( @ event ) ; <nl> } <nl> } <nl> <nl> public void OnResume ( ) <nl> { <nl> DispatcherHelpers . AssertOnDispatcher ( ) ; <nl> <nl> - if ( _currentFrameCallback ! = null ) <nl> - { <nl> - throw new InvalidOperationException ( " Current frame callback is not null . " ) ; <nl> - } <nl> - <nl> if ( _rctEventEmitter = = null ) <nl> { <nl> _rctEventEmitter = _reactContext . GetJavaScriptModule < RCTEventEmitter > ( ) ; <nl> } <nl> <nl> - var currentFrameCallback = new EventDispatcherCallback ( this ) ; <nl> - _currentFrameCallback = currentFrameCallback ; <nl> - currentFrameCallback . Reschedule ( ) ; <nl> + CompositionTarget . Rendering + = ScheduleDispatch ; <nl> } <nl> <nl> / / / < summary > <nl> public void OnReactInstanceDispose ( ) <nl> ClearCallback ( ) ; <nl> } <nl> <nl> - private void DispatchEvents ( ) <nl> + private void ClearCallback ( ) <nl> { <nl> - using ( Tracer . Trace ( Tracer . TRACE_TAG_REACT_BRIDGE , " DispatchEvents " ) ) <nl> - { <nl> - if ( _rctEventEmitter = = null ) <nl> - { <nl> - throw new InvalidOperationException ( " The RCTEventEmitter must not be null . " ) ; <nl> - } <nl> + DispatcherHelpers . AssertOnDispatcher ( ) ; <nl> + CompositionTarget . Rendering - = ScheduleDispatch ; <nl> + } <nl> <nl> - / / Clone the events to dispatch <nl> - var eventsToDispatch = default ( List < Event > ) ; <nl> + private void MoveStagedEventsToDispatchQueue ( ) <nl> + { <nl> + lock ( _eventsStagingLock ) <nl> + { <nl> lock ( _eventsToDispatchLock ) <nl> { <nl> - eventsToDispatch = _eventsToDispatch . ToList ( / * clone * / ) ; <nl> - _eventsToDispatch . Clear ( ) ; <nl> - _eventCookieToLastEventIndex . Clear ( ) ; <nl> - } <nl> - <nl> - var n = eventsToDispatch . Count ; <nl> - if ( n > 1 ) <nl> - { <nl> - eventsToDispatch . Sort ( s_eventComparer ) ; <nl> - } <nl> - <nl> - for ( var idx = 0 ; idx < n ; + + idx ) <nl> - { <nl> - var e = eventsToDispatch [ idx ] ; <nl> - if ( e = = null ) <nl> + foreach ( var @ event in _eventStaging ) <nl> { <nl> - continue ; <nl> - } <nl> + if ( ! @ event . CanCoalesce ) <nl> + { <nl> + AddEventToEventsToDispatch ( @ event ) ; <nl> + continue ; <nl> + } <nl> <nl> - e . Dispatch ( _rctEventEmitter ) ; <nl> - e . Dispose ( ) ; <nl> - } <nl> - } <nl> - } <nl> + var eventCookie = GetEventCookie ( @ event . ViewTag , @ event . EventName , @ event . CoalescingKey ) ; <nl> + var eventToAdd = default ( Event ) ; <nl> + var eventToDispose = default ( Event ) ; <nl> + var lastEventIdx = default ( int ) ; <nl> <nl> - private void CoalesceEvent ( Event e ) <nl> - { <nl> - lock ( _eventsToDispatchLock ) <nl> - { <nl> - if ( ! e . CanCoalesce ) <nl> - { <nl> - _eventsToDispatch . Add ( e ) ; <nl> - return ; <nl> - } <nl> + if ( ! _eventCookieToLastEventIndex . TryGetValue ( eventCookie , out lastEventIdx ) ) <nl> + { <nl> + eventToAdd = @ event ; <nl> + _eventCookieToLastEventIndex . Add ( eventCookie , _eventsToDispatchSize ) ; <nl> + } <nl> + else <nl> + { <nl> + var lastEvent = _eventsToDispatch [ lastEventIdx ] ; <nl> + var coalescedEvent = @ event . Coalesce ( lastEvent ) ; <nl> + if ( coalescedEvent ! = lastEvent ) <nl> + { <nl> + eventToAdd = coalescedEvent ; <nl> + _eventCookieToLastEventIndex [ eventCookie ] = _eventsToDispatchSize ; <nl> + eventToDispose = lastEvent ; <nl> + _eventsToDispatch [ lastEventIdx ] = null ; <nl> + } <nl> + else <nl> + { <nl> + eventToDispose = @ event ; <nl> + } <nl> + } <nl> <nl> - var eventCookie = GetEventCookie ( e . ViewTag , e . EventName , e . CoalescingKey ) ; <nl> - var eventToAdd = default ( Event ) ; <nl> - var eventToDispose = default ( Event ) ; <nl> - var lastEventIdx = default ( int ) ; <nl> + if ( eventToAdd ! = null ) <nl> + { <nl> + AddEventToEventsToDispatch ( eventToAdd ) ; <nl> + } <nl> <nl> - if ( ! _eventCookieToLastEventIndex . TryGetValue ( eventCookie , out lastEventIdx ) ) <nl> - { <nl> - eventToAdd = e ; <nl> - _eventCookieToLastEventIndex . Add ( eventCookie , _eventsToDispatch . Count ) ; <nl> - } <nl> - else <nl> - { <nl> - var lastEvent = _eventsToDispatch [ lastEventIdx ] ; <nl> - var coalescedEvent = e . Coalesce ( lastEvent ) ; <nl> - if ( coalescedEvent ! = lastEvent ) <nl> - { <nl> - eventToAdd = coalescedEvent ; <nl> - _eventCookieToLastEventIndex [ eventCookie ] = _eventsToDispatch . Count ; <nl> - eventToDispose = lastEvent ; <nl> - _eventsToDispatch [ lastEventIdx ] = null ; <nl> - } <nl> - else <nl> - { <nl> - eventToDispose = e ; <nl> + if ( eventToDispose ! = null ) <nl> + { <nl> + eventToDispose . Dispose ( ) ; <nl> + } <nl> } <nl> } <nl> <nl> - if ( eventToAdd ! = null ) <nl> - { <nl> - _eventsToDispatch . Add ( eventToAdd ) ; <nl> - } <nl> - <nl> - if ( eventToDispose ! = null ) <nl> - { <nl> - eventToDispose . Dispose ( ) ; <nl> - } <nl> + _eventStaging . Clear ( ) ; <nl> } <nl> } <nl> <nl> private long GetEventCookie ( int viewTag , short eventTypeId , short coalescingKey ) <nl> ( ( ( long ) coalescingKey ) & 0xffff ) < < 48 ; <nl> } <nl> <nl> - private void ClearCallback ( ) <nl> + private void ScheduleDispatch ( object sender , object e ) <nl> { <nl> DispatcherHelpers . AssertOnDispatcher ( ) ; <nl> - if ( _currentFrameCallback ! = null ) <nl> + <nl> + using ( Tracer . Trace ( Tracer . TRACE_TAG_REACT_BRIDGE , " ScheduleDispatch " ) ) <nl> { <nl> - _currentFrameCallback . Stop ( ) ; <nl> - _currentFrameCallback = null ; <nl> + MoveStagedEventsToDispatchQueue ( ) ; <nl> + <nl> + if ( ! Volatile . Read ( ref _hasDispatchScheduled ) ) <nl> + { <nl> + _hasDispatchScheduled = true ; <nl> + _reactContext . RunOnJavaScriptQueueThread ( DispatchEvents ) ; <nl> + } <nl> } <nl> } <nl> <nl> - class EventDispatcherCallback <nl> + private void DispatchEvents ( ) <nl> { <nl> - private readonly object _gate = new object ( ) ; <nl> - <nl> - private readonly EventDispatcher _parent ; <nl> - <nl> - private bool _scheduled ; <nl> - private bool _stopped ; <nl> - <nl> - public EventDispatcherCallback ( EventDispatcher parent ) <nl> + using ( Tracer . Trace ( Tracer . TRACE_TAG_REACT_BRIDGE , " DispatchEvents " ) ) <nl> { <nl> - _parent = parent ; <nl> - } <nl> + _hasDispatchScheduled = false ; <nl> <nl> - public void Reschedule ( ) <nl> - { <nl> - lock ( _gate ) <nl> + if ( _rctEventEmitter = = null ) <nl> { <nl> - if ( ! _scheduled & & ! _stopped ) <nl> + throw new InvalidOperationException ( " The RCTEventEmitter must not be null . " ) ; <nl> + } <nl> + <nl> + lock ( _eventsToDispatchLock ) <nl> + { <nl> + if ( _eventsToDispatchSize > 1 ) <nl> { <nl> - _scheduled = true ; <nl> + Array . Sort ( _eventsToDispatch , 0 , _eventsToDispatchSize , s_eventComparer ) ; <nl> + } <nl> <nl> - using ( Tracer . Trace ( Tracer . TRACE_TAG_REACT_BRIDGE , " ScheduleDispatchFrameCallback " ) ) <nl> + for ( var eventIdx = 0 ; eventIdx < _eventsToDispatchSize ; + + eventIdx ) <nl> + { <nl> + var @ event = _eventsToDispatch [ eventIdx ] ; <nl> + if ( @ event = = null ) <nl> { <nl> - _parent . _reactContext . RunOnJavaScriptQueueThread ( Run ) ; <nl> + continue ; <nl> } <nl> + <nl> + @ event . Dispatch ( _rctEventEmitter ) ; <nl> + @ event . Dispose ( ) ; <nl> } <nl> + <nl> + ClearEventsToDispatch ( ) ; <nl> + _eventCookieToLastEventIndex . Clear ( ) ; <nl> } <nl> } <nl> + } <nl> <nl> - public void Stop ( ) <nl> + private void AddEventToEventsToDispatch ( Event @ event ) <nl> + { <nl> + if ( _eventsToDispatchSize = = _eventsToDispatch . Length ) <nl> { <nl> - _stopped = true ; <nl> + var temp = _eventsToDispatch ; <nl> + _eventsToDispatch = new Event [ _eventsToDispatch . Length * 2 ] ; <nl> + Array . Copy ( temp , _eventsToDispatch , _eventsToDispatchSize ) ; <nl> } <nl> <nl> - private void Run ( ) <nl> - { <nl> - _scheduled = false ; <nl> - <nl> - if ( _stopped ) <nl> - { <nl> - return ; <nl> - } <nl> + _eventsToDispatch [ _eventsToDispatchSize + + ] = @ event ; <nl> + } <nl> <nl> - _parent . DispatchEvents ( ) ; <nl> - } <nl> + private void ClearEventsToDispatch ( ) <nl> + { <nl> + Array . Clear ( _eventsToDispatch , 0 , _eventsToDispatchSize ) ; <nl> + _eventsToDispatchSize = 0 ; <nl> } <nl> } <nl> } <nl>
perf ( EventDispatcher ) : Drain EventDispatcher on global render event
microsoft/react-native-windows
88f4a857829bfa5b28c24ae0276c73a6ef437b28
2016-05-25T16:16:17Z
mmm a / gni / v8 . gni <nl> ppp b / gni / v8 . gni <nl> if ( ! build_with_chromium & & is_clang ) { <nl> template ( " v8_source_set " ) { <nl> if ( defined ( invoker . split_count ) & & invoker . split_count > 1 & & <nl> defined ( v8_static_library ) & & v8_static_library & & is_win ) { <nl> - link_target_type = " jumbo_split_static_library " <nl> + link_target_type = " split_static_library " <nl> } else if ( defined ( v8_static_library ) & & v8_static_library ) { <nl> link_target_type = " jumbo_static_library " <nl> } else { <nl>
[ build ] Stop using split_static_library
v8/v8
61971c0b7a95d178fb2298883bb6db1ce9d7a61b
2019-10-29T10:09:40Z
mmm a / samples / gpu / performance / performance . cpp <nl> ppp b / samples / gpu / performance / performance . cpp <nl> void gen ( Mat & mat , int rows , int cols , int type , Scalar low , Scalar high ) <nl> <nl> string abspath ( const string & relpath ) <nl> { <nl> - return TestSystem : : instance ( ) - > workingDir ( ) + relpath ; <nl> + return TestSystem : : instance ( ) . workingDir ( ) + relpath ; <nl> } <nl> <nl> <nl> int CV_CDECL cvErrorCallback ( int / * status * / , const char * / * func_name * / , <nl> const char * err_msg , const char * / * file_name * / , <nl> int / * line * / , void * / * userdata * / ) <nl> { <nl> - TestSystem : : instance ( ) - > printError ( err_msg ) ; <nl> + TestSystem : : instance ( ) . printError ( err_msg ) ; <nl> return 0 ; <nl> } <nl> <nl> int main ( int argc , char * * argv ) <nl> } <nl> else <nl> { <nl> - TestSystem : : instance ( ) - > setWorkingDir ( argv [ 1 ] ) ; <nl> + TestSystem : : instance ( ) . setWorkingDir ( argv [ 1 ] ) ; <nl> } <nl> <nl> redirectError ( cvErrorCallback ) ; <nl> - TestSystem : : instance ( ) - > run ( ) ; <nl> + TestSystem : : instance ( ) . run ( ) ; <nl> <nl> return 0 ; <nl> } <nl> \ No newline at end of file <nl> mmm a / samples / gpu / performance / performance . h <nl> ppp b / samples / gpu / performance / performance . h <nl> class Runnable <nl> class TestSystem <nl> { <nl> public : <nl> - static TestSystem * instance ( ) <nl> + static TestSystem & instance ( ) <nl> { <nl> static TestSystem me ; <nl> - return & me ; <nl> + return me ; <nl> } <nl> <nl> void addInit ( Runnable * init ) { inits_ . push_back ( init ) ; } <nl> class TestSystem <nl> <nl> <nl> # define INIT ( name ) \ <nl> - struct name # # _init : Runnable \ <nl> - { \ <nl> + struct name # # _init : Runnable { \ <nl> name # # _init ( ) : Runnable ( # name ) { \ <nl> - TestSystem : : instance ( ) - > addInit ( this ) ; \ <nl> + TestSystem : : instance ( ) . addInit ( this ) ; \ <nl> } \ <nl> void run ( ) ; \ <nl> } name # # _init_instance ; \ <nl> class TestSystem <nl> <nl> <nl> # define TEST ( name ) \ <nl> - struct name # # _test : Runnable \ <nl> - { \ <nl> + struct name # # _test : Runnable { \ <nl> name # # _test ( ) : Runnable ( # name ) { \ <nl> - TestSystem : : instance ( ) - > addTest ( this ) ; \ <nl> + TestSystem : : instance ( ) . addTest ( this ) ; \ <nl> } \ <nl> void run ( ) ; \ <nl> } name # # _test_instance ; \ <nl> void name # # _test : : run ( ) <nl> <nl> - # define SUBTEST TestSystem : : instance ( ) - > subtest ( ) <nl> - # define DESCRIPTION TestSystem : : instance ( ) - > subtest ( ) <nl> - # define CPU_ON TestSystem : : instance ( ) - > cpuOn ( ) <nl> - # define GPU_ON TestSystem : : instance ( ) - > gpuOn ( ) <nl> - # define CPU_OFF TestSystem : : instance ( ) - > cpuOff ( ) <nl> - # define GPU_OFF TestSystem : : instance ( ) - > gpuOff ( ) <nl> + # define SUBTEST TestSystem : : instance ( ) . subtest ( ) <nl> + # define DESCRIPTION TestSystem : : instance ( ) . subtest ( ) <nl> + # define CPU_ON TestSystem : : instance ( ) . cpuOn ( ) <nl> + # define GPU_ON TestSystem : : instance ( ) . gpuOn ( ) <nl> + # define CPU_OFF TestSystem : : instance ( ) . cpuOff ( ) <nl> + # define GPU_OFF TestSystem : : instance ( ) . gpuOff ( ) <nl> <nl> void gen ( cv : : Mat & mat , int rows , int cols , int type , cv : : Scalar low , <nl> cv : : Scalar high ) ; <nl> mmm a / samples / gpu / performance / tests . cpp <nl> ppp b / samples / gpu / performance / tests . cpp <nl> TEST ( BruteForceMatcher ) <nl> GPU_ON ; <nl> d_matcher . radiusMatch ( d_query , d_train , d_matches , max_distance ) ; <nl> GPU_OFF ; <nl> + } <nl> + <nl> + <nl> + TEST ( magnitude ) <nl> + { <nl> + Mat x , y , mag ; <nl> + gpu : : GpuMat d_x , d_y , d_mag ; <nl> + <nl> + for ( int size = 2000 ; size < = 4000 ; size + = 1000 ) <nl> + { <nl> + SUBTEST < < " size " < < size ; <nl> + <nl> + gen ( x , size , size , CV_32F , 0 , 1 ) ; <nl> + gen ( y , size , size , CV_32F , 0 , 1 ) ; <nl> + mag . create ( size , size , CV_32F ) ; <nl> + <nl> + CPU_ON ; <nl> + magnitude ( x , y , mag ) ; <nl> + CPU_OFF ; <nl> + <nl> + d_x = x ; <nl> + d_y = y ; <nl> + d_mag . create ( size , size , CV_32F ) ; <nl> + <nl> + GPU_ON ; <nl> + gpu : : magnitude ( d_x , d_y , d_mag ) ; <nl> + GPU_OFF ; <nl> + } <nl> + } <nl> + <nl> + <nl> + TEST ( add ) <nl> + { <nl> + Mat src1 , src2 , dst ; <nl> + gpu : : GpuMat d_src1 , d_src2 , d_dst ; <nl> + <nl> + for ( int size = 2000 ; size < = 4000 ; size + = 1000 ) <nl> + { <nl> + SUBTEST < < " size " < < size < < " , 32F " ; <nl> + <nl> + gen ( src1 , size , size , CV_32F , 0 , 1 ) ; <nl> + gen ( src2 , size , size , CV_32F , 0 , 1 ) ; <nl> + dst . create ( size , size , CV_32F ) ; <nl> + <nl> + CPU_ON ; <nl> + add ( src1 , src2 , dst ) ; <nl> + CPU_OFF ; <nl> + <nl> + d_src1 = src1 ; <nl> + d_src2 = src2 ; <nl> + d_dst . create ( size , size , CV_32F ) ; <nl> + <nl> + GPU_ON ; <nl> + gpu : : add ( d_src1 , d_src2 , d_dst ) ; <nl> + GPU_OFF ; <nl> + } <nl> + } <nl> + <nl> + <nl> + TEST ( log ) <nl> + { <nl> + Mat src , dst ; <nl> + gpu : : GpuMat d_src , d_dst ; <nl> + <nl> + for ( int size = 2000 ; size < = 4000 ; size + = 1000 ) <nl> + { <nl> + SUBTEST < < " size " < < size < < " , 32F " ; <nl> + <nl> + gen ( src , size , size , CV_32F , 1 , 10 ) ; <nl> + dst . create ( size , size , CV_32F ) ; <nl> + <nl> + CPU_ON ; <nl> + log ( src , dst ) ; <nl> + CPU_OFF ; <nl> + <nl> + d_src = src ; <nl> + d_dst . create ( size , size , CV_32F ) ; <nl> + <nl> + GPU_ON ; <nl> + gpu : : log ( d_src , d_dst ) ; <nl> + GPU_OFF ; <nl> + } <nl> + } <nl> + <nl> + <nl> + TEST ( exp ) <nl> + { <nl> + Mat src , dst ; <nl> + gpu : : GpuMat d_src , d_dst ; <nl> + <nl> + for ( int size = 2000 ; size < = 4000 ; size + = 1000 ) <nl> + { <nl> + SUBTEST < < " size " < < size < < " , 32F " ; <nl> + <nl> + gen ( src , size , size , CV_32F , 0 , 1 ) ; <nl> + dst . create ( size , size , CV_32F ) ; <nl> + <nl> + CPU_ON ; <nl> + exp ( src , dst ) ; <nl> + CPU_OFF ; <nl> + <nl> + d_src = src ; <nl> + d_dst . create ( size , size , CV_32F ) ; <nl> + <nl> + GPU_ON ; <nl> + gpu : : exp ( d_src , d_dst ) ; <nl> + GPU_OFF ; <nl> + } <nl> } <nl> \ No newline at end of file <nl>
added performance tests for log , exp , add , magnitude
opencv/opencv
8f35b572ff0b20eecb291f68d8bd2395a6a80281
2011-01-28T07:45:01Z
mmm a / modules / planning / lattice / trajectory_generation / lateral_trajectory_optimizer_interface . cc <nl> ppp b / modules / planning / lattice / trajectory_generation / lateral_trajectory_optimizer_interface . cc <nl> bool LateralTrajectoryOptimizerInterface : : eval_jac_g ( int n , const double * x , <nl> + + variable_index ) { <nl> / / d_i ' ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = 2 * n + variable_index ; <nl> + jCol [ nz_index ] = 2 * num_of_points_ + variable_index ; <nl> + + nz_index ; <nl> / / d_i + 1 ' ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = 2 * n + variable_index + 1 ; <nl> + jCol [ nz_index ] = 2 * num_of_points_ + variable_index + 1 ; <nl> + + nz_index ; <nl> <nl> + + constraint_index ; <nl> bool LateralTrajectoryOptimizerInterface : : eval_jac_g ( int n , const double * x , <nl> + + variable_index ) { <nl> / / d_i ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = n + variable_index ; <nl> + jCol [ nz_index ] = num_of_points_ + variable_index ; <nl> + + nz_index ; <nl> / / d_i + 1 ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = n + variable_index + 1 ; <nl> + jCol [ nz_index ] = num_of_points_ + variable_index + 1 ; <nl> + + nz_index ; <nl> / / d_i ' ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = 2 * n + variable_index ; <nl> + jCol [ nz_index ] = 2 * num_of_points_ + variable_index ; <nl> + + nz_index ; <nl> / / d_i + 1 ' ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = 2 * n + variable_index + 1 ; <nl> + jCol [ nz_index ] = 2 * num_of_points_ + variable_index + 1 ; <nl> + + nz_index ; <nl> <nl> + + constraint_index ; <nl> bool LateralTrajectoryOptimizerInterface : : eval_jac_g ( int n , const double * x , <nl> + + nz_index ; <nl> / / d_i ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = n + variable_index ; <nl> + jCol [ nz_index ] = num_of_points_ + variable_index ; <nl> + + nz_index ; <nl> / / d_i ' ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = 2 * n + variable_index ; <nl> + jCol [ nz_index ] = 2 * num_of_points_ + variable_index ; <nl> + + nz_index ; <nl> / / d_i + 1 ' ' <nl> iRow [ nz_index ] = constraint_index ; <nl> - jCol [ nz_index ] = 2 * n + variable_index + 1 ; <nl> + jCol [ nz_index ] = 2 * num_of_points_ + variable_index + 1 ; <nl> + + nz_index ; <nl> <nl> + + constraint_index ; <nl>
Planning : fix a typo of num of point in lat optimizer interface
ApolloAuto/apollo
8045815fdfd9bda9b387c0eb6530975344059c74
2018-07-24T21:29:54Z
mmm a / wrapper / xgboost . py <nl> ppp b / wrapper / xgboost . py <nl> def __init__ ( self , max_depth = 3 , learning_rate = 0 . 1 , n_estimators = 100 , silent = True <nl> base_score , seed ) <nl> <nl> def fit ( self , X , y , sample_weight = None ) : <nl> - y_values = list ( np . unique ( y ) ) <nl> - self . n_classes_ = len ( y_values ) <nl> + self . classes_ = list ( np . unique ( y ) ) <nl> + self . n_classes_ = len ( self . classes_ ) <nl> if self . n_classes_ > 2 : <nl> # Switch to using a multiclass objective in the underlying XGB instance <nl> self . objective = " multi : softprob " <nl>
Added classes_ attribute to scikit - learn wrapper .
dmlc/xgboost
4e080928a8b6d62e57f5a08e7637790f26b76ace
2015-05-16T01:19:39Z
mmm a / modules / core / src / system . cpp <nl> ppp b / modules / core / src / system . cpp <nl> struct HWFeatures <nl> <nl> static inline bool isSymbolSeparator ( char c ) <nl> { <nl> - return c = = ' , ' | | c = = ' ; ' | | c = = ' - ' ; <nl> + return c = = ' , ' | | c = = ' ; ' ; <nl> } <nl> <nl> void readSettings ( const int * baseline_features , int baseline_count ) <nl>
Merge pull request from alalek : fix_cpu_disable_flags
opencv/opencv
7da6e9086c076cd4f08b8caf88bd566badea4842
2018-02-19T14:11:11Z
mmm a / TODO <nl> ppp b / TODO <nl> LANGUAGES UPDATED : <nl> - Romanian * OK * <nl> - Bulgarian * OK * <nl> <nl> - beta7 - > rc1 changelog : <nl> - - BUGFIX : Fixed overflow in ratio <nl> - - BUGFIX : Added - DNDEBUG flag to fix compilation with libtorrent svn <nl> - - BUGFIX : Added a - DQT_NO_DEBUG_OUTPUT flag in debug mode to fix a bug in Qt4 . 3 . x <nl> - - I18N : Updated most translations <nl> - - COSMETIC : foreground text now uses style ' s foreground color instead of hard - coded black . <nl> + rc1 - > rc2 changelog : <nl> + - BUGFIX : Fixed a unsupported character in man page <nl> Binary files a / doc / qbittorrent . 1 . gz and b / doc / qbittorrent . 1 . gz differ <nl>
- BUGFIX : Fixed a unsupported character in man page
qbittorrent/qBittorrent
42cacabccdcb50e9b5aa244826a8e249ac9f33c6
2007-09-26T18:32:17Z
mmm a / dlib / test / dnn . cpp <nl> ppp b / dlib / test / dnn . cpp <nl> namespace <nl> } <nl> { <nl> print_spinner ( ) ; <nl> - fc_ < 5 , FC_NO_BIAS > l ; <nl> + fc_ < 4 , FC_NO_BIAS > l ; <nl> DLIB_TEST_MSG ( test_layer ( l ) , test_layer ( l ) ) ; <nl> } <nl> { <nl>
Made test less likely to false alarm .
davisking/dlib
08c8778479a4002134d31ce71bacca12444146d2
2016-05-04T01:44:39Z
similarity index 100 % <nl> rename from samples / TestCpp / . cproject <nl> rename to samples / test - cpp / . cproject <nl> similarity index 100 % <nl> rename from samples / TestCpp / . externalToolBuilders / Javah_jni_builder . launch <nl> rename to samples / test - cpp / . externalToolBuilders / Javah_jni_builder . launch <nl> similarity index 100 % <nl> rename from samples / TestCpp / Android . mk <nl> rename to samples / test - cpp / Android . mk <nl> similarity index 100 % <nl> rename from samples / TestCpp / CMakeLists . txt <nl> rename to samples / test - cpp / CMakeLists . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / AccelerometerTest / AccelerometerTest . cpp <nl> rename to samples / test - cpp / Classes / AccelerometerTest / AccelerometerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / AccelerometerTest / AccelerometerTest . h <nl> rename to samples / test - cpp / Classes / AccelerometerTest / AccelerometerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionManagerTest / ActionManagerTest . cpp <nl> rename to samples / test - cpp / Classes / ActionManagerTest / ActionManagerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionManagerTest / ActionManagerTest . h <nl> rename to samples / test - cpp / Classes / ActionManagerTest / ActionManagerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionsEaseTest / ActionsEaseTest . cpp <nl> rename to samples / test - cpp / Classes / ActionsEaseTest / ActionsEaseTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionsEaseTest / ActionsEaseTest . h <nl> rename to samples / test - cpp / Classes / ActionsEaseTest / ActionsEaseTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionsProgressTest / ActionsProgressTest . cpp <nl> rename to samples / test - cpp / Classes / ActionsProgressTest / ActionsProgressTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionsProgressTest / ActionsProgressTest . h <nl> rename to samples / test - cpp / Classes / ActionsProgressTest / ActionsProgressTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionsTest / ActionsTest . cpp <nl> rename to samples / test - cpp / Classes / ActionsTest / ActionsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ActionsTest / ActionsTest . h <nl> rename to samples / test - cpp / Classes / ActionsTest / ActionsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / AppDelegate . cpp <nl> rename to samples / test - cpp / Classes / AppDelegate . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / AppDelegate . h <nl> rename to samples / test - cpp / Classes / AppDelegate . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BaseTest . cpp <nl> rename to samples / test - cpp / Classes / BaseTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BaseTest . h <nl> rename to samples / test - cpp / Classes / BaseTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTest / Box2dTest . cpp <nl> rename to samples / test - cpp / Classes / Box2DTest / Box2dTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTest / Box2dTest . h <nl> rename to samples / test - cpp / Classes / Box2DTest / Box2dTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Box2dView . cpp <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Box2dView . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Box2dView . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Box2dView . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / GLES - Render . cpp <nl> rename to samples / test - cpp / Classes / Box2DTestBed / GLES - Render . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / GLES - Render . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / GLES - Render . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Test . cpp <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Test . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Test . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Test . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / TestEntries . cpp <nl> rename to samples / test - cpp / Classes / Box2DTestBed / TestEntries . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / AddPair . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / AddPair . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / ApplyForce . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / ApplyForce . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / BodyTypes . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / BodyTypes . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Breakable . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Breakable . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Bridge . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Bridge . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / BulletTest . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / BulletTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Cantilever . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Cantilever . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Car . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Car . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Chain . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Chain . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / CharacterCollision . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / CharacterCollision . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / CollisionFiltering . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / CollisionFiltering . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / CollisionProcessing . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / CollisionProcessing . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / CompoundShapes . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / CompoundShapes . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Confined . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Confined . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / ContinuousTest . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / ContinuousTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / ConvexHull . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / ConvexHull . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / ConveyorBelt . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / ConveyorBelt . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / DistanceTest . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / DistanceTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Dominos . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Dominos . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / DumpShell . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / DumpShell . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / DynamicTreeTest . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / DynamicTreeTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / EdgeShapes . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / EdgeShapes . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / EdgeTest . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / EdgeTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Gears . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Gears . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Mobile . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Mobile . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / MobileBalanced . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / MobileBalanced . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / MotorJoint . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / MotorJoint . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / OneSidedPlatform . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / OneSidedPlatform . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Pinball . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Pinball . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / PolyCollision . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / PolyCollision . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / PolyShapes . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / PolyShapes . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Prismatic . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Prismatic . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Pulleys . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Pulleys . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Pyramid . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Pyramid . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / RayCast . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / RayCast . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Revolute . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Revolute . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Rope . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Rope . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / RopeJoint . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / RopeJoint . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / SensorTest . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / SensorTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / ShapeEditing . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / ShapeEditing . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / SliderCrank . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / SliderCrank . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / SphereStack . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / SphereStack . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / TheoJansen . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / TheoJansen . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Tiles . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Tiles . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / TimeOfImpact . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / TimeOfImpact . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Tumbler . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Tumbler . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / VaryingFriction . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / VaryingFriction . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / VaryingRestitution . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / VaryingRestitution . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / VerticalStack . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / VerticalStack . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Box2DTestBed / Tests / Web . h <nl> rename to samples / test - cpp / Classes / Box2DTestBed / Tests / Web . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 1159 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 1159 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 1159 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 1159 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 1174 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 1174 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 1174 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 1174 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 350 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 350 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 350 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 350 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 422 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 422 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 422 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 422 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 458 / Bug - 458 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 458 / Bug - 458 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 458 / Bug - 458 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 458 / Bug - 458 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 458 / QuestionContainerSprite . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 458 / QuestionContainerSprite . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 458 / QuestionContainerSprite . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 458 / QuestionContainerSprite . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 624 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 624 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 624 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 624 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 886 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 886 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 886 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 886 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 899 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 899 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 899 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 899 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 914 . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 914 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / Bug - 914 . h <nl> rename to samples / test - cpp / Classes / BugsTest / Bug - 914 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / BugsTest . cpp <nl> rename to samples / test - cpp / Classes / BugsTest / BugsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / BugsTest / BugsTest . h <nl> rename to samples / test - cpp / Classes / BugsTest / BugsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ChipmunkTest / ChipmunkTest . cpp <nl> rename to samples / test - cpp / Classes / ChipmunkTest / ChipmunkTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ChipmunkTest / ChipmunkTest . h <nl> rename to samples / test - cpp / Classes / ChipmunkTest / ChipmunkTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ClickAndMoveTest / ClickAndMoveTest . cpp <nl> rename to samples / test - cpp / Classes / ClickAndMoveTest / ClickAndMoveTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ClickAndMoveTest / ClickAndMoveTest . h <nl> rename to samples / test - cpp / Classes / ClickAndMoveTest / ClickAndMoveTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ClippingNodeTest / ClippingNodeTest . cpp <nl> rename to samples / test - cpp / Classes / ClippingNodeTest / ClippingNodeTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ClippingNodeTest / ClippingNodeTest . h <nl> rename to samples / test - cpp / Classes / ClippingNodeTest / ClippingNodeTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / CocosDenshionTest / CocosDenshionTest . cpp <nl> rename to samples / test - cpp / Classes / CocosDenshionTest / CocosDenshionTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / CocosDenshionTest / CocosDenshionTest . h <nl> rename to samples / test - cpp / Classes / CocosDenshionTest / CocosDenshionTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ConfigurationTest / ConfigurationTest . cpp <nl> rename to samples / test - cpp / Classes / ConfigurationTest / ConfigurationTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ConfigurationTest / ConfigurationTest . h <nl> rename to samples / test - cpp / Classes / ConfigurationTest / ConfigurationTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ConsoleTest / ConsoleTest . cpp <nl> rename to samples / test - cpp / Classes / ConsoleTest / ConsoleTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ConsoleTest / ConsoleTest . h <nl> rename to samples / test - cpp / Classes / ConsoleTest / ConsoleTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / CurlTest / CurlTest . cpp <nl> rename to samples / test - cpp / Classes / CurlTest / CurlTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / CurlTest / CurlTest . h <nl> rename to samples / test - cpp / Classes / CurlTest / CurlTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / CurrentLanguageTest / CurrentLanguageTest . cpp <nl> rename to samples / test - cpp / Classes / CurrentLanguageTest / CurrentLanguageTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / CurrentLanguageTest / CurrentLanguageTest . h <nl> rename to samples / test - cpp / Classes / CurrentLanguageTest / CurrentLanguageTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / DataVisitorTest / DataVisitorTest . cpp <nl> rename to samples / test - cpp / Classes / DataVisitorTest / DataVisitorTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / DataVisitorTest / DataVisitorTest . h <nl> rename to samples / test - cpp / Classes / DataVisitorTest / DataVisitorTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / DrawPrimitivesTest / DrawPrimitivesTest . cpp <nl> rename to samples / test - cpp / Classes / DrawPrimitivesTest / DrawPrimitivesTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / DrawPrimitivesTest / DrawPrimitivesTest . h <nl> rename to samples / test - cpp / Classes / DrawPrimitivesTest / DrawPrimitivesTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / EffectsAdvancedTest / EffectsAdvancedTest . cpp <nl> rename to samples / test - cpp / Classes / EffectsAdvancedTest / EffectsAdvancedTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / EffectsAdvancedTest / EffectsAdvancedTest . h <nl> rename to samples / test - cpp / Classes / EffectsAdvancedTest / EffectsAdvancedTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / EffectsTest / EffectsTest . cpp <nl> rename to samples / test - cpp / Classes / EffectsTest / EffectsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / EffectsTest / EffectsTest . h <nl> rename to samples / test - cpp / Classes / EffectsTest / EffectsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioArmatureTest / ArmatureScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioArmatureTest / ArmatureScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioArmatureTest / ArmatureScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioArmatureTest / ArmatureScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ComponentsTestScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ComponentsTestScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ComponentsTestScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ComponentsTestScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / EnemyController . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / EnemyController . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / EnemyController . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / EnemyController . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / GameOverScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / GameOverScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / GameOverScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / GameOverScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / PlayerController . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / PlayerController . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / PlayerController . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / PlayerController . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ProjectileController . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ProjectileController . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ProjectileController . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / ProjectileController . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / SceneController . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / SceneController . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioComponentsTest / SceneController . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioComponentsTest / SceneController . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / CocosGUIScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / CocosGUIScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / CocosGUIScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / CocosGUIScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIButtonTest / UIButtonTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIButtonTest / UIButtonTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIButtonTest / UIButtonTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIButtonTest / UIButtonTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UICheckBoxTest / UICheckBoxTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIImageViewTest / UIImageViewTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIImageViewTest / UIImageViewTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIImageViewTest / UIImageViewTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIImageViewTest / UIImageViewTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelAtlasTest / UILabelAtlasTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelAtlasTest / UILabelAtlasTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelAtlasTest / UILabelAtlasTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelAtlasTest / UILabelAtlasTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelBMFontTest / UILabelBMFontTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelBMFontTest / UILabelBMFontTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelBMFontTest / UILabelBMFontTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelBMFontTest / UILabelBMFontTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelTest / UILabelTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelTest / UILabelTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelTest / UILabelTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILabelTest / UILabelTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILayoutTest / UILayoutTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILayoutTest / UILayoutTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILayoutTest / UILayoutTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILayoutTest / UILayoutTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIListViewTest / UIListViewTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIListViewTest / UIListViewTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIListViewTest / UIListViewTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIListViewTest / UIListViewTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILoadingBarTest / UILoadingBarTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILoadingBarTest / UILoadingBarTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UILoadingBarTest / UILoadingBarTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UILoadingBarTest / UILoadingBarTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIPageViewTest / UIPageViewTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIPageViewTest / UIPageViewTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIPageViewTest / UIPageViewTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIPageViewTest / UIPageViewTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UISceneManager . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UISceneManager . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UISceneManager . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UISceneManager . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScrollViewTest / UIScrollViewTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScrollViewTest / UIScrollViewTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScrollViewTest / UIScrollViewTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIScrollViewTest / UIScrollViewTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UISliderTest / UISliderTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UISliderTest / UISliderTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UISliderTest / UISliderTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UISliderTest / UISliderTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UITextFieldTest / UITextFieldTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UITextFieldTest / UITextFieldTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UITextFieldTest / UITextFieldTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UITextFieldTest / UITextFieldTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIWidgetAddNodeTest / UIWidgetAddNodeTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIWidgetAddNodeTest / UIWidgetAddNodeTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioGUITest / UIWidgetAddNodeTest / UIWidgetAddNodeTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioGUITest / UIWidgetAddNodeTest / UIWidgetAddNodeTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / SceneEditorTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / SceneEditorTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / SceneEditorTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / SceneEditorTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / EventDef . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / EventDef . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / acts . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / acts . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / acts . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / acts . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / cons . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / cons . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / cons . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocoStudioSceneTest / TriggerCode / cons . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / AnimationsTest / AnimationsLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / AnimationsTest / AnimationsLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / AnimationsTest / AnimationsTestLayer . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / AnimationsTest / AnimationsTestLayer . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / AnimationsTest / AnimationsTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / AnimationsTest / AnimationsTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ButtonTest / ButtonTestLayer . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ButtonTest / ButtonTestLayer . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ButtonTest / ButtonTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ButtonTest / ButtonTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ButtonTest / ButtonTestLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ButtonTest / ButtonTestLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / CocosBuilderTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / CocosBuilderTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / CocosBuilderTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / CocosBuilderTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / HelloCocosBuilder / HelloCocosBuilderLayer . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / HelloCocosBuilder / HelloCocosBuilderLayer . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / HelloCocosBuilder / HelloCocosBuilderLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / HelloCocosBuilder / HelloCocosBuilderLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / HelloCocosBuilder / HelloCocosBuilderLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / HelloCocosBuilder / HelloCocosBuilderLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / LabelTest / LabelTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / LabelTest / LabelTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / LabelTest / LabelTestLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / LabelTest / LabelTestLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / MenuTest / MenuTestLayer . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / MenuTest / MenuTestLayer . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / MenuTest / MenuTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / MenuTest / MenuTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / MenuTest / MenuTestLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / MenuTest / MenuTestLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ParticleSystemTest / ParticleSystemTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ParticleSystemTest / ParticleSystemTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ParticleSystemTest / ParticleSystemTestLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ParticleSystemTest / ParticleSystemTestLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ScrollViewTest / ScrollViewTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ScrollViewTest / ScrollViewTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / ScrollViewTest / ScrollViewTestLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / ScrollViewTest / ScrollViewTestLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / SpriteTest / SpriteTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / SpriteTest / SpriteTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / SpriteTest / SpriteTestLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / SpriteTest / SpriteTestLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / TestHeader / TestHeaderLayer . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / TestHeader / TestHeaderLayer . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / TestHeader / TestHeaderLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / TestHeader / TestHeaderLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / TestHeader / TestHeaderLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / TestHeader / TestHeaderLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / TimelineCallbackTest / TimelineCallbackLayerLoader . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / TimelineCallbackTest / TimelineCallbackLayerLoader . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / TimelineCallbackTest / TimelineCallbackTestLayer . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / TimelineCallbackTest / TimelineCallbackTestLayer . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / CocosBuilderTest / TimelineCallbackTest / TimelineCallbackTestLayer . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / CocosBuilderTest / TimelineCallbackTest / TimelineCallbackTestLayer . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlButtonTest / CCControlButtonTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlButtonTest / CCControlButtonTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlButtonTest / CCControlButtonTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlButtonTest / CCControlButtonTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlColourPicker / CCControlColourPickerTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlColourPicker / CCControlColourPickerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlColourPicker / CCControlColourPickerTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlColourPicker / CCControlColourPickerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlPotentiometerTest / CCControlPotentiometerTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlPotentiometerTest / CCControlPotentiometerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlPotentiometerTest / CCControlPotentiometerTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlPotentiometerTest / CCControlPotentiometerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSceneManager . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSceneManager . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSceneManager . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSceneManager . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSliderTest / CCControlSliderTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSliderTest / CCControlSliderTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSliderTest / CCControlSliderTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSliderTest / CCControlSliderTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlStepperTest / CCControlStepperTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlStepperTest / CCControlStepperTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlStepperTest / CCControlStepperTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlStepperTest / CCControlStepperTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSwitchTest / CCControlSwitchTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSwitchTest / CCControlSwitchTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSwitchTest / CCControlSwitchTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ControlExtensionTest / CCControlSwitchTest / CCControlSwitchTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / EditBoxTest / EditBoxTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / EditBoxTest / EditBoxTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / EditBoxTest / EditBoxTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / EditBoxTest / EditBoxTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ExtensionsTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ExtensionsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / ExtensionsTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / ExtensionsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NetworkTest / HttpClientTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NetworkTest / HttpClientTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NetworkTest / HttpClientTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NetworkTest / HttpClientTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NetworkTest / SocketIOTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NetworkTest / SocketIOTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NetworkTest / SocketIOTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NetworkTest / SocketIOTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NetworkTest / WebSocketTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NetworkTest / WebSocketTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NetworkTest / WebSocketTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NetworkTest / WebSocketTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NotificationCenterTest / NotificationCenterTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NotificationCenterTest / NotificationCenterTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / NotificationCenterTest / NotificationCenterTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / NotificationCenterTest / NotificationCenterTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / Scale9SpriteTest / Scale9SpriteTest . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / Scale9SpriteTest / Scale9SpriteTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / Scale9SpriteTest / Scale9SpriteTest . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / Scale9SpriteTest / Scale9SpriteTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / TableViewTest / CustomTableViewCell . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / TableViewTest / CustomTableViewCell . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / TableViewTest / CustomTableViewCell . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / TableViewTest / CustomTableViewCell . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / TableViewTest / TableViewTestScene . cpp <nl> rename to samples / test - cpp / Classes / ExtensionsTest / TableViewTest / TableViewTestScene . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ExtensionsTest / TableViewTest / TableViewTestScene . h <nl> rename to samples / test - cpp / Classes / ExtensionsTest / TableViewTest / TableViewTestScene . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / FileUtilsTest / FileUtilsTest . cpp <nl> rename to samples / test - cpp / Classes / FileUtilsTest / FileUtilsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / FileUtilsTest / FileUtilsTest . h <nl> rename to samples / test - cpp / Classes / FileUtilsTest / FileUtilsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / FontTest / FontTest . cpp <nl> rename to samples / test - cpp / Classes / FontTest / FontTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / FontTest / FontTest . h <nl> rename to samples / test - cpp / Classes / FontTest / FontTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / InputTest / MouseTest . cpp <nl> rename to samples / test - cpp / Classes / InputTest / MouseTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / InputTest / MouseTest . h <nl> rename to samples / test - cpp / Classes / InputTest / MouseTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / IntervalTest / IntervalTest . cpp <nl> rename to samples / test - cpp / Classes / IntervalTest / IntervalTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / IntervalTest / IntervalTest . h <nl> rename to samples / test - cpp / Classes / IntervalTest / IntervalTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / KeyboardTest / KeyboardTest . cpp <nl> rename to samples / test - cpp / Classes / KeyboardTest / KeyboardTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / KeyboardTest / KeyboardTest . h <nl> rename to samples / test - cpp / Classes / KeyboardTest / KeyboardTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / KeypadTest / KeypadTest . cpp <nl> rename to samples / test - cpp / Classes / KeypadTest / KeypadTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / KeypadTest / KeypadTest . h <nl> rename to samples / test - cpp / Classes / KeypadTest / KeypadTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / LabelTest / LabelTest . cpp <nl> rename to samples / test - cpp / Classes / LabelTest / LabelTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / LabelTest / LabelTest . h <nl> rename to samples / test - cpp / Classes / LabelTest / LabelTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / LabelTest / LabelTestNew . cpp <nl> rename to samples / test - cpp / Classes / LabelTest / LabelTestNew . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / LabelTest / LabelTestNew . h <nl> rename to samples / test - cpp / Classes / LabelTest / LabelTestNew . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / LayerTest / LayerTest . cpp <nl> rename to samples / test - cpp / Classes / LayerTest / LayerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / LayerTest / LayerTest . h <nl> rename to samples / test - cpp / Classes / LayerTest / LayerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / MenuTest / MenuTest . cpp <nl> rename to samples / test - cpp / Classes / MenuTest / MenuTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / MenuTest / MenuTest . h <nl> rename to samples / test - cpp / Classes / MenuTest / MenuTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / MotionStreakTest / MotionStreakTest . cpp <nl> rename to samples / test - cpp / Classes / MotionStreakTest / MotionStreakTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / MotionStreakTest / MotionStreakTest . h <nl> rename to samples / test - cpp / Classes / MotionStreakTest / MotionStreakTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / MutiTouchTest / MutiTouchTest . cpp <nl> rename to samples / test - cpp / Classes / MutiTouchTest / MutiTouchTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / MutiTouchTest / MutiTouchTest . h <nl> rename to samples / test - cpp / Classes / MutiTouchTest / MutiTouchTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / NewEventDispatcherTest / NewEventDispatcherTest . cpp <nl> rename to samples / test - cpp / Classes / NewEventDispatcherTest / NewEventDispatcherTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / NewEventDispatcherTest / NewEventDispatcherTest . h <nl> rename to samples / test - cpp / Classes / NewEventDispatcherTest / NewEventDispatcherTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / NewRendererTest / NewRendererTest . cpp <nl> rename to samples / test - cpp / Classes / NewRendererTest / NewRendererTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / NewRendererTest / NewRendererTest . h <nl> rename to samples / test - cpp / Classes / NewRendererTest / NewRendererTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / NodeTest / NodeTest . cpp <nl> rename to samples / test - cpp / Classes / NodeTest / NodeTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / NodeTest / NodeTest . h <nl> rename to samples / test - cpp / Classes / NodeTest / NodeTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ParallaxTest / ParallaxTest . cpp <nl> rename to samples / test - cpp / Classes / ParallaxTest / ParallaxTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ParallaxTest / ParallaxTest . h <nl> rename to samples / test - cpp / Classes / ParallaxTest / ParallaxTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ParticleTest / ParticleTest . cpp <nl> rename to samples / test - cpp / Classes / ParticleTest / ParticleTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ParticleTest / ParticleTest . h <nl> rename to samples / test - cpp / Classes / ParticleTest / ParticleTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceAllocTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceAllocTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceAllocTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceAllocTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceContainerTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceContainerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceContainerTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceContainerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceEventDispatcherTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceEventDispatcherTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceEventDispatcherTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceEventDispatcherTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceLabelTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceLabelTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceLabelTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceLabelTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceNodeChildrenTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceNodeChildrenTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceNodeChildrenTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceNodeChildrenTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceParticleTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceParticleTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceParticleTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceParticleTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceRendererTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceRendererTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceRendererTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceRendererTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceSpriteTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceSpriteTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceSpriteTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceSpriteTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceTextureTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceTextureTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceTextureTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceTextureTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceTouchesTest . cpp <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceTouchesTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PerformanceTest / PerformanceTouchesTest . h <nl> rename to samples / test - cpp / Classes / PerformanceTest / PerformanceTouchesTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PhysicsTest / PhysicsTest . cpp <nl> rename to samples / test - cpp / Classes / PhysicsTest / PhysicsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / PhysicsTest / PhysicsTest . h <nl> rename to samples / test - cpp / Classes / PhysicsTest / PhysicsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ReleasePoolTest / ReleasePoolTest . cpp <nl> rename to samples / test - cpp / Classes / ReleasePoolTest / ReleasePoolTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ReleasePoolTest / ReleasePoolTest . h <nl> rename to samples / test - cpp / Classes / ReleasePoolTest / ReleasePoolTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / RenderTextureTest / RenderTextureTest . cpp <nl> rename to samples / test - cpp / Classes / RenderTextureTest / RenderTextureTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / RenderTextureTest / RenderTextureTest . h <nl> rename to samples / test - cpp / Classes / RenderTextureTest / RenderTextureTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / RotateWorldTest / RotateWorldTest . cpp <nl> rename to samples / test - cpp / Classes / RotateWorldTest / RotateWorldTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / RotateWorldTest / RotateWorldTest . h <nl> rename to samples / test - cpp / Classes / RotateWorldTest / RotateWorldTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SceneTest / SceneTest . cpp <nl> rename to samples / test - cpp / Classes / SceneTest / SceneTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SceneTest / SceneTest . h <nl> rename to samples / test - cpp / Classes / SceneTest / SceneTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SchedulerTest / SchedulerTest . cpp <nl> rename to samples / test - cpp / Classes / SchedulerTest / SchedulerTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SchedulerTest / SchedulerTest . h <nl> rename to samples / test - cpp / Classes / SchedulerTest / SchedulerTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ShaderTest / ShaderTest . cpp <nl> rename to samples / test - cpp / Classes / ShaderTest / ShaderTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ShaderTest / ShaderTest . h <nl> rename to samples / test - cpp / Classes / ShaderTest / ShaderTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ShaderTest / ShaderTest2 . cpp <nl> rename to samples / test - cpp / Classes / ShaderTest / ShaderTest2 . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ShaderTest / ShaderTest2 . h <nl> rename to samples / test - cpp / Classes / ShaderTest / ShaderTest2 . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SpineTest / SpineTest . cpp <nl> rename to samples / test - cpp / Classes / SpineTest / SpineTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SpineTest / SpineTest . h <nl> rename to samples / test - cpp / Classes / SpineTest / SpineTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SpriteTest / SpriteTest . cpp . REMOVED . git - id <nl> rename to samples / test - cpp / Classes / SpriteTest / SpriteTest . cpp . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / SpriteTest / SpriteTest . h <nl> rename to samples / test - cpp / Classes / SpriteTest / SpriteTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TextInputTest / TextInputTest . cpp <nl> rename to samples / test - cpp / Classes / TextInputTest / TextInputTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TextInputTest / TextInputTest . h <nl> rename to samples / test - cpp / Classes / TextInputTest / TextInputTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Texture2dTest / Texture2dTest . cpp <nl> rename to samples / test - cpp / Classes / Texture2dTest / Texture2dTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / Texture2dTest / Texture2dTest . h <nl> rename to samples / test - cpp / Classes / Texture2dTest / Texture2dTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TextureCacheTest / TextureCacheTest . cpp <nl> rename to samples / test - cpp / Classes / TextureCacheTest / TextureCacheTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TextureCacheTest / TextureCacheTest . h <nl> rename to samples / test - cpp / Classes / TextureCacheTest / TextureCacheTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TexturePackerEncryptionTest / TextureAtlasEncryptionTest . cpp <nl> rename to samples / test - cpp / Classes / TexturePackerEncryptionTest / TextureAtlasEncryptionTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TexturePackerEncryptionTest / TextureAtlasEncryptionTest . h <nl> rename to samples / test - cpp / Classes / TexturePackerEncryptionTest / TextureAtlasEncryptionTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TileMapTest / TileMapTest . cpp <nl> rename to samples / test - cpp / Classes / TileMapTest / TileMapTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TileMapTest / TileMapTest . h <nl> rename to samples / test - cpp / Classes / TileMapTest / TileMapTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TouchesTest / Ball . cpp <nl> rename to samples / test - cpp / Classes / TouchesTest / Ball . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TouchesTest / Ball . h <nl> rename to samples / test - cpp / Classes / TouchesTest / Ball . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TouchesTest / Paddle . cpp <nl> rename to samples / test - cpp / Classes / TouchesTest / Paddle . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TouchesTest / Paddle . h <nl> rename to samples / test - cpp / Classes / TouchesTest / Paddle . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TouchesTest / TouchesTest . cpp <nl> rename to samples / test - cpp / Classes / TouchesTest / TouchesTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TouchesTest / TouchesTest . h <nl> rename to samples / test - cpp / Classes / TouchesTest / TouchesTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TransitionsTest / TransitionsTest . cpp <nl> rename to samples / test - cpp / Classes / TransitionsTest / TransitionsTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / TransitionsTest / TransitionsTest . h <nl> rename to samples / test - cpp / Classes / TransitionsTest / TransitionsTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / UnitTest / UnitTest . cpp <nl> rename to samples / test - cpp / Classes / UnitTest / UnitTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / UnitTest / UnitTest . h <nl> rename to samples / test - cpp / Classes / UnitTest / UnitTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / UserDefaultTest / UserDefaultTest . cpp <nl> rename to samples / test - cpp / Classes / UserDefaultTest / UserDefaultTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / UserDefaultTest / UserDefaultTest . h <nl> rename to samples / test - cpp / Classes / UserDefaultTest / UserDefaultTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / VisibleRect . cpp <nl> rename to samples / test - cpp / Classes / VisibleRect . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / VisibleRect . h <nl> rename to samples / test - cpp / Classes / VisibleRect . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ZwoptexTest / ZwoptexTest . cpp <nl> rename to samples / test - cpp / Classes / ZwoptexTest / ZwoptexTest . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / ZwoptexTest / ZwoptexTest . h <nl> rename to samples / test - cpp / Classes / ZwoptexTest / ZwoptexTest . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / controller . cpp <nl> rename to samples / test - cpp / Classes / controller . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / controller . h <nl> rename to samples / test - cpp / Classes / controller . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / testBasic . cpp <nl> rename to samples / test - cpp / Classes / testBasic . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / testBasic . h <nl> rename to samples / test - cpp / Classes / testBasic . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / testResource . h <nl> rename to samples / test - cpp / Classes / testResource . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Classes / tests . h <nl> rename to samples / test - cpp / Classes / tests . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / . gitignore <nl> rename to samples / test - cpp / Resources / . gitignore <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Hello . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Hello . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / HelloWorld . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / HelloWorld . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / PlanetCute - 1024x1024 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / PlanetCute - 1024x1024 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / atlastest . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / atlastest . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / background1 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / background1 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / background2 . jpg . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / background2 . jpg . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / background2 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / background2 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / bugs / bug886 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / bugs / bug886 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / grossini_dance_atlas - mono . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / grossini_dance_atlas - mono . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / landscape - 1024x1024 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / landscape - 1024x1024 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / noise . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / noise . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / spritesheet1 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / spritesheet1 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / stone . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / stone . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_a8 . pvr . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_a8 . pvr . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_rgb888 . pvr . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_rgb888 . pvr . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_rgb888 . pvr . gz . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_rgb888 . pvr . gz . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_rgba4444 . pvr . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_rgba4444 . pvr . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_rgba4444 . pvr . gz . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_rgba4444 . pvr . gz . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_rgba8888 . pvr . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_rgba8888 . pvr . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Images / test_1021x1024_rgba8888 . pvr . gz . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / Images / test_1021x1024_rgba8888 . pvr . gz . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - hd / test4 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - hd / test4 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - ipad / test2 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - ipad / test2 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - ipadhd / test1 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - ipadhd / test1 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - iphone / test6 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - iphone / test6 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - mac / test2 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - mac / test2 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - machd / test1 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - machd / test1 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - wide / test5 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - wide / test5 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / resources - widehd / test3 . txt <nl> rename to samples / test - cpp / Resources / Misc / resources - widehd / test3 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / searchpath1 / file1 . txt <nl> rename to samples / test - cpp / Resources / Misc / searchpath1 / file1 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Misc / searchpath2 / resources - ipad / file2 . txt <nl> rename to samples / test - cpp / Resources / Misc / searchpath2 / resources - ipad / file2 . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_ColorBars . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_ColorBars . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Flower . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Flower . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Heart . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Heart . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Julia . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Julia . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Mandelbrot . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Mandelbrot . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Monjori . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Monjori . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Plasma . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Plasma . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / Shaders / example_Twist . vsh <nl> rename to samples / test - cpp / Resources / Shaders / example_Twist . vsh <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / TileMaps / hexa - tiles . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / TileMaps / hexa - tiles . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / TileMaps / map / slcj . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / TileMaps / map / slcj . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / TileMaps / ortho - test1 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / TileMaps / ortho - test1 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / TileMaps / ortho - test1_bw . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / TileMaps / ortho - test1_bw . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / animations / grossini . plist . xml <nl> rename to samples / test - cpp / Resources / animations / grossini . plist . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / Cowboy . ExportJson . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / armature / Cowboy . ExportJson . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / Cowboy0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / armature / Cowboy0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / Dragon . xml <nl> rename to samples / test - cpp / Resources / armature / Dragon . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / HeroAnimation . ExportJson . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / armature / HeroAnimation . ExportJson . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / cyborg . xml <nl> rename to samples / test - cpp / Resources / armature / cyborg . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / knight . xml <nl> rename to samples / test - cpp / Resources / armature / knight . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / robot . xml <nl> rename to samples / test - cpp / Resources / armature / robot . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / armature / weapon . xml <nl> rename to samples / test - cpp / Resources / armature / weapon . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / background - music - aac . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / background - music - aac . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / background . mp3 . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / background . mp3 . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / ccb / flower . jpg . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / ccb / flower . jpg . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / ccb / gem - 0 . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / ccb / gem - 0 . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / ccb / gem - 1 . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / ccb / gem - 1 . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / ccb / markerfelt24shadow . fnt . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / ccb / markerfelt24shadow . fnt . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / Hello . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / Hello . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / UITest / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / UITest / background . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / b11 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / b11 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / bitmapFontTest2 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / bitmapFontTest2 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / examples / examples . json . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / examples / examples . json . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / gui_examples / map_1 / map_pve . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / gui_examples / map_1 / map_pve . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / cocosgui / gui_examples / page_1 / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / cocosgui / gui_examples / page_1 / background . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / extensions / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / extensions / background . png . REMOVED . git - id <nl> diff - - git a / samples / TestCpp / Resources / fonts / Courier New . ttf . REMOVED . git - id b / samples / test - cpp / Resources / fonts / Courier New . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / Courier New . ttf . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / Courier New . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / Thonburi . ttf . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / Thonburi . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / ThonburiBold . ttf . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / ThonburiBold . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / arial - 26 - en - ru_0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / arial - 26 - en - ru_0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / arial - unicode - 26 . GlyphProject <nl> rename to samples / test - cpp / Resources / fonts / arial - unicode - 26 . GlyphProject <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / arial - unicode - 26 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / arial - unicode - 26 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / arial . ttf . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / arial . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / bitmapFontChinese . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / bitmapFontChinese . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / bitmapFontTest . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / bitmapFontTest . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / bitmapFontTest2 . bmp . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / bitmapFontTest2 . bmp . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / bitmapFontTest2 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / bitmapFontTest2 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / boundsTestFont . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / boundsTestFont . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / font - issue1343 - hd . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / font - issue1343 - hd . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / futura - 48 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / futura - 48 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / helvetica - geneva - 32 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / helvetica - geneva - 32 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / markerFelt . fnt . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / markerFelt . fnt . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / strings . xml <nl> rename to samples / test - cpp / Resources / fonts / strings . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / tahoma . ttf . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / tahoma . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / fonts / wt021 . ttf . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / fonts / wt021 . ttf . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / Images / background1 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / Images / background1 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / Images / background2 . jpg . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / Images / background2 . jpg . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / Images / background2 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / Images / background2 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / armature / Cowboy0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / armature / Cowboy0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / armature / Dragon . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / armature / Dragon . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / armature / HeroAnimation0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / armature / HeroAnimation0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / armature / weapon . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / armature / weapon . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / ccb / burst . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / ccb / burst . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / Hello . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / Hello . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / UITest / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / UITest / background . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / b11 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / b11 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / bitmapFontTest2 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / bitmapFontTest2 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / examples / examples . json . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / examples / examples . json . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / gui_examples / map_1 / map_pve . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / gui_examples / map_1 / map_pve . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / cocosgui / gui_examples / page_1 / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / cocosgui / gui_examples / page_1 / background . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / extensions / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / extensions / background . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / fonts / font - issue1343 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / fonts / font - issue1343 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / fonts / markerFelt . fnt . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / fonts / markerFelt . fnt . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / fonts / markerFelt . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / fonts / markerFelt . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / fonts / tuffy_bold_italic - charmap . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / fonts / tuffy_bold_italic - charmap . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / ArmatureComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / ArmatureComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / ArmatureComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / ArmatureComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / ArmatureComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / ArmatureComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / BackgroundComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / BackgroundComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / BackgroundComponentTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / BackgroundComponentTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / BackgroundComponentTest / Misc / music_logo . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / BackgroundComponentTest / Misc / music_logo . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / BackgroundComponentTest / startMenu / Fish_UI / starMenuButton01 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / BackgroundComponentTest / startMenu / Fish_UI / starMenuButton01 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / BackgroundComponentTest / startMenu / Fish_UI / starMenuButton02 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / BackgroundComponentTest / startMenu / Fish_UI / starMenuButton02 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / BackgroundComponentTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / BackgroundComponentTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / EffectComponentTest / CowBoy / Cowboy . ExportJson . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / EffectComponentTest / CowBoy / Cowboy . ExportJson . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / EffectComponentTest / CowBoy / Cowboy0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / EffectComponentTest / CowBoy / Cowboy0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / starMenuButton01 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / starMenuButton01 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / starMenuButton02 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / starMenuButton02 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / TriggerTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / TriggerTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / TriggerTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / TriggerTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / TriggerTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / TriggerTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / UIComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / UIComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / UIComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / UIComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / scenetest / UIComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / scenetest / UIComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / spine / goblins . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / spine / goblins . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / hd / spine / spineboy . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / hd / spine / spineboy . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / ipad / ccb / burst . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / ipad / ccb / burst . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / ipad / extensions / background . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / ipad / extensions / background . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / ArmatureComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / ArmatureComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / ArmatureComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / ArmatureComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / ArmatureComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / ArmatureComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / BackgroundComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / BackgroundComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / BackgroundComponentTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / BackgroundComponentTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / BackgroundComponentTest / Misc / music_logo . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / BackgroundComponentTest / Misc / music_logo . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / BackgroundComponentTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / BackgroundComponentTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / EffectComponentTest / CowBoy / Cowboy . ExportJson . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / EffectComponentTest / CowBoy / Cowboy . ExportJson . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / EffectComponentTest / CowBoy / Cowboy0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / EffectComponentTest / CowBoy / Cowboy0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / LoadSceneEdtiorFileTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / LoadSceneEdtiorFileTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . mp3 . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . wav . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / LoadSceneEdtiorFileTest / Misc / music_logo . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / LoadSceneEdtiorFileTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / LoadSceneEdtiorFileTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / LoadSceneEdtiorFileTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / LoadSceneEdtiorFileTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / LoadSceneEdtiorFileTest / startMenu / Fish_UI / ui_logo_001 - hd . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / TriggerTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / TriggerTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / TriggerTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / TriggerTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / TriggerTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / TriggerTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / UIComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / UIComponentTest / Images / startMenuBG . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / UIComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / UIComponentTest / fishes / Butterflyfish / Butterflyfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / scenetest / UIComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / scenetest / UIComponentTest / fishes / blowFish / Blowfish0 . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / Resources / spine / goblins . png . REMOVED . git - id <nl> rename to samples / test - cpp / Resources / spine / goblins . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / . classpath <nl> rename to samples / test - cpp / proj . android / . classpath <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / . externalToolBuilders / Javah_jni_builder . launch <nl> rename to samples / test - cpp / proj . android / . externalToolBuilders / Javah_jni_builder . launch <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / . project <nl> rename to samples / test - cpp / proj . android / . project <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / . settings / org . eclipse . cdt . codan . core . prefs <nl> rename to samples / test - cpp / proj . android / . settings / org . eclipse . cdt . codan . core . prefs <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / AndroidManifest . xml <nl> rename to samples / test - cpp / proj . android / AndroidManifest . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / README . md <nl> rename to samples / test - cpp / proj . android / README . md <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / ant . properties <nl> rename to samples / test - cpp / proj . android / ant . properties <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / build . xml <nl> rename to samples / test - cpp / proj . android / build . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / jni / Android . mk <nl> rename to samples / test - cpp / proj . android / jni / Android . mk <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / jni / Application . mk <nl> rename to samples / test - cpp / proj . android / jni / Application . mk <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / jni / testcpp / main . cpp <nl> rename to samples / test - cpp / proj . android / jni / testcpp / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / ndkgdb . sh <nl> rename to samples / test - cpp / proj . android / ndkgdb . sh <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / proguard - project . txt <nl> rename to samples / test - cpp / proj . android / proguard - project . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / project . properties <nl> rename to samples / test - cpp / proj . android / project . properties <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / res / values / strings . xml <nl> rename to samples / test - cpp / proj . android / res / values / strings . xml <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / src / nojava . txt <nl> rename to samples / test - cpp / proj . android / src / nojava . txt <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . android / src / org / cocos2dx / testcpp / Cocos2dxActivity . java <nl> rename to samples / test - cpp / proj . android / src / org / cocos2dx / testcpp / Cocos2dxActivity . java <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / Classes / RootViewController . h <nl> rename to samples / test - cpp / proj . ios / Classes / RootViewController . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / Classes / RootViewController . mm <nl> rename to samples / test - cpp / proj . ios / Classes / RootViewController . mm <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / Classes / testsAppDelegate . h <nl> rename to samples / test - cpp / proj . ios / Classes / testsAppDelegate . h <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / Classes / testsAppDelegate . mm <nl> rename to samples / test - cpp / proj . ios / Classes / testsAppDelegate . mm <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / Default - 568h @ 2x . png . REMOVED . git - id <nl> rename to samples / test - cpp / proj . ios / Default - 568h @ 2x . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / Default @ 2x . png . REMOVED . git - id <nl> rename to samples / test - cpp / proj . ios / Default @ 2x . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / iphone_Prefix . pch <nl> rename to samples / test - cpp / proj . ios / iphone_Prefix . pch <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . ios / main . m <nl> rename to samples / test - cpp / proj . ios / main . m <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . linux / main . cpp <nl> rename to samples / test - cpp / proj . linux / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . mac / Icon . icns . REMOVED . git - id <nl> rename to samples / test - cpp / proj . mac / Icon . icns . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . mac / Test_Prefix . pch <nl> rename to samples / test - cpp / proj . mac / Test_Prefix . pch <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . mac / en . lproj / InfoPlist . strings <nl> rename to samples / test - cpp / proj . mac / en . lproj / InfoPlist . strings <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . mac / en . lproj / MainMenu . xib <nl> rename to samples / test - cpp / proj . mac / en . lproj / MainMenu . xib <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . mac / main . cpp <nl> rename to samples / test - cpp / proj . mac / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . win32 / TestCpp . vcxproj <nl> rename to samples / test - cpp / proj . win32 / TestCpp . vcxproj <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . win32 / TestCpp . vcxproj . filters <nl> rename to samples / test - cpp / proj . win32 / TestCpp . vcxproj . filters <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . win32 / TestCpp . vcxproj . user <nl> rename to samples / test - cpp / proj . win32 / TestCpp . vcxproj . user <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . win32 / main . cpp <nl> rename to samples / test - cpp / proj . win32 / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestCpp / proj . win32 / main . h <nl> rename to samples / test - cpp / proj . win32 / main . h <nl> similarity index 100 % <nl> rename from samples / TestJavascript / Classes / AppDelegate . cpp <nl> rename to samples / test - javascript / Classes / AppDelegate . cpp <nl> similarity index 100 % <nl> rename from samples / TestJavascript / Classes / AppDelegate . h <nl> rename to samples / test - javascript / Classes / AppDelegate . h <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . classpath <nl> rename to samples / test - javascript / proj . android / . classpath <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . project <nl> rename to samples / test - javascript / proj . android / . project <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . settings / . jsdtscope <nl> rename to samples / test - javascript / proj . android / . settings / . jsdtscope <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . settings / org . eclipse . cdt . codan . core . prefs <nl> rename to samples / test - javascript / proj . android / . settings / org . eclipse . cdt . codan . core . prefs <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . settings / org . eclipse . wst . jsdt . ui . prefs <nl> rename to samples / test - javascript / proj . android / . settings / org . eclipse . wst . jsdt . ui . prefs <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . settings / org . eclipse . wst . jsdt . ui . superType . container <nl> rename to samples / test - javascript / proj . android / . settings / org . eclipse . wst . jsdt . ui . superType . container <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / . settings / org . eclipse . wst . jsdt . ui . superType . name <nl> rename to samples / test - javascript / proj . android / . settings / org . eclipse . wst . jsdt . ui . superType . name <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / AndroidManifest . xml <nl> rename to samples / test - javascript / proj . android / AndroidManifest . xml <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / README . md <nl> rename to samples / test - javascript / proj . android / README . md <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / ant . properties <nl> rename to samples / test - javascript / proj . android / ant . properties <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / build . xml <nl> rename to samples / test - javascript / proj . android / build . xml <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / jni / Android . mk <nl> rename to samples / test - javascript / proj . android / jni / Android . mk <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / jni / Application . mk <nl> rename to samples / test - javascript / proj . android / jni / Application . mk <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / jni / testjavascript / main . cpp <nl> rename to samples / test - javascript / proj . android / jni / testjavascript / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / ndkgdb . sh <nl> rename to samples / test - javascript / proj . android / ndkgdb . sh <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / proguard - project . txt <nl> rename to samples / test - javascript / proj . android / proguard - project . txt <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / project . properties <nl> rename to samples / test - javascript / proj . android / project . properties <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / res / values / strings . xml <nl> rename to samples / test - javascript / proj . android / res / values / strings . xml <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . android / src / org / cocos2dx / testjavascript / Cocos2dxActivity . java <nl> rename to samples / test - javascript / proj . android / src / org / cocos2dx / testjavascript / Cocos2dxActivity . java <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / AppController . h <nl> rename to samples / test - javascript / proj . ios / AppController . h <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / AppController . mm <nl> rename to samples / test - javascript / proj . ios / AppController . mm <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / Default - 568h @ 2x . png . REMOVED . git - id <nl> rename to samples / test - javascript / proj . ios / Default - 568h @ 2x . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / Default @ 2x . png . REMOVED . git - id <nl> rename to samples / test - javascript / proj . ios / Default @ 2x . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / Prefix . pch <nl> rename to samples / test - javascript / proj . ios / Prefix . pch <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / RootViewController . h <nl> rename to samples / test - javascript / proj . ios / RootViewController . h <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / RootViewController . mm <nl> rename to samples / test - javascript / proj . ios / RootViewController . mm <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . ios / main . m <nl> rename to samples / test - javascript / proj . ios / main . m <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . mac / Icon . icns . REMOVED . git - id <nl> rename to samples / test - javascript / proj . mac / Icon . icns . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . mac / Test_Prefix . pch <nl> rename to samples / test - javascript / proj . mac / Test_Prefix . pch <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . mac / en . lproj / InfoPlist . strings <nl> rename to samples / test - javascript / proj . mac / en . lproj / InfoPlist . strings <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . mac / en . lproj / MainMenu . xib <nl> rename to samples / test - javascript / proj . mac / en . lproj / MainMenu . xib <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . mac / main . cpp <nl> rename to samples / test - javascript / proj . mac / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / TestJavascript . vcxproj <nl> rename to samples / test - javascript / proj . win32 / TestJavascript . vcxproj <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / TestJavascript . vcxproj . filters <nl> rename to samples / test - javascript / proj . win32 / TestJavascript . vcxproj . filters <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / TestJavascript . vcxproj . user <nl> rename to samples / test - javascript / proj . win32 / TestJavascript . vcxproj . user <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / main . cpp <nl> rename to samples / test - javascript / proj . win32 / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / main . h <nl> rename to samples / test - javascript / proj . win32 / main . h <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / res / testjs . ico <nl> rename to samples / test - javascript / proj . win32 / res / testjs . ico <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / resource . h <nl> rename to samples / test - javascript / proj . win32 / resource . h <nl> similarity index 100 % <nl> rename from samples / TestJavascript / proj . win32 / testjs . rc <nl> rename to samples / test - javascript / proj . win32 / testjs . rc <nl> similarity index 100 % <nl> rename from samples / TestLua / . gitignore <nl> rename to samples / test - lua / . gitignore <nl> similarity index 100 % <nl> rename from samples / TestLua / CMakeLists . txt <nl> rename to samples / test - lua / CMakeLists . txt <nl> similarity index 100 % <nl> rename from samples / TestLua / Classes / AppDelegate . cpp <nl> rename to samples / test - lua / Classes / AppDelegate . cpp <nl> similarity index 100 % <nl> rename from samples / TestLua / Classes / AppDelegate . h <nl> rename to samples / test - lua / Classes / AppDelegate . h <nl> similarity index 100 % <nl> rename from samples / TestLua / Classes / lua_assetsmanager_test_sample . cpp <nl> rename to samples / test - lua / Classes / lua_assetsmanager_test_sample . cpp <nl> similarity index 100 % <nl> rename from samples / TestLua / Classes / lua_assetsmanager_test_sample . h <nl> rename to samples / test - lua / Classes / lua_assetsmanager_test_sample . h <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / cocosbuilderRes / ccb / flower . jpg . REMOVED . git - id <nl> rename to samples / test - lua / Resources / cocosbuilderRes / ccb / flower . jpg . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / cocosbuilderRes / ccb / gem - 0 . wav . REMOVED . git - id <nl> rename to samples / test - lua / Resources / cocosbuilderRes / ccb / gem - 0 . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / cocosbuilderRes / ccb / gem - 1 . wav . REMOVED . git - id <nl> rename to samples / test - lua / Resources / cocosbuilderRes / ccb / gem - 1 . wav . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / cocosbuilderRes / ccb / markerfelt24shadow . fnt . REMOVED . git - id <nl> rename to samples / test - lua / Resources / cocosbuilderRes / ccb / markerfelt24shadow . fnt . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / AccelerometerTest / AccelerometerTest . lua <nl> rename to samples / test - lua / Resources / luaScript / AccelerometerTest / AccelerometerTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ActionManagerTest / ActionManagerTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ActionManagerTest / ActionManagerTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ActionsEaseTest / ActionsEaseTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ActionsEaseTest / ActionsEaseTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ActionsProgressTest / ActionsProgressTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ActionsProgressTest / ActionsProgressTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ActionsTest / ActionsTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ActionsTest / ActionsTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / AssetsManagerTest / AssetsManagerModule . lua <nl> rename to samples / test - lua / Resources / luaScript / AssetsManagerTest / AssetsManagerModule . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / AssetsManagerTest / AssetsManagerTest . lua <nl> rename to samples / test - lua / Resources / luaScript / AssetsManagerTest / AssetsManagerTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / BugsTest / BugsTest . lua <nl> rename to samples / test - lua / Resources / luaScript / BugsTest / BugsTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ClickAndMoveTest / ClickAndMoveTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ClickAndMoveTest / ClickAndMoveTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioArmatureTest / CocoStudioArmatureTest . lua <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioArmatureTest / CocoStudioArmatureTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioGUITest / CocoStudioGUITest . lua . REMOVED . git - id <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioGUITest / CocoStudioGUITest . lua . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / CocoStudioSceneTest . lua <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / CocoStudioSceneTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / TriggerCode / acts . lua <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / TriggerCode / acts . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / TriggerCode / cons . lua <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / TriggerCode / cons . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / TriggerCode / eventDef . lua <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioSceneTest / TriggerCode / eventDef . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocoStudioTest / CocoStudioTest . lua <nl> rename to samples / test - lua / Resources / luaScript / CocoStudioTest / CocoStudioTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CocosDenshionTest / CocosDenshionTest . lua <nl> rename to samples / test - lua / Resources / luaScript / CocosDenshionTest / CocosDenshionTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / CurrentLanguageTest / CurrentLanguageTest . lua <nl> rename to samples / test - lua / Resources / luaScript / CurrentLanguageTest / CurrentLanguageTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / DrawPrimitivesTest / DrawPrimitivesTest . lua <nl> rename to samples / test - lua / Resources / luaScript / DrawPrimitivesTest / DrawPrimitivesTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / EffectsAdvancedTest / EffectsAdvancedTest . lua <nl> rename to samples / test - lua / Resources / luaScript / EffectsAdvancedTest / EffectsAdvancedTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / EffectsTest / EffectsName . lua <nl> rename to samples / test - lua / Resources / luaScript / EffectsTest / EffectsName . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / EffectsTest / EffectsTest . lua <nl> rename to samples / test - lua / Resources / luaScript / EffectsTest / EffectsTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ExtensionTest / CocosBuilderTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ExtensionTest / CocosBuilderTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ExtensionTest / ExtensionTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ExtensionTest / ExtensionTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ExtensionTest / WebProxyTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ExtensionTest / WebProxyTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / FontTest / FontTest . lua <nl> rename to samples / test - lua / Resources / luaScript / FontTest / FontTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / IntervalTest / IntervalTest . lua <nl> rename to samples / test - lua / Resources / luaScript / IntervalTest / IntervalTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / KeypadTest / KeypadTest . lua <nl> rename to samples / test - lua / Resources / luaScript / KeypadTest / KeypadTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / LabelTest / LabelTest . lua <nl> rename to samples / test - lua / Resources / luaScript / LabelTest / LabelTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / LabelTestNew / LabelTestNew . lua <nl> rename to samples / test - lua / Resources / luaScript / LabelTestNew / LabelTestNew . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / LayerTest / LayerTest . lua <nl> rename to samples / test - lua / Resources / luaScript / LayerTest / LayerTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / LuaBridgeTest / LuaBridgeTest . lua <nl> rename to samples / test - lua / Resources / luaScript / LuaBridgeTest / LuaBridgeTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / MenuTest / MenuTest . lua <nl> rename to samples / test - lua / Resources / luaScript / MenuTest / MenuTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / MotionStreakTest / MotionStreakTest . lua <nl> rename to samples / test - lua / Resources / luaScript / MotionStreakTest / MotionStreakTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / NewEventDispatcherTest / NewEventDispatcherTest . lua <nl> rename to samples / test - lua / Resources / luaScript / NewEventDispatcherTest / NewEventDispatcherTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / NodeTest / NodeTest . lua <nl> rename to samples / test - lua / Resources / luaScript / NodeTest / NodeTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / OpenGLTest / OpenGLTest . lua <nl> rename to samples / test - lua / Resources / luaScript / OpenGLTest / OpenGLTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ParallaxTest / ParallaxTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ParallaxTest / ParallaxTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ParticleTest / ParticleTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ParticleTest / ParticleTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / PerformanceTest / PerformanceSpriteTest . lua <nl> rename to samples / test - lua / Resources / luaScript / PerformanceTest / PerformanceSpriteTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / PerformanceTest / PerformanceTest . lua <nl> rename to samples / test - lua / Resources / luaScript / PerformanceTest / PerformanceTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / PhysicsTest / PhysicsTest . lua <nl> rename to samples / test - lua / Resources / luaScript / PhysicsTest / PhysicsTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / RenderTextureTest / RenderTextureTest . lua <nl> rename to samples / test - lua / Resources / luaScript / RenderTextureTest / RenderTextureTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / RotateWorldTest / RotateWorldTest . lua <nl> rename to samples / test - lua / Resources / luaScript / RotateWorldTest / RotateWorldTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / SceneTest / SceneTest . lua <nl> rename to samples / test - lua / Resources / luaScript / SceneTest / SceneTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / SpineTest / SpineTest . lua <nl> rename to samples / test - lua / Resources / luaScript / SpineTest / SpineTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / SpriteTest / SpriteTest . lua <nl> rename to samples / test - lua / Resources / luaScript / SpriteTest / SpriteTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / Texture2dTest / Texture2dTest . lua <nl> rename to samples / test - lua / Resources / luaScript / Texture2dTest / Texture2dTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / TileMapTest / TileMapTest . lua <nl> rename to samples / test - lua / Resources / luaScript / TileMapTest / TileMapTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / TouchesTest / Ball . lua <nl> rename to samples / test - lua / Resources / luaScript / TouchesTest / Ball . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / TouchesTest / Paddle . lua <nl> rename to samples / test - lua / Resources / luaScript / TouchesTest / Paddle . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / TouchesTest / TouchesTest . lua <nl> rename to samples / test - lua / Resources / luaScript / TouchesTest / TouchesTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / TransitionsTest / TransitionsName . lua <nl> rename to samples / test - lua / Resources / luaScript / TransitionsTest / TransitionsName . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / TransitionsTest / TransitionsTest . lua <nl> rename to samples / test - lua / Resources / luaScript / TransitionsTest / TransitionsTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / UserDefaultTest / UserDefaultTest . lua <nl> rename to samples / test - lua / Resources / luaScript / UserDefaultTest / UserDefaultTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / VisibleRect . lua <nl> rename to samples / test - lua / Resources / luaScript / VisibleRect . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / XMLHttpRequestTest / XMLHttpRequestTest . lua <nl> rename to samples / test - lua / Resources / luaScript / XMLHttpRequestTest / XMLHttpRequestTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / ZwoptexTest / ZwoptexTest . lua <nl> rename to samples / test - lua / Resources / luaScript / ZwoptexTest / ZwoptexTest . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / controller . lua <nl> rename to samples / test - lua / Resources / luaScript / controller . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / helper . lua <nl> rename to samples / test - lua / Resources / luaScript / helper . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / mainMenu . lua <nl> rename to samples / test - lua / Resources / luaScript / mainMenu . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / Resources / luaScript / testResource . lua <nl> rename to samples / test - lua / Resources / luaScript / testResource . lua <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / . classpath <nl> rename to samples / test - lua / proj . android / . classpath <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / . project <nl> rename to samples / test - lua / proj . android / . project <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / AndroidManifest . xml <nl> rename to samples / test - lua / proj . android / AndroidManifest . xml <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / ant . properties <nl> rename to samples / test - lua / proj . android / ant . properties <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / build . xml <nl> rename to samples / test - lua / proj . android / build . xml <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / jni / Android . mk <nl> rename to samples / test - lua / proj . android / jni / Android . mk <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / jni / Application . mk <nl> rename to samples / test - lua / proj . android / jni / Application . mk <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / jni / testlua / main . cpp <nl> rename to samples / test - lua / proj . android / jni / testlua / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / proguard - project . txt <nl> rename to samples / test - lua / proj . android / proguard - project . txt <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / project . properties <nl> rename to samples / test - lua / proj . android / project . properties <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / res / values / strings . xml <nl> rename to samples / test - lua / proj . android / res / values / strings . xml <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / src / com / cocos2dx / sample / LuaJavaBridgeTest / LuaJavaBridgeTest . java <nl> rename to samples / test - lua / proj . android / src / com / cocos2dx / sample / LuaJavaBridgeTest / LuaJavaBridgeTest . java <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . android / src / org / cocos2dx / testlua / Cocos2dxActivity . java <nl> rename to samples / test - lua / proj . android / src / org / cocos2dx / testlua / Cocos2dxActivity . java <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / AppController . h <nl> rename to samples / test - lua / proj . ios / AppController . h <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / AppController . mm <nl> rename to samples / test - lua / proj . ios / AppController . mm <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / Default - 568h @ 2x . png . REMOVED . git - id <nl> rename to samples / test - lua / proj . ios / Default - 568h @ 2x . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / Default @ 2x . png . REMOVED . git - id <nl> rename to samples / test - lua / proj . ios / Default @ 2x . png . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / LuaObjectCBridgeTest . h <nl> rename to samples / test - lua / proj . ios / LuaObjectCBridgeTest . h <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / LuaObjectCBridgeTest . mm <nl> rename to samples / test - lua / proj . ios / LuaObjectCBridgeTest . mm <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / RootViewController . h <nl> rename to samples / test - lua / proj . ios / RootViewController . h <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / RootViewController . mm <nl> rename to samples / test - lua / proj . ios / RootViewController . mm <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / TestLua_Prefix . pch <nl> rename to samples / test - lua / proj . ios / TestLua_Prefix . pch <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . ios / main . m <nl> rename to samples / test - lua / proj . ios / main . m <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . linux / main . cpp <nl> rename to samples / test - lua / proj . linux / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / Icon . icns . REMOVED . git - id <nl> rename to samples / test - lua / proj . mac / Icon . icns . REMOVED . git - id <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / LuaObjectCBridgeTest . h <nl> rename to samples / test - lua / proj . mac / LuaObjectCBridgeTest . h <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / LuaObjectCBridgeTest . mm <nl> rename to samples / test - lua / proj . mac / LuaObjectCBridgeTest . mm <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / TestLua_Prefix . pch <nl> rename to samples / test - lua / proj . mac / TestLua_Prefix . pch <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / en . lproj / InfoPlist . strings <nl> rename to samples / test - lua / proj . mac / en . lproj / InfoPlist . strings <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / en . lproj / MainMenu . xib <nl> rename to samples / test - lua / proj . mac / en . lproj / MainMenu . xib <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . mac / main . cpp <nl> rename to samples / test - lua / proj . mac / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / TestLua . rc <nl> rename to samples / test - lua / proj . win32 / TestLua . rc <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / TestLua . win32 . vcxproj <nl> rename to samples / test - lua / proj . win32 / TestLua . win32 . vcxproj <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / TestLua . win32 . vcxproj . filters <nl> rename to samples / test - lua / proj . win32 / TestLua . win32 . vcxproj . filters <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / TestLua . win32 . vcxproj . user <nl> rename to samples / test - lua / proj . win32 / TestLua . win32 . vcxproj . user <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / main . cpp <nl> rename to samples / test - lua / proj . win32 / main . cpp <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / main . h <nl> rename to samples / test - lua / proj . win32 / main . h <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / res / TestLua . ico <nl> rename to samples / test - lua / proj . win32 / res / TestLua . ico <nl> similarity index 100 % <nl> rename from samples / TestLua / proj . win32 / resource . h <nl> rename to samples / test - lua / proj . win32 / resource . h <nl>
issue : Renames ` TestXxx ` to ` test - xxx ` for samples .
cocos2d/cocos2d-x
bc618ee4244ee875f5f75eb7d673949f7c66439e
2014-01-28T03:34:12Z
mmm a / src / qt / bitcoinamountfield . cpp <nl> ppp b / src / qt / bitcoinamountfield . cpp <nl> BitcoinAmountField : : BitcoinAmountField ( QWidget * parent ) : <nl> amount = new AmountSpinBox ( this ) ; <nl> amount - > setLocale ( QLocale : : c ( ) ) ; <nl> amount - > installEventFilter ( this ) ; <nl> - amount - > setMaximumWidth ( 170 ) ; <nl> + amount - > setMaximumWidth ( 240 ) ; <nl> <nl> QHBoxLayout * layout = new QHBoxLayout ( this ) ; <nl> layout - > addWidget ( amount ) ; <nl>
Merge : gui : fix visual " overflow " of amount input .
bitcoin/bitcoin
f8be43413368a43850d534b645b5c0cf47f312a4
2018-05-24T13:52:21Z
mmm a / include / spdlog / sinks / daily_file_sink . h <nl> ppp b / include / spdlog / sinks / daily_file_sink . h <nl> class daily_file_sink final : public base_sink < Mutex > <nl> using details : : os : : filename_to_str ; <nl> using details : : os : : remove_if_exists ; <nl> <nl> - filename_t current_file = filename ( ) ; <nl> + filename_t current_file = file_helper_ . filename ( ) ; <nl> if ( filenames_q_ . full ( ) ) <nl> { <nl> auto old_filename = std : : move ( filenames_q_ . front ( ) ) ; <nl>
Merge pull request from IIFE / filename - deadlock
gabime/spdlog
ac19803d03538c0202ac5d96ea1b02fe7480b45a
2020-05-26T21:01:58Z
mmm a / stdlib / public / Platform / ucrt . modulemap <nl> ppp b / stdlib / public / Platform / ucrt . modulemap <nl> module ucrt [ system ] { <nl> } <nl> } <nl> <nl> + module process { <nl> + header " process . h " <nl> + export * <nl> + } <nl> + <nl> module corecrt { <nl> header " corecrt . h " <nl> export * <nl> module ucrt [ system ] { <nl> header " corecrt_io . h " <nl> export * <nl> } <nl> + <nl> + module math { <nl> + header " corecrt_math . h " <nl> + export * <nl> + } <nl> } <nl> } <nl> <nl>
stdlib : broaden ucrt module
apple/swift
29dc89bd9b626a7e0d4ad9f1ece57c2ba250ab79
2018-11-25T04:57:46Z
mmm a / src / widgets / editor / moving_pixels_state . cpp <nl> ppp b / src / widgets / editor / moving_pixels_state . cpp <nl> bool MovingPixelsState : : onUpdateStatusBar ( Editor * editor ) <nl> ASSERT ( m_pixelsMovement ! = NULL ) ; <nl> <nl> const gfx : : Transformation & transform ( getTransformation ( editor ) ) ; <nl> + Document * document = editor - > getDocument ( ) ; <nl> + gfx : : Size imageSize = m_pixelsMovement - > getInitialImageSize ( ) ; <nl> <nl> app_get_statusbar ( ) - > setStatusText <nl> - ( 100 , " Pos % d % d , Size % d % d , Angle % . 1f " , <nl> + ( 100 , " Pos % d % d , Size % d % d , Orig : % 3d % 3d ( % . 02f % % % . 02f % % ) , Angle % . 1f " , <nl> transform . bounds ( ) . x , transform . bounds ( ) . y , <nl> transform . bounds ( ) . w , transform . bounds ( ) . h , <nl> + imageSize . w , imageSize . h , <nl> + ( double ) transform . bounds ( ) . w * 100 . 0 / imageSize . w , <nl> + ( double ) transform . bounds ( ) . h * 100 . 0 / imageSize . h , <nl> 180 . 0 * transform . angle ( ) / PI ) ; <nl> <nl> return true ; <nl> mmm a / src / widgets / editor / pixels_movement . cpp <nl> ppp b / src / widgets / editor / pixels_movement . cpp <nl> gfx : : Rect PixelsMovement : : getImageBounds ( ) <nl> return gfx : : Rect ( cel - > getX ( ) , cel - > getY ( ) , image - > w , image - > h ) ; <nl> } <nl> <nl> + gfx : : Size PixelsMovement : : getInitialImageSize ( ) const <nl> + { <nl> + return m_initialData . bounds ( ) . getSize ( ) ; <nl> + } <nl> + <nl> void PixelsMovement : : setMaskColor ( uint32_t mask_color ) <nl> { <nl> { <nl> mmm a / src / widgets / editor / pixels_movement . h <nl> ppp b / src / widgets / editor / pixels_movement . h <nl> <nl> # include " document_wrappers . h " <nl> # include " undo_transaction . h " <nl> # include " widgets / editor / handle_type . h " <nl> + # include " gfx / size . h " <nl> <nl> class Document ; <nl> class Image ; <nl> class PixelsMovement <nl> bool isDragging ( ) const ; <nl> <nl> gfx : : Rect getImageBounds ( ) ; <nl> + gfx : : Size getInitialImageSize ( ) const ; <nl> <nl> void setMaskColor ( uint32_t mask_color ) ; <nl> <nl>
Improve status bar text when the user is scaling / rotating the selection .
aseprite/aseprite
9684672f5fe9f66e73ba617c77807821fd8dc9cf
2012-01-07T19:35:04Z