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

Side by Side Diff: runtime/lib/object.cc

Issue 23480005: Change Bool::Get to return a handle instead of a pointer to a raw object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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) 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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 StackFrame* caller_frame = iterator.NextFrame(); 132 StackFrame* caller_frame = iterator.NextFrame();
133 ASSERT(caller_frame != NULL); 133 ASSERT(caller_frame != NULL);
134 const intptr_t location = caller_frame->GetTokenPos(); 134 const intptr_t location = caller_frame->GetTokenPos();
135 String& malformed_error_message = String::Handle( 135 String& malformed_error_message = String::Handle(
136 String::New(malformed_error.ToErrorCString())); 136 String::New(malformed_error.ToErrorCString()));
137 Exceptions::CreateAndThrowTypeError( 137 Exceptions::CreateAndThrowTypeError(
138 location, Symbols::Empty(), Symbols::Empty(), 138 location, Symbols::Empty(), Symbols::Empty(),
139 Symbols::Empty(), malformed_error_message); 139 Symbols::Empty(), malformed_error_message);
140 UNREACHABLE(); 140 UNREACHABLE();
141 } 141 }
142 return Bool::Get(negate.value() ? !is_instance_of : is_instance_of); 142 return Bool::Get(negate.value() ? !is_instance_of : is_instance_of).raw();
143 } 143 }
144 144
145 145
146 DEFINE_NATIVE_ENTRY(Object_as, 4) { 146 DEFINE_NATIVE_ENTRY(Object_as, 4) {
147 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); 147 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0));
148 // Instantiator at position 1 is not used. It is passed along so that the call 148 // Instantiator at position 1 is not used. It is passed along so that the call
149 // can be easily converted to an optimized implementation. Instantiator is 149 // can be easily converted to an optimized implementation. Instantiator is
150 // used to populate the subtype cache. 150 // used to populate the subtype cache.
151 const AbstractTypeArguments& instantiator_type_arguments = 151 const AbstractTypeArguments& instantiator_type_arguments =
152 AbstractTypeArguments::CheckedHandle(arguments->NativeArgAt(2)); 152 AbstractTypeArguments::CheckedHandle(arguments->NativeArgAt(2));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 203
204 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { 204 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) {
205 const AbstractType& type = 205 const AbstractType& type =
206 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); 206 AbstractType::CheckedHandle(arguments->NativeArgAt(0));
207 return type.UserVisibleName(); 207 return type.UserVisibleName();
208 } 208 }
209 209
210 } // namespace dart 210 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/lib/regexp.cc » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698