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

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

Issue 2858623002: Remove MIPS support (Closed)
Patch Set: Merge and cleanup Created 3 years, 6 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 | « runtime/vm/object.h ('k') | runtime/vm/os_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "platform/assert.h"
6 #include "vm/globals.h"
7 #if defined(TARGET_ARCH_MIPS)
8
9 #include "vm/assembler.h"
10 #include "vm/object.h"
11 #include "vm/unit_test.h"
12
13 namespace dart {
14
15 #define __ assembler->
16
17
18 // Generate a simple dart code sequence.
19 // This is used to test Code and Instruction object creation.
20 void GenerateIncrement(Assembler* assembler) {
21 __ Push(ZR);
22 __ lw(TMP, Address(SP, 0));
23 __ addiu(TMP, TMP, Immediate(1));
24 __ sw(TMP, Address(SP, 0));
25 __ lw(TMP, Address(SP, 0));
26 __ addiu(TMP, TMP, Immediate(1));
27 __ Pop(V0);
28 __ mov(V0, TMP);
29 __ Ret();
30 }
31
32
33 // Generate a dart code sequence that embeds a string object in it.
34 // This is used to test Embedded String objects in the instructions.
35 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) {
36 __ EnterDartFrame(0); // To setup pp.
37 const String& string_object =
38 String::ZoneHandle(String::New(str, Heap::kOld));
39 __ LoadObject(V0, string_object);
40 __ LeaveDartFrameAndReturn();
41 }
42
43
44 // Generate a dart code sequence that embeds a smi object in it.
45 // This is used to test Embedded Smi objects in the instructions.
46 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) {
47 // No need to setup pp, since Smis are not stored in the object pool.
48 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value));
49 __ LoadObject(V0, smi_object);
50 __ Ret();
51 }
52
53 } // namespace dart
54
55 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/os_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698