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

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

Issue 2149023002: VM: Array bounds checks that don't deoptimize for precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 5 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
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
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 // 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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698