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

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

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added more comments. Created 5 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
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" 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/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); 2079 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry());
2080 EXPECT_FLOAT_EQ(-42.42, res, 0.001); 2080 EXPECT_FLOAT_EQ(-42.42, res, 0.001);
2081 } 2081 }
2082 2082
2083 2083
2084 // Called from assembler_test.cc. 2084 // Called from assembler_test.cc.
2085 // RA: return address. 2085 // RA: return address.
2086 // A0: context. 2086 // A0: context.
2087 // A1: value. 2087 // A1: value.
2088 // A2: growable array. 2088 // A2: growable array.
2089 // A3: current thread.
2089 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { 2090 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
2090 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 2091 __ addiu(SP, SP, Immediate(-3 * kWordSize));
2092 __ sw(THR, Address(SP, 2 * kWordSize));
2091 __ sw(CTX, Address(SP, 1 * kWordSize)); 2093 __ sw(CTX, Address(SP, 1 * kWordSize));
2092 __ sw(RA, Address(SP, 0 * kWordSize)); 2094 __ sw(RA, Address(SP, 0 * kWordSize));
2093
2094 __ mov(CTX, A0); 2095 __ mov(CTX, A0);
2096 __ mov(THR, A3);
2095 __ StoreIntoObject(A2, 2097 __ StoreIntoObject(A2,
2096 FieldAddress(A2, GrowableObjectArray::data_offset()), 2098 FieldAddress(A2, GrowableObjectArray::data_offset()),
2097 A1); 2099 A1);
2098 __ lw(RA, Address(SP, 0 * kWordSize)); 2100 __ lw(RA, Address(SP, 0 * kWordSize));
2099 __ lw(CTX, Address(SP, 1 * kWordSize)); 2101 __ lw(CTX, Address(SP, 1 * kWordSize));
2100 __ addiu(SP, SP, Immediate(2 * kWordSize)); 2102 __ lw(THR, Address(SP, 2 * kWordSize));
2103 __ addiu(SP, SP, Immediate(3 * kWordSize));
2101 __ Ret(); 2104 __ Ret();
2102 } 2105 }
2103 2106
2104 2107
2105 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) { 2108 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) {
2106 Label miss, done; 2109 Label miss, done;
2107 __ ComputeRange(V0, A0, &miss); 2110 __ ComputeRange(V0, A0, &miss);
2108 __ b(&done); 2111 __ b(&done);
2109 2112
2110 __ Bind(&miss); 2113 __ Bind(&miss);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 2152
2150 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); 2153 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw()));
2151 2154
2152 #undef RANGE_OF 2155 #undef RANGE_OF
2153 } 2156 }
2154 2157
2155 2158
2156 } // namespace dart 2159 } // namespace dart
2157 2160
2158 #endif // defined TARGET_ARCH_MIPS 2161 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698