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

Side by Side Diff: runtime/vm/isolate.cc

Issue 8659012: Add Dart API scoping around the call to Dart_HandleMessage. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/assert.h" 9 #include "vm/assert.h"
10 #include "vm/bigint_store.h" 10 #include "vm/bigint_store.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 ASSERT(post_message_callback() == &StandardPostMessageCallback); 241 ASSERT(post_message_callback() == &StandardPostMessageCallback);
242 ASSERT(close_port_callback() == &StandardClosePortCallback); 242 ASSERT(close_port_callback() == &StandardClosePortCallback);
243 243
244 while (active_ports() > 0) { 244 while (active_ports() > 0) {
245 ASSERT(this == Isolate::Current()); 245 ASSERT(this == Isolate::Current());
246 Zone zone(this); 246 Zone zone(this);
247 HandleScope handle_scope(this); 247 HandleScope handle_scope(this);
248 248
249 PortMessage* message = message_queue()->Dequeue(0); 249 PortMessage* message = message_queue()->Dequeue(0);
250 if (message != NULL) { 250 if (message != NULL) {
251 Dart_EnterScope();
251 Dart_Handle result = Dart_HandleMessage( 252 Dart_Handle result = Dart_HandleMessage(
252 message->dest_port(), message->reply_port(), message->data()); 253 message->dest_port(), message->reply_port(), message->data());
253 if (Dart_IsError(result)) { 254 if (Dart_IsError(result)) {
255 // TODO(turnidge): Consider passing this error out to
256 // Dart_RunLoop so that the embedder can choose how to handle
257 // it.
254 fprintf(stderr, "%s\n", Dart_GetError(result)); 258 fprintf(stderr, "%s\n", Dart_GetError(result));
259 Dart_ExitScope();
255 exit(255); 260 exit(255);
256 } 261 }
262 Dart_ExitScope();
257 delete message; 263 delete message;
258 } 264 }
259 } 265 }
260 } 266 }
261 267
262 268
263 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, 269 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
264 bool validate_frames) { 270 bool validate_frames) {
265 ASSERT(visitor != NULL); 271 ASSERT(visitor != NULL);
266 272
(...skipping 22 matching lines...) Expand all
289 // Visit all objects in the code index table. 295 // Visit all objects in the code index table.
290 if (code_index_table() != NULL) { 296 if (code_index_table() != NULL) {
291 code_index_table()->VisitObjectPointers(visitor); 297 code_index_table()->VisitObjectPointers(visitor);
292 } 298 }
293 299
294 // Visit the top context which is stored in the isolate. 300 // Visit the top context which is stored in the isolate.
295 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); 301 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_));
296 } 302 }
297 303
298 } // namespace dart 304 } // namespace dart
OLDNEW
« runtime/vm/dart_api_impl_test.cc ('K') | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698