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

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

Issue 11367044: Merged String subclasses into String. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed unnecessary scope. Created 8 years, 1 month 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_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 #define DEFINE_UNWRAP(type) \ 136 #define DEFINE_UNWRAP(type) \
137 const type& Api::Unwrap##type##Handle(Isolate* iso, \ 137 const type& Api::Unwrap##type##Handle(Isolate* iso, \
138 Dart_Handle dart_handle) { \ 138 Dart_Handle dart_handle) { \
139 const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle)); \ 139 const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle)); \
140 if (obj.Is##type()) { \ 140 if (obj.Is##type()) { \
141 return type::Cast(obj); \ 141 return type::Cast(obj); \
142 } \ 142 } \
143 return type::Handle(iso); \ 143 return type::Handle(iso); \
144 } 144 }
145 CLASS_LIST_NO_OBJECT(DEFINE_UNWRAP) 145 CLASS_LIST_NO_OBJECT_WITH_STRING(DEFINE_UNWRAP)
siva 2012/11/05 19:23:38 Ditto comment about readability of this.
Tom Ball 2012/11/05 21:22:41 Done.
146 #undef DEFINE_UNWRAP 146 #undef DEFINE_UNWRAP
147 147
148 148
149 LocalHandle* Api::UnwrapAsLocalHandle(const ApiState& state, 149 LocalHandle* Api::UnwrapAsLocalHandle(const ApiState& state,
150 Dart_Handle object) { 150 Dart_Handle object) {
151 ASSERT(state.IsValidLocalHandle(object)); 151 ASSERT(state.IsValidLocalHandle(object));
152 return reinterpret_cast<LocalHandle*>(object); 152 return reinterpret_cast<LocalHandle*>(object);
153 } 153 }
154 154
155 155
(...skipping 4278 matching lines...) Expand 10 before | Expand all | Expand 10 after
4434 } 4434 }
4435 { 4435 {
4436 NoGCScope no_gc; 4436 NoGCScope no_gc;
4437 RawObject* raw_obj = obj.raw(); 4437 RawObject* raw_obj = obj.raw();
4438 isolate->heap()->SetPeer(raw_obj, peer); 4438 isolate->heap()->SetPeer(raw_obj, peer);
4439 } 4439 }
4440 return Api::Success(isolate); 4440 return Api::Success(isolate);
4441 } 4441 }
4442 4442
4443 } // namespace dart 4443 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698