| OLD | NEW |
| 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 Loading... |
| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 Append(for_value); | 2147 Append(for_value); |
| 2148 Value* store_value = for_value.value(); | 2148 Value* store_value = for_value.value(); |
| 2149 if (FLAG_enable_type_checks) { | 2149 if (FLAG_enable_type_checks) { |
| 2150 const AbstractType& type = AbstractType::ZoneHandle(node->field().type()); | 2150 const AbstractType& type = AbstractType::ZoneHandle(node->field().type()); |
| 2151 const String& dst_name = String::ZoneHandle(node->field().name()); | 2151 const String& dst_name = String::ZoneHandle(node->field().name()); |
| 2152 store_value = BuildAssignableValue(node->value()->token_pos(), | 2152 store_value = BuildAssignableValue(node->value()->token_pos(), |
| 2153 store_value, | 2153 store_value, |
| 2154 type, | 2154 type, |
| 2155 dst_name); | 2155 dst_name); |
| 2156 } | 2156 } |
| 2157 const bool kEmitStoreBarrier = true; |
| 2157 StoreInstanceFieldInstr* store = new StoreInstanceFieldInstr( | 2158 StoreInstanceFieldInstr* store = new StoreInstanceFieldInstr( |
| 2158 node->field(), for_instance.value(), store_value); | 2159 node->field(), for_instance.value(), store_value, kEmitStoreBarrier); |
| 2159 ReturnDefinition(store); | 2160 ReturnDefinition(store); |
| 2160 } | 2161 } |
| 2161 | 2162 |
| 2162 | 2163 |
| 2163 // StoreInstanceFieldNode does not return result. | 2164 // StoreInstanceFieldNode does not return result. |
| 2164 void ValueGraphVisitor::VisitStoreInstanceFieldNode( | 2165 void ValueGraphVisitor::VisitStoreInstanceFieldNode( |
| 2165 StoreInstanceFieldNode* node) { | 2166 StoreInstanceFieldNode* node) { |
| 2166 UNIMPLEMENTED(); | 2167 UNIMPLEMENTED(); |
| 2167 } | 2168 } |
| 2168 | 2169 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2631 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2631 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2632 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2632 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2633 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2633 const Error& error = Error::Handle( | 2634 const Error& error = Error::Handle( |
| 2634 LanguageError::New(String::Handle(String::New(chars)))); | 2635 LanguageError::New(String::Handle(String::New(chars)))); |
| 2635 Isolate::Current()->long_jump_base()->Jump(1, error); | 2636 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2636 } | 2637 } |
| 2637 | 2638 |
| 2638 | 2639 |
| 2639 } // namespace dart | 2640 } // namespace dart |
| OLD | NEW |