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

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

Issue 21363003: Enables per-function far-branches for ARM and MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
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 <math.h> // for isnan. 5 #include <math.h> // for isnan.
6 #include <setjmp.h> 6 #include <setjmp.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #if defined(TARGET_ARCH_MIPS) 10 #if defined(TARGET_ARCH_MIPS)
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 if (redirection->call_kind() == kRuntimeCall) { 1015 if (redirection->call_kind() == kRuntimeCall) {
1016 NativeArguments arguments; 1016 NativeArguments arguments;
1017 ASSERT(sizeof(NativeArguments) == 4*kWordSize); 1017 ASSERT(sizeof(NativeArguments) == 4*kWordSize);
1018 arguments.isolate_ = reinterpret_cast<Isolate*>(get_register(A0)); 1018 arguments.isolate_ = reinterpret_cast<Isolate*>(get_register(A0));
1019 arguments.argc_tag_ = get_register(A1); 1019 arguments.argc_tag_ = get_register(A1);
1020 arguments.argv_ = reinterpret_cast<RawObject*(*)[]>(get_register(A2)); 1020 arguments.argv_ = reinterpret_cast<RawObject*(*)[]>(get_register(A2));
1021 arguments.retval_ = reinterpret_cast<RawObject**>(get_register(A3)); 1021 arguments.retval_ = reinterpret_cast<RawObject**>(get_register(A3));
1022 SimulatorRuntimeCall target = 1022 SimulatorRuntimeCall target =
1023 reinterpret_cast<SimulatorRuntimeCall>(external); 1023 reinterpret_cast<SimulatorRuntimeCall>(external);
1024 target(arguments); 1024 target(arguments);
1025 set_register(V0, icount_); // Zap result register from void function. 1025 set_register(V0, icount_); // Zap result registers from void function.
1026 set_register(V1, icount_);
1026 } else if (redirection->call_kind() == kLeafRuntimeCall) { 1027 } else if (redirection->call_kind() == kLeafRuntimeCall) {
1027 int32_t a0 = get_register(A0); 1028 int32_t a0 = get_register(A0);
1028 int32_t a1 = get_register(A1); 1029 int32_t a1 = get_register(A1);
1029 int32_t a2 = get_register(A2); 1030 int32_t a2 = get_register(A2);
1030 int32_t a3 = get_register(A3); 1031 int32_t a3 = get_register(A3);
1031 SimulatorLeafRuntimeCall target = 1032 SimulatorLeafRuntimeCall target =
1032 reinterpret_cast<SimulatorLeafRuntimeCall>(external); 1033 reinterpret_cast<SimulatorLeafRuntimeCall>(external);
1033 a0 = target(a0, a1, a2, a3); 1034 a0 = target(a0, a1, a2, a3);
1034 set_register(V0, a0); // Set returned result from function. 1035 set_register(V0, a0); // Set returned result from function.
1036 set_register(V1, icount_); // Zap second result register.
1035 } else if (redirection->call_kind() == kLeafFloatRuntimeCall) { 1037 } else if (redirection->call_kind() == kLeafFloatRuntimeCall) {
1036 ASSERT((0 <= redirection->argument_count()) && 1038 ASSERT((0 <= redirection->argument_count()) &&
1037 (redirection->argument_count() <= 2)); 1039 (redirection->argument_count() <= 2));
1038 // double values are passed and returned in floating point registers. 1040 // double values are passed and returned in floating point registers.
1039 SimulatorLeafFloatRuntimeCall target = 1041 SimulatorLeafFloatRuntimeCall target =
1040 reinterpret_cast<SimulatorLeafFloatRuntimeCall>(external); 1042 reinterpret_cast<SimulatorLeafFloatRuntimeCall>(external);
1041 double d0 = 0.0; 1043 double d0 = 0.0;
1042 double d6 = get_fregister_double(F12); 1044 double d6 = get_fregister_double(F12);
1043 double d7 = get_fregister_double(F14); 1045 double d7 = get_fregister_double(F14);
1044 d0 = target(d6, d7); 1046 d0 = target(d6, d7);
1045 set_fregister_double(F0, d0); 1047 set_fregister_double(F0, d0);
1046 } else { 1048 } else {
1047 ASSERT(redirection->call_kind() == kNativeCall); 1049 ASSERT(redirection->call_kind() == kNativeCall);
1048 NativeArguments* arguments; 1050 NativeArguments* arguments;
1049 arguments = reinterpret_cast<NativeArguments*>(get_register(A0)); 1051 arguments = reinterpret_cast<NativeArguments*>(get_register(A0));
1050 SimulatorNativeCall target = 1052 SimulatorNativeCall target =
1051 reinterpret_cast<SimulatorNativeCall>(external); 1053 reinterpret_cast<SimulatorNativeCall>(external);
1052 target(arguments); 1054 target(arguments);
1053 set_register(V0, icount_); // Zap result register from void function. 1055 set_register(V0, icount_); // Zap result register from void function.
1056 set_register(V1, icount_);
1054 } 1057 }
1055 set_top_exit_frame_info(0); 1058 set_top_exit_frame_info(0);
1056 1059
1057 // Zap caller-saved registers, since the actual runtime call could have 1060 // Zap caller-saved registers, since the actual runtime call could have
1058 // used them. 1061 // used them.
1059 set_register(T0, icount_); 1062 set_register(T0, icount_);
1060 set_register(T1, icount_); 1063 set_register(T1, icount_);
1061 set_register(T2, icount_); 1064 set_register(T2, icount_);
1062 set_register(T3, icount_); 1065 set_register(T3, icount_);
1063 set_register(T4, icount_); 1066 set_register(T4, icount_);
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
2231 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 2234 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
2232 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 2235 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
2233 buf->Longjmp(); 2236 buf->Longjmp();
2234 } 2237 }
2235 2238
2236 } // namespace dart 2239 } // namespace dart
2237 2240
2238 #endif // !defined(HOST_ARCH_MIPS) 2241 #endif // !defined(HOST_ARCH_MIPS)
2239 2242
2240 #endif // defined TARGET_ARCH_MIPS 2243 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698