Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: runtime/bin/eventhandler_win.cc

Issue 27727002: Optimize identical-comparisons based on propagated type information. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/eventhandler.h" 8 #include "bin/eventhandler.h"
9 9
10 #include <winsock2.h> // NOLINT 10 #include <winsock2.h> // NOLINT
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 Handle* handle = reinterpret_cast<Handle*>(msg->id); 811 Handle* handle = reinterpret_cast<Handle*>(msg->id);
812 ASSERT(handle != NULL); 812 ASSERT(handle != NULL);
813 if (handle->is_listen_socket()) { 813 if (handle->is_listen_socket()) {
814 ListenSocket* listen_socket = 814 ListenSocket* listen_socket =
815 reinterpret_cast<ListenSocket*>(handle); 815 reinterpret_cast<ListenSocket*>(handle);
816 listen_socket->EnsureInitialized(this); 816 listen_socket->EnsureInitialized(this);
817 listen_socket->SetPortAndMask(msg->dart_port, msg->data); 817 listen_socket->SetPortAndMask(msg->dart_port, msg->data);
818 818
819 Handle::ScopedLock lock(listen_socket); 819 Handle::ScopedLock lock(listen_socket);
820 820
821 // If incomming connections are requested make sure to post already 821 // If incoming connections are requested make sure to post already
822 // accepted connections. 822 // accepted connections.
823 if ((msg->data & (1 << kInEvent)) != 0) { 823 if ((msg->data & (1 << kInEvent)) != 0) {
824 if (listen_socket->CanAccept()) { 824 if (listen_socket->CanAccept()) {
825 int event_mask = (1 << kInEvent); 825 int event_mask = (1 << kInEvent);
826 handle->set_mask(handle->mask() & ~event_mask); 826 handle->set_mask(handle->mask() & ~event_mask);
827 DartUtils::PostInt32(handle->port(), event_mask); 827 DartUtils::PostInt32(handle->port(), event_mask);
828 } 828 }
829 // Always keep 5 outstanding accepts going, to enhance performance. 829 // Always keep 5 outstanding accepts going, to enhance performance.
830 while (listen_socket->pending_accept_count() < 5) { 830 while (listen_socket->pending_accept_count() < 5) {
831 listen_socket->IssueAccept(); 831 listen_socket->IssueAccept();
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 1132
1133 1133
1134 void EventHandlerImplementation::Shutdown() { 1134 void EventHandlerImplementation::Shutdown() {
1135 SendData(kShutdownId, 0, 0); 1135 SendData(kShutdownId, 0, 0);
1136 } 1136 }
1137 1137
1138 } // namespace bin 1138 } // namespace bin
1139 } // namespace dart 1139 } // namespace dart
1140 1140
1141 #endif // defined(TARGET_OS_WINDOWS) 1141 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698