static bool PairOk( block *save, block *restore, reg_flow_info *info, int curr_reg ) /**********************************************************************************/ { int i; if( !_DBitOverlap( save->dom.id, info[curr_reg].dom_usage ) ) return( false ); if( !_DBitOverlap( restore->dom.id, info[curr_reg].post_dom_usage ) ) return( false ); if( !_DBitOverlap( save->dom.id, restore->dom.dominator ) ) return( false ); if( !_DBitOverlap( restore->dom.id, save->dom.post_dominator ) ) return( false ); if( _IsBlkAttr( restore, BLK_CONDITIONAL | BLK_SELECT ) ) return( false ); if( InLoop( save ) || InLoop( restore ) ) return( false ); for( i = 0; i < curr_reg; i++ ) { // now, either our save/restore must dominate/postdominate info[i]'s // or info[i]'s save/restore must dominate/postdominate ours if( info[i].save == NULL || info[i].restore == NULL ) continue; if( info[i].save == save && info[i].restore != restore ) return( false ); if( info[i].save != save && info[i].restore == restore ) return( false ); if( _DBitOverlap( info[i].save->dom.dominator, save->dom.id ) ) { // save dominates info[i].save - now check that restore postdominate if( _DBitOverlap( info[i].restore->dom.post_dominator, restore->dom.id ) ) continue; } else if( _DBitOverlap( info[i].save->dom.id, save->dom.dominator ) ) { // info[i].save dominates save, now make sure info[i].restore postdom's restore if( _DBitOverlap( info[i].restore->dom.id, restore->dom.post_dominator ) ) continue; } return( false ); } return( true ); }
TopWindow::~TopWindow() { GuiLock __; if(InLoop()) EndLoop(IDOK); if(!IsChild()) Close(); GuiPlatformDestruct(); }
Handle<Code> CodeStub::GetCode() { uint32_t key = GetKey(); int index = Heap::code_stubs()->FindEntry(key); if (index == NumberDictionary::kNotFound) { HandleScope scope; // Update the static counter each time a new code stub is generated. Counters::code_stubs.Increment(); // Generate the new code. MacroAssembler masm(NULL, 256); // Nested stubs are not allowed for leafs. masm.set_allow_stub_calls(AllowsStubCalls()); // Generate the code for the stub. masm.set_generating_stub(true); Generate(&masm); // Create the code object. CodeDesc desc; masm.GetCode(&desc); // Copy the generated code into a heap object, and store the major key. Code::Flags flags = Code::ComputeFlags(Code::STUB, InLoop()); Handle<Code> code = Factory::NewCode(desc, NULL, flags, masm.CodeObject()); code->set_major_key(MajorKey()); // Add unresolved entries in the code to the fixup list. Bootstrapper::AddFixup(*code, &masm); LOG(CodeCreateEvent(Logger::STUB_TAG, *code, GetName())); Counters::total_stubs_code_size.Increment(code->instruction_size()); #ifdef ENABLE_DISASSEMBLER if (FLAG_print_code_stubs) { #ifdef DEBUG Print(); #endif code->Disassemble(GetName()); PrintF("\n"); } #endif // Update the dictionary and the root in Heap. Handle<NumberDictionary> dict = Factory::DictionaryAtNumberPut( Handle<NumberDictionary>(Heap::code_stubs()), key, code); Heap::public_set_code_stubs(*dict); index = Heap::code_stubs()->FindEntry(key); } ASSERT(index != NumberDictionary::kNotFound); return Handle<Code>(Code::cast(Heap::code_stubs()->ValueAt(index))); }
LRESULT TopWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { GuiLock __; HWND hwnd = GetHWND(); #ifndef PLATFORM_WINCE bool inloop; #endif switch(message) { #ifndef PLATFORM_WINCE case WM_QUERYENDSESSION: inloop = InLoop(); WhenClose(); return inloop ? !InLoop() : !IsOpen(); case WM_ENDSESSION: EndSession() = true; PostQuitMessage(0); return 0; #endif case WM_CLOSE: if(IsEnabled()) { IgnoreMouseUp(); WhenClose(); } return 0; case WM_WINDOWPOSCHANGED: #ifndef PLATFORM_WINCE if(IsIconic(hwnd)) state = MINIMIZED; else if(IsZoomed(hwnd)) state = MAXIMIZED; else #endif { state = OVERLAPPED; overlapped = GetScreenClient(hwnd); } Layout(); break; } return Ctrl::WindowProc(message, wParam, lParam); }
void TopWindow::Close() { if(InLoop()) { if(!InCurrentLoop()) return; DefaultBreak(); return; } backup.Clear(); if(IsOpen()) IgnoreMouseUp(); Ctrl::Close(); }
LRESULT TopWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { GuiLock __; HWND hwnd = GetHWND(); #ifndef PLATFORM_WINCE bool inloop; #endif switch(message) { #ifndef PLATFORM_WINCE case WM_QUERYENDSESSION: inloop = InLoop(); WhenClose(); return inloop ? !InLoop() : !IsOpen(); #endif case WM_CLOSE: if(IsEnabled()) { IgnoreMouseUp(); WhenClose(); } return 0; case WM_WINDOWPOSCHANGED: if(!isopen) break; #ifndef PLATFORM_WINCE if(IsIconic(hwnd)) state = MINIMIZED; else if(IsZoomed(hwnd)) state = MAXIMIZED; else #endif { state = OVERLAPPED; if(IsWindowVisible(hwnd)) overlapped = GetScreenClient(hwnd); // 12-05-23 Tom added 'if(IsWindowVisible(hwnd))' to get only proper rectangles } LLOG("TopWindow::WindowProc::WM_WINDOWPOSCHANGED: overlapped = " << overlapped); Layout(); break; } return Ctrl::WindowProc(message, wParam, lParam); }