| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 definition_->set_use_list(this); | 62 definition_->set_use_list(this); |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 MethodRecognizer::Kind MethodRecognizer::RecognizeKind( | 66 MethodRecognizer::Kind MethodRecognizer::RecognizeKind( |
| 67 const Function& function) { | 67 const Function& function) { |
| 68 // Only core library methods can be recognized. | 68 // Only core library methods can be recognized. |
| 69 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 69 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 70 const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary()); | 70 const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary()); |
| 71 const Class& function_class = Class::Handle(function.owner()); | 71 const Class& function_class = Class::Handle(function.Owner()); |
| 72 if ((function_class.library() != core_lib.raw()) && | 72 if ((function_class.library() != core_lib.raw()) && |
| 73 (function_class.library() != core_impl_lib.raw())) { | 73 (function_class.library() != core_impl_lib.raw())) { |
| 74 return kUnknown; | 74 return kUnknown; |
| 75 } | 75 } |
| 76 const String& recognize_name = String::Handle(function.name()); | 76 const String& recognize_name = String::Handle(function.name()); |
| 77 const String& recognize_class = String::Handle(function_class.Name()); | 77 const String& recognize_class = String::Handle(function_class.Name()); |
| 78 String& test_function_name = String::Handle(); | 78 String& test_function_name = String::Handle(); |
| 79 String& test_class_name = String::Handle(); | 79 String& test_class_name = String::Handle(); |
| 80 #define RECOGNIZE_FUNCTION(class_name, function_name, enum_name) \ | 80 #define RECOGNIZE_FUNCTION(class_name, function_name, enum_name) \ |
| 81 test_function_name = Symbols::New(#function_name); \ | 81 test_function_name = Symbols::New(#function_name); \ |
| (...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 value_reg); | 1249 value_reg); |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 | 1252 |
| 1253 LocationSummary* AllocateObjectComp::MakeLocationSummary() const { | 1253 LocationSummary* AllocateObjectComp::MakeLocationSummary() const { |
| 1254 return MakeCallSummary(); | 1254 return MakeCallSummary(); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 | 1257 |
| 1258 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1258 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1259 const Class& cls = Class::ZoneHandle(constructor().owner()); | 1259 const Class& cls = Class::ZoneHandle(constructor().Owner()); |
| 1260 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls)); | 1260 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls)); |
| 1261 const ExternalLabel label(cls.ToCString(), stub.EntryPoint()); | 1261 const ExternalLabel label(cls.ToCString(), stub.EntryPoint()); |
| 1262 compiler->GenerateCall(token_pos(), | 1262 compiler->GenerateCall(token_pos(), |
| 1263 try_index(), | 1263 try_index(), |
| 1264 &label, | 1264 &label, |
| 1265 PcDescriptors::kOther); | 1265 PcDescriptors::kOther); |
| 1266 __ Drop(ArgumentCount()); // Discard arguments. | 1266 __ Drop(ArgumentCount()); // Discard arguments. |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 | 1269 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 if (compiler->is_ssa()) { | 1303 if (compiler->is_ssa()) { |
| 1304 ASSERT(locs()->in(0).IsRegister()); | 1304 ASSERT(locs()->in(0).IsRegister()); |
| 1305 __ PushRegister(locs()->in(0).reg()); | 1305 __ PushRegister(locs()->in(0).reg()); |
| 1306 } | 1306 } |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 | 1309 |
| 1310 #undef __ | 1310 #undef __ |
| 1311 | 1311 |
| 1312 } // namespace dart | 1312 } // namespace dart |
| OLD | NEW |