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

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

Issue 10933043: Use ICData to collect type feedback on instance setter value. If value is always Smi, insert a smi … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/flow_graph_optimizer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')
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/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 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1949 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1950 new ZoneGrowableArray<PushArgumentInstr*>(2); 1950 new ZoneGrowableArray<PushArgumentInstr*>(2);
1951 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); 1951 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded);
1952 const String& name = 1952 const String& name =
1953 String::ZoneHandle(Field::SetterSymbol(node->field_name())); 1953 String::ZoneHandle(Field::SetterSymbol(node->field_name()));
1954 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), 1954 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(),
1955 name, 1955 name,
1956 Token::kSET, 1956 Token::kSET,
1957 arguments, 1957 arguments,
1958 Array::ZoneHandle(), 1958 Array::ZoneHandle(),
1959 1); // Checked arg count. 1959 2); // Checked arg count.
1960 ReturnDefinition(call); 1960 ReturnDefinition(call);
1961 } 1961 }
1962 1962
1963 1963
1964 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { 1964 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
1965 InlineBailout("ValueGraphVisitor::VisitInstanceSetterNode (deopt)"); 1965 InlineBailout("ValueGraphVisitor::VisitInstanceSetterNode (deopt)");
1966 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1966 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1967 new ZoneGrowableArray<PushArgumentInstr*>(2); 1967 new ZoneGrowableArray<PushArgumentInstr*>(2);
1968 BuildInstanceSetterArguments(node, arguments, kResultNeeded); 1968 BuildInstanceSetterArguments(node, arguments, kResultNeeded);
1969 const String& name = 1969 const String& name =
1970 String::ZoneHandle(Field::SetterSymbol(node->field_name())); 1970 String::ZoneHandle(Field::SetterSymbol(node->field_name()));
1971 Do(new InstanceCallInstr(node->token_pos(), 1971 Do(new InstanceCallInstr(node->token_pos(),
1972 name, 1972 name,
1973 Token::kSET, 1973 Token::kSET,
1974 arguments, 1974 arguments,
1975 Array::ZoneHandle(), 1975 Array::ZoneHandle(),
1976 1)); // Checked argument count. 1976 2)); // Checked argument count.
1977 ReturnDefinition(BuildLoadExprTemp()); 1977 ReturnDefinition(BuildLoadExprTemp());
1978 } 1978 }
1979 1979
1980 1980
1981 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) { 1981 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) {
1982 InlineBailout("EffectGraphVisitor::VisitStaticGetterNode (deopt)"); 1982 InlineBailout("EffectGraphVisitor::VisitStaticGetterNode (deopt)");
1983 const String& getter_name = 1983 const String& getter_name =
1984 String::Handle(Field::GetterName(node->field_name())); 1984 String::Handle(Field::GetterName(node->field_name()));
1985 ZoneGrowableArray<PushArgumentInstr*>* arguments = 1985 ZoneGrowableArray<PushArgumentInstr*>* arguments =
1986 new ZoneGrowableArray<PushArgumentInstr*>(); 1986 new ZoneGrowableArray<PushArgumentInstr*>();
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2630 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2631 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2631 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2632 OS::SNPrint(chars, len, kFormat, function_name, reason); 2632 OS::SNPrint(chars, len, kFormat, function_name, reason);
2633 const Error& error = Error::Handle( 2633 const Error& error = Error::Handle(
2634 LanguageError::New(String::Handle(String::New(chars)))); 2634 LanguageError::New(String::Handle(String::New(chars))));
2635 Isolate::Current()->long_jump_base()->Jump(1, error); 2635 Isolate::Current()->long_jump_base()->Jump(1, error);
2636 } 2636 }
2637 2637
2638 2638
2639 } // namespace dart 2639 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698