| 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 // Class for intrinsifying functions. | 4 // Class for intrinsifying functions. |
| 5 | 5 |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/intrinsifier.h" | 7 #include "vm/intrinsifier.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 | 175 |
| 176 void Intrinsifier::Intrinsify(ParsedFunction* parsed_function, | 176 void Intrinsifier::Intrinsify(ParsedFunction* parsed_function, |
| 177 FlowGraphCompiler* compiler) { | 177 FlowGraphCompiler* compiler) { |
| 178 const Function& function = parsed_function->function(); | 178 const Function& function = parsed_function->function(); |
| 179 if (!CanIntrinsify(function)) { | 179 if (!CanIntrinsify(function)) { |
| 180 return; | 180 return; |
| 181 } | 181 } |
| 182 | 182 |
| 183 ASSERT(!compiler->flow_graph().IsCompiledForOsr()); |
| 183 if (GraphIntrinsify(parsed_function, compiler)) { | 184 if (GraphIntrinsify(parsed_function, compiler)) { |
| 184 return; | 185 return; |
| 185 } | 186 } |
| 186 | 187 |
| 187 #define EMIT_CASE(test_class_name, test_function_name, enum_name, fp) \ | 188 #define EMIT_CASE(test_class_name, test_function_name, enum_name, fp) \ |
| 188 case MethodRecognizer::k##enum_name: \ | 189 case MethodRecognizer::k##enum_name: \ |
| 189 ASSERT(function.CheckSourceFingerprint(fp)); \ | 190 ASSERT(function.CheckSourceFingerprint(fp)); \ |
| 190 compiler->assembler()->Comment("Intrinsic"); \ | 191 compiler->assembler()->Comment("Intrinsic"); \ |
| 191 enum_name(compiler->assembler()); \ | 192 enum_name(compiler->assembler()); \ |
| 192 break; | 193 break; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 new LoadFieldInstr(new Value(backing_store), | 558 new LoadFieldInstr(new Value(backing_store), |
| 558 Array::length_offset(), | 559 Array::length_offset(), |
| 559 Type::ZoneHandle(), | 560 Type::ZoneHandle(), |
| 560 builder.TokenPos())); | 561 builder.TokenPos())); |
| 561 builder.AddIntrinsicReturn(new Value(capacity)); | 562 builder.AddIntrinsicReturn(new Value(capacity)); |
| 562 return true; | 563 return true; |
| 563 } | 564 } |
| 564 | 565 |
| 565 | 566 |
| 566 } // namespace dart | 567 } // namespace dart |
| OLD | NEW |