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

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

Issue 2856543002: Use off-heap data for class check instructions (Closed)
Patch Set: Created 3 years, 7 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
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 rep = kUnboxedInt32x4; 525 rep = kUnboxedInt32x4;
526 break; 526 break;
527 case kTypedDataFloat64x2ArrayCid: 527 case kTypedDataFloat64x2ArrayCid:
528 value_check_cid = kFloat64x2Cid; 528 value_check_cid = kFloat64x2Cid;
529 rep = kUnboxedFloat64x2; 529 rep = kUnboxedFloat64x2;
530 break; 530 break;
531 default: 531 default:
532 // Float32/Float64 case already handled. 532 // Float32/Float64 case already handled.
533 break; 533 break;
534 } 534 }
535 const ICData& value_check = ICData::ZoneHandle( 535 Zone* zone = flow_graph->zone();
536 ICData::New(flow_graph->function(), 536 CallTargets* value_check = new (zone) CallTargets();
537 Symbols::Empty(), // Dummy function name. 537 value_check->Add(CidRangeTarget(value_check_cid, value_check_cid,
538 Object::empty_array(), // Dummy args. descr. 538 &flow_graph->function(), 1));
539 Thread::kNoDeoptId, 1, false));
540 value_check.AddReceiverCheck(value_check_cid, flow_graph->function());
541 builder.AddInstruction( 539 builder.AddInstruction(
542 new CheckClassInstr(new Value(value), Thread::kNoDeoptId, value_check, 540 new CheckClassInstr(new Value(value), Thread::kNoDeoptId,
543 builder.TokenPos())); 541 *value_check, builder.TokenPos()));
544 value = builder.AddUnboxInstr(rep, new Value(value), 542 value = builder.AddUnboxInstr(rep, new Value(value),
545 /* is_checked = */ true); 543 /* is_checked = */ true);
546 if (array_cid == kTypedDataFloat32ArrayCid) { 544 if (array_cid == kTypedDataFloat32ArrayCid) {
547 value = builder.AddDefinition( 545 value = builder.AddDefinition(
548 new DoubleToFloatInstr(new Value(value), Thread::kNoDeoptId)); 546 new DoubleToFloatInstr(new Value(value), Thread::kNoDeoptId));
549 } 547 }
550 break; 548 break;
551 } 549 }
552 default: 550 default:
553 UNREACHABLE(); 551 UNREACHABLE();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 721
724 bool Intrinsifier::Build_ExternalTwoByteStringCodeUnitAt( 722 bool Intrinsifier::Build_ExternalTwoByteStringCodeUnitAt(
725 FlowGraph* flow_graph) { 723 FlowGraph* flow_graph) {
726 return BuildCodeUnitAt(flow_graph, kExternalTwoByteStringCid); 724 return BuildCodeUnitAt(flow_graph, kExternalTwoByteStringCid);
727 } 725 }
728 726
729 727
730 static bool BuildBinaryFloat32x4Op(FlowGraph* flow_graph, Token::Kind kind) { 728 static bool BuildBinaryFloat32x4Op(FlowGraph* flow_graph, Token::Kind kind) {
731 if (!FlowGraphCompiler::SupportsUnboxedSimd128()) return false; 729 if (!FlowGraphCompiler::SupportsUnboxedSimd128()) return false;
732 730
731 Zone* zone = flow_graph->zone();
733 GraphEntryInstr* graph_entry = flow_graph->graph_entry(); 732 GraphEntryInstr* graph_entry = flow_graph->graph_entry();
734 TargetEntryInstr* normal_entry = graph_entry->normal_entry(); 733 TargetEntryInstr* normal_entry = graph_entry->normal_entry();
735 BlockBuilder builder(flow_graph, normal_entry); 734 BlockBuilder builder(flow_graph, normal_entry);
736 735
737 Definition* right = builder.AddParameter(1); 736 Definition* right = builder.AddParameter(1);
738 Definition* left = builder.AddParameter(2); 737 Definition* left = builder.AddParameter(2);
739 738
740 const ICData& value_check = ICData::ZoneHandle(ICData::New( 739 CallTargets* value_check = new (zone) CallTargets();
741 flow_graph->function(), String::Handle(flow_graph->function().name()), 740 value_check->Add(
742 Object::empty_array(), // Dummy args. descr. 741 CidRangeTarget(kFloat32x4Cid, kFloat32x4Cid, &flow_graph->function(), 1));
743 Thread::kNoDeoptId, 1, false));
744 value_check.AddReceiverCheck(kFloat32x4Cid, flow_graph->function());
745 // Check argument. Receiver (left) is known to be a Float32x4. 742 // Check argument. Receiver (left) is known to be a Float32x4.
746 builder.AddInstruction(new CheckClassInstr( 743 builder.AddInstruction(new CheckClassInstr(
747 new Value(right), Thread::kNoDeoptId, value_check, builder.TokenPos())); 744 new Value(right), Thread::kNoDeoptId, *value_check, builder.TokenPos()));
748 Definition* left_simd = 745 Definition* left_simd =
749 builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(left), 746 builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(left),
750 /* is_checked = */ true); 747 /* is_checked = */ true);
751 748
752 Definition* right_simd = 749 Definition* right_simd =
753 builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(right), 750 builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(right),
754 /* is_checked = */ true); 751 /* is_checked = */ true);
755 752
756 Definition* unboxed_result = builder.AddDefinition(new BinaryFloat32x4OpInstr( 753 Definition* unboxed_result = builder.AddDefinition(new BinaryFloat32x4OpInstr(
757 kind, new Value(left_simd), new Value(right_simd), Thread::kNoDeoptId)); 754 kind, new Value(left_simd), new Value(right_simd), Thread::kNoDeoptId));
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 } 936 }
940 937
941 938
942 bool Intrinsifier::Build_GrowableArraySetData(FlowGraph* flow_graph) { 939 bool Intrinsifier::Build_GrowableArraySetData(FlowGraph* flow_graph) {
943 GraphEntryInstr* graph_entry = flow_graph->graph_entry(); 940 GraphEntryInstr* graph_entry = flow_graph->graph_entry();
944 TargetEntryInstr* normal_entry = graph_entry->normal_entry(); 941 TargetEntryInstr* normal_entry = graph_entry->normal_entry();
945 BlockBuilder builder(flow_graph, normal_entry); 942 BlockBuilder builder(flow_graph, normal_entry);
946 943
947 Definition* data = builder.AddParameter(1); 944 Definition* data = builder.AddParameter(1);
948 Definition* growable_array = builder.AddParameter(2); 945 Definition* growable_array = builder.AddParameter(2);
946 Zone* zone = flow_graph->zone();
949 947
950 const ICData& value_check = ICData::ZoneHandle(ICData::New( 948 CallTargets* value_check = new (zone) CallTargets();
951 flow_graph->function(), String::Handle(flow_graph->function().name()), 949 value_check->Add(
952 Object::empty_array(), // Dummy args. descr. 950 CidRangeTarget(kArrayCid, kArrayCid, &flow_graph->function(), 1));
953 Thread::kNoDeoptId, 1, false));
954 value_check.AddReceiverCheck(kArrayCid, flow_graph->function());
955 builder.AddInstruction(new CheckClassInstr( 951 builder.AddInstruction(new CheckClassInstr(
956 new Value(data), Thread::kNoDeoptId, value_check, builder.TokenPos())); 952 new Value(data), Thread::kNoDeoptId, *value_check, builder.TokenPos()));
957 953
958 builder.AddInstruction(new StoreInstanceFieldInstr( 954 builder.AddInstruction(new StoreInstanceFieldInstr(
959 GrowableObjectArray::data_offset(), new Value(growable_array), 955 GrowableObjectArray::data_offset(), new Value(growable_array),
960 new Value(data), kEmitStoreBarrier, builder.TokenPos())); 956 new Value(data), kEmitStoreBarrier, builder.TokenPos()));
961 // Return null. 957 // Return null.
962 Definition* null_def = builder.AddNullDefinition(); 958 Definition* null_def = builder.AddNullDefinition();
963 builder.AddIntrinsicReturn(new Value(null_def)); 959 builder.AddIntrinsicReturn(new Value(null_def));
964 return true; 960 return true;
965 } 961 }
966 962
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 } 1177 }
1182 1178
1183 1179
1184 void Intrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler) { 1180 void Intrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler) {
1185 IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/true); 1181 IntrinsifyRegExpExecuteMatch(assembler, /*sticky=*/true);
1186 } 1182 }
1187 #endif // !defined(TARGET_ARCH_DBC) 1183 #endif // !defined(TARGET_ARCH_DBC)
1188 1184
1189 1185
1190 } // namespace dart 1186 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698