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

Side by Side Diff: vm/flow_graph_builder.cc

Issue 10829164: Replace InstanceSetterComp instruction with a plain instance call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 | vm/flow_graph_optimizer.h » ('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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 value = for_value.value(); 1743 value = for_value.value();
1744 } 1744 }
1745 arguments->Add(PushArgument(value)); 1745 arguments->Add(PushArgument(value));
1746 } 1746 }
1747 1747
1748 1748
1749 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { 1749 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
1750 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1750 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1751 new ZoneGrowableArray<PushArgumentInstr*>(2); 1751 new ZoneGrowableArray<PushArgumentInstr*>(2);
1752 BuildInstanceSetterArguments(node, arguments, false); // Value not used. 1752 BuildInstanceSetterArguments(node, arguments, false); // Value not used.
1753 InstanceSetterComp* setter = 1753 const String& name =
1754 new InstanceSetterComp(node->token_pos(), 1754 String::ZoneHandle(Field::SetterSymbol(node->field_name()));
1755 owner()->try_index(), 1755 InstanceCallComp* call = new InstanceCallComp(node->token_pos(),
1756 node->field_name(), 1756 owner()->try_index(),
1757 arguments); 1757 name,
1758 ReturnComputation(setter); 1758 Token::kSET,
1759 arguments,
1760 Array::ZoneHandle(),
1761 1); // Checked argument count.
1762 ReturnComputation(call);
1759 } 1763 }
1760 1764
1761 1765
1762 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { 1766 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
1763 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1767 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1764 new ZoneGrowableArray<PushArgumentInstr*>(2); 1768 new ZoneGrowableArray<PushArgumentInstr*>(2);
1765 BuildInstanceSetterArguments(node, arguments, true); // Value used. 1769 BuildInstanceSetterArguments(node, arguments, true); // Value used.
1766 Do(new InstanceSetterComp(node->token_pos(), 1770 const String& name =
1767 owner()->try_index(), 1771 String::ZoneHandle(Field::SetterSymbol(node->field_name()));
1768 node->field_name(), 1772 Do(new InstanceCallComp(node->token_pos(),
1769 arguments)); 1773 owner()->try_index(),
1774 name,
1775 Token::kSET,
1776 arguments,
1777 Array::ZoneHandle(),
1778 1)); // Checked argument count.
1770 ReturnComputation( 1779 ReturnComputation(
1771 BuildLoadLocal(*owner()->parsed_function().expression_temp_var())); 1780 BuildLoadLocal(*owner()->parsed_function().expression_temp_var()));
1772 } 1781 }
1773 1782
1774 1783
1775 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) { 1784 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) {
1776 const String& getter_name = 1785 const String& getter_name =
1777 String::Handle(Field::GetterName(node->field_name())); 1786 String::Handle(Field::GetterName(node->field_name()));
1778 const Function& getter_function = 1787 const Function& getter_function =
1779 Function::ZoneHandle(node->cls().LookupStaticFunction(getter_name)); 1788 Function::ZoneHandle(node->cls().LookupStaticFunction(getter_name));
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 char* chars = reinterpret_cast<char*>( 2726 char* chars = reinterpret_cast<char*>(
2718 Isolate::Current()->current_zone()->Allocate(len)); 2727 Isolate::Current()->current_zone()->Allocate(len));
2719 OS::SNPrint(chars, len, kFormat, function_name, reason); 2728 OS::SNPrint(chars, len, kFormat, function_name, reason);
2720 const Error& error = Error::Handle( 2729 const Error& error = Error::Handle(
2721 LanguageError::New(String::Handle(String::New(chars)))); 2730 LanguageError::New(String::Handle(String::New(chars))));
2722 Isolate::Current()->long_jump_base()->Jump(1, error); 2731 Isolate::Current()->long_jump_base()->Jump(1, error);
2723 } 2732 }
2724 2733
2725 2734
2726 } // namespace dart 2735 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698