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

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

Issue 10830253: Support for new operator - (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/code_descriptors.h" 9 #include "vm/code_descriptors.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 ReturnComputation(negate); 851 ReturnComputation(negate);
852 return; 852 return;
853 } 853 }
854 ValueGraphVisitor for_value(owner(), temp_index()); 854 ValueGraphVisitor for_value(owner(), temp_index());
855 node->operand()->Visit(&for_value); 855 node->operand()->Visit(&for_value);
856 Append(for_value); 856 Append(for_value);
857 PushArgumentInstr* push_value = PushArgument(for_value.value()); 857 PushArgumentInstr* push_value = PushArgument(for_value.value());
858 ZoneGrowableArray<PushArgumentInstr*>* arguments = 858 ZoneGrowableArray<PushArgumentInstr*>* arguments =
859 new ZoneGrowableArray<PushArgumentInstr*>(1); 859 new ZoneGrowableArray<PushArgumentInstr*>(1);
860 arguments->Add(push_value); 860 arguments->Add(push_value);
861 Token::Kind token_kind = 861 String& name = String::ZoneHandle();
862 (node->kind() == Token::kSUB) ? Token::kNEGATE : node->kind(); 862 if (node->kind() == Token::kSUB) {
863 const String& name = 863 name = Symbols::New("unary-");
864 String::ZoneHandle(Symbols::New(Token::Str(token_kind))); 864 } else {
865 name = Symbols::New(Token::Str(node->kind()));
866 }
865 InstanceCallComp* call = new InstanceCallComp( 867 InstanceCallComp* call = new InstanceCallComp(
866 node->token_pos(), owner()->try_index(), name, token_kind, 868 node->token_pos(), owner()->try_index(), name, node->kind(),
867 arguments, Array::ZoneHandle(), 1); 869 arguments, Array::ZoneHandle(), 1);
868 ReturnComputation(call); 870 ReturnComputation(call);
869 } 871 }
870 872
871 873
872 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { 874 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) {
873 TestGraphVisitor for_test(owner(), 875 TestGraphVisitor for_test(owner(),
874 temp_index(), 876 temp_index(),
875 node->condition()->token_pos()); 877 node->condition()->token_pos());
876 node->condition()->Visit(&for_test); 878 node->condition()->Visit(&for_test);
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
2809 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2811 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2810 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2812 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2811 OS::SNPrint(chars, len, kFormat, function_name, reason); 2813 OS::SNPrint(chars, len, kFormat, function_name, reason);
2812 const Error& error = Error::Handle( 2814 const Error& error = Error::Handle(
2813 LanguageError::New(String::Handle(String::New(chars)))); 2815 LanguageError::New(String::Handle(String::New(chars))));
2814 Isolate::Current()->long_jump_base()->Jump(1, error); 2816 Isolate::Current()->long_jump_base()->Jump(1, error);
2815 } 2817 }
2816 2818
2817 2819
2818 } // namespace dart 2820 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698