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/compiler.h" | 7 #include "vm/compiler.h" |
8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 #include "vm/flow_graph.h" | 10 #include "vm/flow_graph.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 FlowGraph* flow_graph_; | 366 FlowGraph* flow_graph_; |
367 BlockEntryInstr* entry_; | 367 BlockEntryInstr* entry_; |
368 Instruction* current_; | 368 Instruction* current_; |
369 }; | 369 }; |
370 | 370 |
371 | 371 |
372 static void PrepareIndexedOp(BlockBuilder* builder, | 372 static void PrepareIndexedOp(BlockBuilder* builder, |
373 Definition* array, | 373 Definition* array, |
374 Definition* index, | 374 Definition* index, |
375 intptr_t length_offset) { | 375 intptr_t length_offset) { |
376 TokenPosition token_pos = builder->TokenPos(); | |
377 builder->AddInstruction( | |
378 new CheckSmiInstr(new Value(index), | |
379 Thread::kNoDeoptId, | |
380 token_pos)); | |
381 | |
382 Definition* length = builder->AddDefinition( | 376 Definition* length = builder->AddDefinition( |
383 new LoadFieldInstr(new Value(array), | 377 new LoadFieldInstr(new Value(array), |
384 length_offset, | 378 length_offset, |
385 Type::ZoneHandle(Type::SmiType()), | 379 Type::ZoneHandle(Type::SmiType()), |
386 TokenPosition::kNoSource)); | 380 TokenPosition::kNoSource)); |
387 builder->AddInstruction( | 381 builder->AddInstruction( |
388 new CheckArrayBoundInstr(new Value(length), | 382 new CheckArrayBoundInstr(new Value(length), |
389 new Value(index), | 383 new Value(index), |
390 Thread::kNoDeoptId)); | 384 Thread::kNoDeoptId)); |
391 } | 385 } |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 TargetEntryInstr* normal_entry = graph_entry->normal_entry(); | 1227 TargetEntryInstr* normal_entry = graph_entry->normal_entry(); |
1234 BlockBuilder builder(flow_graph, normal_entry); | 1228 BlockBuilder builder(flow_graph, normal_entry); |
1235 | 1229 |
1236 return BuildInvokeMathCFunction(&builder, | 1230 return BuildInvokeMathCFunction(&builder, |
1237 MethodRecognizer::kDoubleRound); | 1231 MethodRecognizer::kDoubleRound); |
1238 } | 1232 } |
1239 #endif // !defined(TARGET_ARCH_DBC) | 1233 #endif // !defined(TARGET_ARCH_DBC) |
1240 | 1234 |
1241 | 1235 |
1242 } // namespace dart | 1236 } // namespace dart |
OLD | NEW |