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

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

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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/assembler_mips.h ('k') | runtime/vm/assembler_x64.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" // NOLINT 5 #include "vm/globals.h" // NOLINT
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 void Assembler::LeaveStubFrame() { 853 void Assembler::LeaveStubFrame() {
854 LeaveDartFrame(); 854 LeaveDartFrame();
855 } 855 }
856 856
857 857
858 void Assembler::LeaveStubFrameAndReturn(Register ra) { 858 void Assembler::LeaveStubFrameAndReturn(Register ra) {
859 LeaveDartFrameAndReturn(ra); 859 LeaveDartFrameAndReturn(ra);
860 } 860 }
861 861
862 862
863 void Assembler::NoMonomorphicCheckedEntry() {
864 buffer_.Reset();
865 break_(0);
866 break_(0);
867 break_(0);
868 break_(0);
869 ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
870 }
871
872
873 // T0 receiver, S5 guarded cid as Smi
874 void Assembler::MonomorphicCheckedEntry() {
875 bool saved_use_far_branches = use_far_branches();
876 set_use_far_branches(false);
877
878 Label have_cid, miss;
879 Bind(&miss);
880 lw(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
881 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset()));
882 jr(T9);
883
884 Comment("MonomorphicCheckedEntry");
885 ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
886 SmiUntag(S5);
887 LoadClassIdMayBeSmi(S4, T0);
888 bne(S4, S5, &miss);
889
890 // Fall through to unchecked entry.
891 ASSERT(CodeSize() == Instructions::kUncheckedEntryOffset);
892
893 set_use_far_branches(saved_use_far_branches);
894 }
895
896
863 #ifndef PRODUCT 897 #ifndef PRODUCT
864 void Assembler::MaybeTraceAllocation(intptr_t cid, 898 void Assembler::MaybeTraceAllocation(intptr_t cid,
865 Register temp_reg, 899 Register temp_reg,
866 Label* trace) { 900 Label* trace) {
867 ASSERT(cid > 0); 901 ASSERT(cid > 0);
868 ASSERT(!in_delay_slot_); 902 ASSERT(!in_delay_slot_);
869 ASSERT(temp_reg != kNoRegister); 903 ASSERT(temp_reg != kNoRegister);
870 ASSERT(temp_reg != TMP); 904 ASSERT(temp_reg != TMP);
871 intptr_t state_offset = ClassTable::StateOffsetFor(cid); 905 intptr_t state_offset = ClassTable::StateOffsetFor(cid);
872 LoadIsolate(temp_reg); 906 LoadIsolate(temp_reg);
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 Label stop; 1299 Label stop;
1266 b(&stop); 1300 b(&stop);
1267 Emit(reinterpret_cast<int32_t>(message)); 1301 Emit(reinterpret_cast<int32_t>(message));
1268 Bind(&stop); 1302 Bind(&stop);
1269 break_(Instr::kStopMessageCode); 1303 break_(Instr::kStopMessageCode);
1270 } 1304 }
1271 1305
1272 } // namespace dart 1306 } // namespace dart
1273 1307
1274 #endif // defined TARGET_ARCH_MIPS 1308 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698