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

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

Issue 11199002: Remove built-in identifier 'negate' from VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 return; 975 return;
976 } 976 }
977 977
978 ValueGraphVisitor for_value(owner(), temp_index()); 978 ValueGraphVisitor for_value(owner(), temp_index());
979 node->operand()->Visit(&for_value); 979 node->operand()->Visit(&for_value);
980 Append(for_value); 980 Append(for_value);
981 PushArgumentInstr* push_value = PushArgument(for_value.value()); 981 PushArgumentInstr* push_value = PushArgument(for_value.value());
982 ZoneGrowableArray<PushArgumentInstr*>* arguments = 982 ZoneGrowableArray<PushArgumentInstr*>* arguments =
983 new ZoneGrowableArray<PushArgumentInstr*>(1); 983 new ZoneGrowableArray<PushArgumentInstr*>(1);
984 arguments->Add(push_value); 984 arguments->Add(push_value);
985 InstanceCallInstr* call = (node->kind() == Token::kSUB) 985 InstanceCallInstr* call =
986 ? new InstanceCallInstr(node->token_pos(), 986 new InstanceCallInstr(node->token_pos(),
987 String::ZoneHandle(Symbols::New("unary-")), 987 String::ZoneHandle(
988 Token::kNEGATE, 988 Symbols::New(Token::Str(node->kind()))),
989 arguments, 989 node->kind(),
990 Array::ZoneHandle(), 990 arguments,
991 1) 991 Array::ZoneHandle(),
992 : new InstanceCallInstr(node->token_pos(), 992 1);
993 String::ZoneHandle(
994 Symbols::New(Token::Str(node->kind()))),
995 node->kind(),
996 arguments,
997 Array::ZoneHandle(),
998 1);
999 ReturnDefinition(call); 993 ReturnDefinition(call);
1000 } 994 }
1001 995
1002 996
1003 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { 997 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) {
1004 TestGraphVisitor for_test(owner(), 998 TestGraphVisitor for_test(owner(),
1005 temp_index(), 999 temp_index(),
1006 node->condition()->token_pos()); 1000 node->condition()->token_pos());
1007 node->condition()->Visit(&for_test); 1001 node->condition()->Visit(&for_test);
1008 1002
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2671 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2678 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2672 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2679 OS::SNPrint(chars, len, kFormat, function_name, reason); 2673 OS::SNPrint(chars, len, kFormat, function_name, reason);
2680 const Error& error = Error::Handle( 2674 const Error& error = Error::Handle(
2681 LanguageError::New(String::Handle(String::New(chars)))); 2675 LanguageError::New(String::Handle(String::New(chars))));
2682 Isolate::Current()->long_jump_base()->Jump(1, error); 2676 Isolate::Current()->long_jump_base()->Jump(1, error);
2683 } 2677 }
2684 2678
2685 2679
2686 } // namespace dart 2680 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698