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

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

Issue 10693071: Use VM type cast and save handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/debugger.h" 9 #include "vm/debugger.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
11 #include "vm/object_store.h" 11 #include "vm/object_store.h"
12 12
13 namespace dart { 13 namespace dart {
14 14
15 #define UNWRAP_AND_CHECK_PARAM(type, var, param) \ 15 #define UNWRAP_AND_CHECK_PARAM(type, var, param) \
16 do { \ 16 do { \
17 const Object& tmp = Object::Handle(Api::UnwrapHandle(param)); \ 17 const Object& tmp = Object::Handle(Api::UnwrapHandle(param)); \
18 if (tmp.IsNull()) { \ 18 if (tmp.IsNull()) { \
19 return Api::NewError("%s expects argument '%s' to be non-null.", \ 19 return Api::NewError("%s expects argument '%s' to be non-null.", \
20 CURRENT_FUNC, #param); \ 20 CURRENT_FUNC, #param); \
21 } else if (tmp.IsApiError()) { \ 21 } else if (tmp.IsApiError()) { \
22 return param; \ 22 return param; \
23 } else if (!tmp.Is##type()) { \ 23 } else if (!tmp.Is##type()) { \
24 return Api::NewError("%s expects argument '%s' to be of type %s.", \ 24 return Api::NewError("%s expects argument '%s' to be of type %s.", \
25 CURRENT_FUNC, #param, #type); \ 25 CURRENT_FUNC, #param, #type); \
26 } \ 26 } \
27 var ^= tmp.raw(); \ 27 var ^= tmp.raw(); \
28 } while (0); 28 } while (0)
Ivan Posva 2012/07/02 21:01:38 Why here, but not below in CHECK_AND_CAST?
regis 2012/07/02 21:42:33 You would have to ask Matthias :-) Now wrapped in
29 29
30 30
31 #define CHECK_AND_CAST(type, var, param) \ 31 #define CHECK_AND_CAST(type, var, param) \
32 if (param == NULL) { \ 32 if (param == NULL) { \
33 return Api::NewError("%s expects argument '%s' to be non-null.", \ 33 return Api::NewError("%s expects argument '%s' to be non-null.", \
34 CURRENT_FUNC, #param); \ 34 CURRENT_FUNC, #param); \
35 } \ 35 } \
36 type* var = reinterpret_cast<type*>(param); 36 type* var = reinterpret_cast<type*>(param);
37 37
38 38
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 for (int i = 0; i < num_libs; i++) { 665 for (int i = 0; i < num_libs; i++) {
666 lib ^= libs.At(i); 666 lib ^= libs.At(i);
667 ASSERT(!lib.IsNull()); 667 ASSERT(!lib.IsNull());
668 lib_url = lib.url(); 668 lib_url = lib.url();
669 library_url_list.SetAt(i, lib_url); 669 library_url_list.SetAt(i, lib_url);
670 } 670 }
671 return Api::NewHandle(isolate, library_url_list.raw()); 671 return Api::NewHandle(isolate, library_url_list.raw());
672 } 672 }
673 673
674 } // namespace dart 674 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698