mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:41:24 +00:00
Changes to run "Hello, world!" on MIPS hardware.
R=regis@google.com Review URL: https://codereview.chromium.org//16160013 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23484 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
95692ea5d6
commit
e6cf04a8bb
|
@ -54,7 +54,7 @@
|
|||
// On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
|
||||
#if defined(_M_X64) || defined(__x86_64__) || \
|
||||
defined(__ARMEL__) || \
|
||||
defined(_MIPS_ARCH_MIPS32R2)
|
||||
defined(_MIPS_ARCH_MIPS32)
|
||||
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
|
||||
#elif defined(_M_IX86) || defined(__i386__)
|
||||
#if defined(_WIN32)
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
|
||||
namespace dart {
|
||||
|
||||
#if defined(USING_SIMULATOR)
|
||||
DECLARE_FLAG(bool, trace_sim);
|
||||
#endif
|
||||
DEFINE_FLAG(bool, print_stop_message, false, "Print stop message.");
|
||||
|
||||
|
||||
|
@ -575,7 +577,9 @@ void Assembler::Stop(const char* message) {
|
|||
|
||||
|
||||
void Assembler::TraceSimMsg(const char* message) {
|
||||
// Don't bother adding in the messages unless tracing is enabled.
|
||||
// Don't bother adding in the messages unless tracing is enabled, and we are
|
||||
// running in the simulator.
|
||||
#if defined(USING_SIMULATOR)
|
||||
if (FLAG_trace_sim) {
|
||||
Label msg;
|
||||
b(&msg);
|
||||
|
@ -583,6 +587,7 @@ void Assembler::TraceSimMsg(const char* message) {
|
|||
Bind(&msg);
|
||||
break_(Instr::kMsgMessageCode);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
|
|
@ -803,6 +803,7 @@ class Assembler : public ValueObject {
|
|||
}
|
||||
|
||||
void AddImmediate(Register rd, Register rs, int32_t value) {
|
||||
if (value == 0) return;
|
||||
if (Utils::IsInt(kImmBits, value)) {
|
||||
addiu(rd, rs, Immediate(value));
|
||||
} else {
|
||||
|
|
|
@ -62,7 +62,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
|
|||
// Reserve space for arguments and align frame before entering C++ world.
|
||||
// NativeArguments are passed in registers.
|
||||
ASSERT(sizeof(NativeArguments) == 4 * kWordSize);
|
||||
__ ReserveAlignedFrameSpace(0);
|
||||
__ ReserveAlignedFrameSpace(4 * kWordSize); // Reserve space for arguments.
|
||||
|
||||
// Pass NativeArguments structure by value and call runtime.
|
||||
// Registers A0, A1, A2, and A3 are used.
|
||||
|
@ -161,11 +161,6 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
|
|||
// Cache Isolate pointer into CTX while executing native code.
|
||||
__ mov(CTX, A0);
|
||||
|
||||
// Reserve space for the native arguments structure passed on the stack (the
|
||||
// outgoing pointer parameter to the native arguments structure is passed in
|
||||
// R0) and align frame before entering the C++ world.
|
||||
__ ReserveAlignedFrameSpace(sizeof(NativeArguments));
|
||||
|
||||
// Initialize NativeArguments structure and call native function.
|
||||
// Registers A0, A1, A2, and A3 are used.
|
||||
|
||||
|
@ -191,10 +186,12 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
|
|||
__ sw(A2, Address(SP, 2 * kWordSize));
|
||||
__ sw(A1, Address(SP, 1 * kWordSize));
|
||||
__ sw(A0, Address(SP, 0 * kWordSize));
|
||||
__ mov(A0, SP); // Pass the pointer to the NativeArguments.
|
||||
|
||||
__ ReserveAlignedFrameSpace(kWordSize); // Just passing A0.
|
||||
|
||||
// Call native function or redirection via simulator.
|
||||
__ jalr(T5);
|
||||
__ delay_slot()->mov(A0, SP); // Pass the pointer to the NativeArguments.
|
||||
__ TraceSimMsg("CallNativeCFunctionStub return");
|
||||
|
||||
// Reset exit frame information in Isolate structure.
|
||||
|
@ -1478,7 +1475,7 @@ void StubCode::GenerateUsageCounterIncrement(Assembler* assembler,
|
|||
|
||||
|
||||
// Generate inline cache check for 'num_args'.
|
||||
// AR: return address
|
||||
// RA: return address
|
||||
// S5: Inline cache data object.
|
||||
// S4: Arguments descriptor array.
|
||||
// Control flow:
|
||||
|
|
|
@ -69,11 +69,18 @@
|
|||
},
|
||||
|
||||
'Dart_mips_Base': {
|
||||
'cflags': [
|
||||
'-march=mips32r2',
|
||||
'-mhard-float',
|
||||
'-fno-strict-overflow',
|
||||
],
|
||||
'target_conditions': [
|
||||
['_toolset=="target"', {
|
||||
'cflags': [
|
||||
'-march=mips32',
|
||||
'-mhard-float',
|
||||
'-fno-strict-overflow',
|
||||
],
|
||||
}],
|
||||
['_toolset=="host"',{
|
||||
'cflags': [ '-O3', '-m32', '-msse2' ],
|
||||
'ldflags': [ '-m32' ],
|
||||
}]]
|
||||
},
|
||||
|
||||
'Dart_Debug': {
|
||||
|
|
Loading…
Reference in a new issue