OLD | NEW |
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" | 5 #include "vm/globals.h" |
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/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 __ lw(T3, Address(T1)); | 414 __ lw(T3, Address(T1)); |
415 __ addiu(A1, A1, Immediate(-Smi::RawValue(1))); | 415 __ addiu(A1, A1, Immediate(-Smi::RawValue(1))); |
416 __ addiu(T1, T1, Immediate(-kWordSize)); | 416 __ addiu(T1, T1, Immediate(-kWordSize)); |
417 __ addiu(T2, T2, Immediate(kWordSize)); | 417 __ addiu(T2, T2, Immediate(kWordSize)); |
418 __ bgez(A1, &loop); | 418 __ bgez(A1, &loop); |
419 __ delay_slot()->sw(T3, Address(T2, -kWordSize)); | 419 __ delay_slot()->sw(T3, Address(T2, -kWordSize)); |
420 __ Bind(&loop_exit); | 420 __ Bind(&loop_exit); |
421 } | 421 } |
422 | 422 |
423 | 423 |
424 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame, | |
425 intptr_t deopt_reason, | |
426 uword saved_registers_address); | |
427 | |
428 DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp); | |
429 | |
430 | |
431 // Used by eager and lazy deoptimization. Preserve result in V0 if necessary. | 424 // Used by eager and lazy deoptimization. Preserve result in V0 if necessary. |
432 // This stub translates optimized frame into unoptimized frame. The optimized | 425 // This stub translates optimized frame into unoptimized frame. The optimized |
433 // frame can contain values in registers and on stack, the unoptimized | 426 // frame can contain values in registers and on stack, the unoptimized |
434 // frame contains all values on stack. | 427 // frame contains all values on stack. |
435 // Deoptimization occurs in following steps: | 428 // Deoptimization occurs in following steps: |
436 // - Push all registers that can contain values. | 429 // - Push all registers that can contain values. |
437 // - Call C routine to copy the stack and saved registers into temporary buffer. | 430 // - Call C routine to copy the stack and saved registers into temporary buffer. |
438 // - Adjust caller's frame to correct unoptimized frame size. | 431 // - Adjust caller's frame to correct unoptimized frame size. |
439 // - Fill the unoptimized frame. | 432 // - Fill the unoptimized frame. |
440 // - Materialize objects that require allocation (e.g. Double instances). | 433 // - Materialize objects that require allocation (e.g. Double instances). |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. | 1043 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. |
1051 __ lw(V0, Address(SP, 1 * kWordSize)); // Get the new context. | 1044 __ lw(V0, Address(SP, 1 * kWordSize)); // Get the new context. |
1052 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Pop argument and return. | 1045 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Pop argument and return. |
1053 | 1046 |
1054 // V0: new object | 1047 // V0: new object |
1055 // Restore the frame pointer. | 1048 // Restore the frame pointer. |
1056 __ LeaveStubFrameAndReturn(); | 1049 __ LeaveStubFrameAndReturn(); |
1057 } | 1050 } |
1058 | 1051 |
1059 | 1052 |
1060 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); | |
1061 | |
1062 | |
1063 // Helper stub to implement Assembler::StoreIntoObject. | 1053 // Helper stub to implement Assembler::StoreIntoObject. |
1064 // Input parameters: | 1054 // Input parameters: |
1065 // T0: Address (i.e. object) being stored into. | 1055 // T0: Address (i.e. object) being stored into. |
1066 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { | 1056 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { |
1067 // Save values being destroyed. | 1057 // Save values being destroyed. |
1068 __ Comment("UpdateStoreBufferStub"); | 1058 __ Comment("UpdateStoreBufferStub"); |
1069 __ addiu(SP, SP, Immediate(-3 * kWordSize)); | 1059 __ addiu(SP, SP, Immediate(-3 * kWordSize)); |
1070 __ sw(T3, Address(SP, 2 * kWordSize)); | 1060 __ sw(T3, Address(SP, 2 * kWordSize)); |
1071 __ sw(T2, Address(SP, 1 * kWordSize)); | 1061 __ sw(T2, Address(SP, 1 * kWordSize)); |
1072 __ sw(T1, Address(SP, 0 * kWordSize)); | 1062 __ sw(T1, Address(SP, 0 * kWordSize)); |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 __ lw(S4, Address(SP, 2 * kWordSize)); // Restore argument descriptor. | 2073 __ lw(S4, Address(SP, 2 * kWordSize)); // Restore argument descriptor. |
2084 __ addiu(SP, SP, Immediate(3 * kWordSize)); // Discard argument. | 2074 __ addiu(SP, SP, Immediate(3 * kWordSize)); // Discard argument. |
2085 | 2075 |
2086 __ lw(T0, FieldAddress(T0, Code::instructions_offset())); | 2076 __ lw(T0, FieldAddress(T0, Code::instructions_offset())); |
2087 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); | 2077 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); |
2088 __ LeaveStubFrameAndReturn(T0); | 2078 __ LeaveStubFrameAndReturn(T0); |
2089 __ break_(0); | 2079 __ break_(0); |
2090 } | 2080 } |
2091 | 2081 |
2092 | 2082 |
2093 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, | |
2094 BigintCompare, | |
2095 RawBigint* left, | |
2096 RawBigint* right); | |
2097 | |
2098 | |
2099 // Does identical check (object references are equal or not equal) with special | 2083 // Does identical check (object references are equal or not equal) with special |
2100 // checks for boxed numbers. | 2084 // checks for boxed numbers. |
2101 // Returns: CMPRES1 is zero if equal, non-zero otherwise. | 2085 // Returns: CMPRES1 is zero if equal, non-zero otherwise. |
2102 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint | 2086 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint |
2103 // cannot contain a value that fits in Mint or Smi. | 2087 // cannot contain a value that fits in Mint or Smi. |
2104 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, | 2088 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, |
2105 const Register left, | 2089 const Register left, |
2106 const Register right, | 2090 const Register right, |
2107 const Register temp1, | 2091 const Register temp1, |
2108 const Register temp2) { | 2092 const Register temp2) { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 // Result: | 2268 // Result: |
2285 // T1: entry point. | 2269 // T1: entry point. |
2286 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2270 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2287 EmitMegamorphicLookup(assembler, T0, T1, T1); | 2271 EmitMegamorphicLookup(assembler, T0, T1, T1); |
2288 __ Ret(); | 2272 __ Ret(); |
2289 } | 2273 } |
2290 | 2274 |
2291 } // namespace dart | 2275 } // namespace dart |
2292 | 2276 |
2293 #endif // defined TARGET_ARCH_MIPS | 2277 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |