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

Side by Side Diff: src/mips/simulator-mips.cc

Issue 7042031: MIPS: Minor fixes to simulator and builtins-mips. (Closed)
Patch Set: Rebased on r7964, updated for recent commits. Created 9 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
« no previous file with comments | « src/mips/simulator-mips.h ('k') | src/mips/stub-cache-mips.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 int32_t arg3, 1158 int32_t arg3,
1159 int32_t arg4, 1159 int32_t arg4,
1160 int32_t arg5); 1160 int32_t arg5);
1161 typedef double (*SimulatorRuntimeFPCall)(int32_t arg0, 1161 typedef double (*SimulatorRuntimeFPCall)(int32_t arg0,
1162 int32_t arg1, 1162 int32_t arg1,
1163 int32_t arg2, 1163 int32_t arg2,
1164 int32_t arg3); 1164 int32_t arg3);
1165 1165
1166 // This signature supports direct call in to API function native callback 1166 // This signature supports direct call in to API function native callback
1167 // (refer to InvocationCallback in v8.h). 1167 // (refer to InvocationCallback in v8.h).
1168 typedef v8::Handle<v8::Value> (*SimulatorRuntimeApiCall)(int32_t arg0); 1168 typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectApiCall)(int32_t arg0);
1169
1170 // This signature supports direct call to accessor getter callback.
1171 typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectGetterCall)(int32_t arg0,
1172 int32_t arg1);
1169 1173
1170 // Software interrupt instructions are used by the simulator to call into the 1174 // Software interrupt instructions are used by the simulator to call into the
1171 // C-based V8 runtime. They are also used for debugging with simulator. 1175 // C-based V8 runtime. They are also used for debugging with simulator.
1172 void Simulator::SoftwareInterrupt(Instruction* instr) { 1176 void Simulator::SoftwareInterrupt(Instruction* instr) {
1173 // There are several instructions that could get us here, 1177 // There are several instructions that could get us here,
1174 // the break_ instruction, or several variants of traps. All 1178 // the break_ instruction, or several variants of traps. All
1175 // Are "SPECIAL" class opcode, and are distinuished by function. 1179 // Are "SPECIAL" class opcode, and are distinuished by function.
1176 int32_t func = instr->FunctionFieldRaw(); 1180 int32_t func = instr->FunctionFieldRaw();
1177 int32_t code = (func == BREAK) ? instr->Bits(25, 6) : -1; 1181 int32_t code = (func == BREAK) ? instr->Bits(25, 6) : -1;
1178 1182
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 arg2, 1237 arg2,
1234 arg3); 1238 arg3);
1235 } 1239 }
1236 double result = target(arg0, arg1, arg2, arg3); 1240 double result = target(arg0, arg1, arg2, arg3);
1237 // fp result -> registers v0 and v1. 1241 // fp result -> registers v0 and v1.
1238 int32_t gpreg_pair[2]; 1242 int32_t gpreg_pair[2];
1239 memcpy(&gpreg_pair[0], &result, 2 * sizeof(int32_t)); 1243 memcpy(&gpreg_pair[0], &result, 2 * sizeof(int32_t));
1240 set_register(v0, gpreg_pair[0]); 1244 set_register(v0, gpreg_pair[0]);
1241 set_register(v1, gpreg_pair[1]); 1245 set_register(v1, gpreg_pair[1]);
1242 } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) { 1246 } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
1243 SimulatorRuntimeApiCall target = 1247 // See DirectCEntryStub::GenerateCall for explanation of register usage.
1244 reinterpret_cast<SimulatorRuntimeApiCall>(external); 1248 SimulatorRuntimeDirectApiCall target =
1249 reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
1245 if (::v8::internal::FLAG_trace_sim) { 1250 if (::v8::internal::FLAG_trace_sim) {
1246 PrintF("Call to host function at %p args %08x\n", 1251 PrintF("Call to host function at %p args %08x\n",
1247 FUNCTION_ADDR(target), 1252 FUNCTION_ADDR(target), arg1);
1248 arg0);
1249 } 1253 }
1250 v8::Handle<v8::Value> result = target(arg0); 1254 v8::Handle<v8::Value> result = target(arg1);
1251 set_register(v0, (int32_t) *result); 1255 *(reinterpret_cast<int*>(arg0)) = (int32_t) *result;
1256 set_register(v0, arg0);
1257 } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
1258 // See DirectCEntryStub::GenerateCall for explanation of register usage.
1259 SimulatorRuntimeDirectGetterCall target =
1260 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
1261 if (::v8::internal::FLAG_trace_sim) {
1262 PrintF("Call to host function at %p args %08x %08x\n",
1263 FUNCTION_ADDR(target), arg1, arg2);
1264 }
1265 v8::Handle<v8::Value> result = target(arg1, arg2);
1266 *(reinterpret_cast<int*>(arg0)) = (int32_t) *result;
1267 set_register(v0, arg0);
1252 } else { 1268 } else {
1253 SimulatorRuntimeCall target = 1269 SimulatorRuntimeCall target =
1254 reinterpret_cast<SimulatorRuntimeCall>(external); 1270 reinterpret_cast<SimulatorRuntimeCall>(external);
1255 if (::v8::internal::FLAG_trace_sim) { 1271 if (::v8::internal::FLAG_trace_sim) {
1256 PrintF( 1272 PrintF(
1257 "Call to host function at %p " 1273 "Call to host function at %p "
1258 "args %08x, %08x, %08x, %08x, %08x, %08x\n", 1274 "args %08x, %08x, %08x, %08x, %08x, %08x\n",
1259 FUNCTION_ADDR(target), 1275 FUNCTION_ADDR(target),
1260 arg0, 1276 arg0,
1261 arg1, 1277 arg1,
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 } 2462 }
2447 2463
2448 2464
2449 #undef UNSUPPORTED 2465 #undef UNSUPPORTED
2450 2466
2451 } } // namespace v8::internal 2467 } } // namespace v8::internal
2452 2468
2453 #endif // USE_SIMULATOR 2469 #endif // USE_SIMULATOR
2454 2470
2455 #endif // V8_TARGET_ARCH_MIPS 2471 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/simulator-mips.h ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698