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

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

Issue 14942010: Eliminate temporary locals for some expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « runtime/vm/code_generator_test.cc ('k') | runtime/vm/flow_graph.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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 844
845 // We compile the function here, even though InvokeStatic() below 845 // We compile the function here, even though InvokeStatic() below
846 // would compile func automatically. We are checking fewer invariants 846 // would compile func automatically. We are checking fewer invariants
847 // here. 847 // here.
848 ParsedFunction* parsed_function = new ParsedFunction(func); 848 ParsedFunction* parsed_function = new ParsedFunction(func);
849 parsed_function->SetNodeSequence(fragment); 849 parsed_function->SetNodeSequence(fragment);
850 parsed_function->set_default_parameter_values(Array::ZoneHandle()); 850 parsed_function->set_default_parameter_values(Array::ZoneHandle());
851 parsed_function->set_expression_temp_var( 851 parsed_function->set_expression_temp_var(
852 ParsedFunction::CreateExpressionTempVar(0)); 852 ParsedFunction::CreateExpressionTempVar(0));
853 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); 853 fragment->scope()->AddVariable(parsed_function->expression_temp_var());
854 parsed_function->set_array_literal_var(
855 ParsedFunction::CreateArrayLiteralVar(0));
856 fragment->scope()->AddVariable(parsed_function->array_literal_var());
857 parsed_function->AllocateVariables(); 854 parsed_function->AllocateVariables();
858 855
859 // Non-optimized code generator. 856 // Non-optimized code generator.
860 CompileParsedFunctionHelper(*parsed_function, false); 857 CompileParsedFunctionHelper(*parsed_function, false);
861 858
862 const Object& result = Object::Handle( 859 const Object& result = Object::Handle(
863 DartEntry::InvokeFunction(func, Object::empty_array())); 860 DartEntry::InvokeFunction(func, Object::empty_array()));
864 isolate->set_long_jump_base(base); 861 isolate->set_long_jump_base(base);
865 return result.raw(); 862 return result.raw();
866 } else { 863 } else {
867 const Object& result = 864 const Object& result =
868 Object::Handle(isolate->object_store()->sticky_error()); 865 Object::Handle(isolate->object_store()->sticky_error());
869 isolate->object_store()->clear_sticky_error(); 866 isolate->object_store()->clear_sticky_error();
870 isolate->set_long_jump_base(base); 867 isolate->set_long_jump_base(base);
871 return result.raw(); 868 return result.raw();
872 } 869 }
873 UNREACHABLE(); 870 UNREACHABLE();
874 return Object::null(); 871 return Object::null();
875 } 872 }
876 873
877 } // namespace dart 874 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator_test.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698