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

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

Issue 22819005: Make Null a public class of dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase on dart2js's putback Created 7 years, 4 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 "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 Bool::False() : Bool::True())); 1216 Bool::False() : Bool::True()));
1217 return; 1217 return;
1218 } 1218 }
1219 1219
1220 // Eliminate the test if it can be performed successfully at compile time. 1220 // Eliminate the test if it can be performed successfully at compile time.
1221 if ((node->left() != NULL) && 1221 if ((node->left() != NULL) &&
1222 node->left()->IsLiteralNode() && 1222 node->left()->IsLiteralNode() &&
1223 type.IsInstantiated()) { 1223 type.IsInstantiated()) {
1224 const Instance& literal_value = node->left()->AsLiteralNode()->literal(); 1224 const Instance& literal_value = node->left()->AsLiteralNode()->literal();
1225 ConstantInstr* result = NULL; 1225 ConstantInstr* result = NULL;
1226
regis 2013/08/15 17:27:26 Any particular reason to remove these 2 blank line
rmacnak 2013/08/15 17:56:04 No reason, just an artifact of merging with dart2j
1227 Error& malformed_error = Error::Handle(); 1226 Error& malformed_error = Error::Handle();
1228 if (literal_value.IsInstanceOf(type, 1227 if (literal_value.IsInstanceOf(type,
1229 TypeArguments::Handle(), 1228 TypeArguments::Handle(),
1230 &malformed_error)) { 1229 &malformed_error)) {
1231 result = new ConstantInstr(negate_result ? 1230 result = new ConstantInstr(negate_result ?
1232 Bool::False() : Bool::True()); 1231 Bool::False() : Bool::True());
1233 } else { 1232 } else {
1234 result = new ConstantInstr(negate_result ? 1233 result = new ConstantInstr(negate_result ?
1235 Bool::True() : Bool::False()); 1234 Bool::True() : Bool::False());
1236 } 1235 }
1237 ASSERT(malformed_error.IsNull()); 1236 ASSERT(malformed_error.IsNull());
1238
1239 ReturnDefinition(result); 1237 ReturnDefinition(result);
1240 return; 1238 return;
1241 } 1239 }
1242 1240
1243 ValueGraphVisitor for_left_value(owner(), temp_index()); 1241 ValueGraphVisitor for_left_value(owner(), temp_index());
1244 node->left()->Visit(&for_left_value); 1242 node->left()->Visit(&for_left_value);
1245 Append(for_left_value); 1243 Append(for_left_value);
1246 PushArgumentInstr* push_left = PushArgument(for_left_value.value()); 1244 PushArgumentInstr* push_left = PushArgument(for_left_value.value());
1247 PushArgumentInstr* push_instantiator = NULL; 1245 PushArgumentInstr* push_instantiator = NULL;
1248 PushArgumentInstr* push_type_args = NULL; 1246 PushArgumentInstr* push_type_args = NULL;
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after
3670 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3668 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3671 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3669 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3672 OS::SNPrint(chars, len, kFormat, function_name, reason); 3670 OS::SNPrint(chars, len, kFormat, function_name, reason);
3673 const Error& error = Error::Handle( 3671 const Error& error = Error::Handle(
3674 LanguageError::New(String::Handle(String::New(chars)))); 3672 LanguageError::New(String::Handle(String::New(chars))));
3675 Isolate::Current()->long_jump_base()->Jump(1, error); 3673 Isolate::Current()->long_jump_base()->Jump(1, error);
3676 } 3674 }
3677 3675
3678 3676
3679 } // namespace dart 3677 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698