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

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

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 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_arm_test.cc ('k') | runtime/vm/object_graph.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 (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 #if defined(TARGET_ARCH_DBC) 7 #if defined(TARGET_ARCH_DBC)
8 8
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
11 #include "vm/unit_test.h" 11 #include "vm/unit_test.h"
12 12
13 namespace dart { 13 namespace dart {
14 14
15 #define __ assembler-> 15 #define __ assembler->
16 16
17 // Generate a simple dart code sequence. 17 // Generate a simple dart code sequence.
18 // This is used to test Code and Instruction object creation. 18 // This is used to test Code and Instruction object creation.
19 // For other architectures, this sequence does do an increment, hence the name. 19 // For other architectures, this sequence does do an increment, hence the name.
20 // On DBC, we don't do an increment because generating an instance call here 20 // On DBC, we don't do an increment because generating an instance call here
21 // would be too complex. 21 // would be too complex.
22 void GenerateIncrement(Assembler* assembler) { 22 void GenerateIncrement(Assembler* assembler) {
23 __ Frame(1); 23 __ Frame(1);
24 __ LoadConstant(0, Smi::Handle(Smi::New(1))); 24 __ LoadConstant(0, Smi::Handle(Smi::New(1)));
25 __ Return(0); 25 __ Return(0);
26 } 26 }
27 27
28
29 // Generate a dart code sequence that embeds a string object in it. 28 // Generate a dart code sequence that embeds a string object in it.
30 // This is used to test Embedded String objects in the instructions. 29 // This is used to test Embedded String objects in the instructions.
31 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) { 30 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) {
32 const String& string_object = 31 const String& string_object =
33 String::ZoneHandle(String::New(str, Heap::kOld)); 32 String::ZoneHandle(String::New(str, Heap::kOld));
34 __ PushConstant(string_object); 33 __ PushConstant(string_object);
35 __ ReturnTOS(); 34 __ ReturnTOS();
36 } 35 }
37 36
38
39 // Generate a dart code sequence that embeds a smi object in it. 37 // Generate a dart code sequence that embeds a smi object in it.
40 // This is used to test Embedded Smi objects in the instructions. 38 // This is used to test Embedded Smi objects in the instructions.
41 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) { 39 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) {
42 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value)); 40 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value));
43 __ PushConstant(smi_object); 41 __ PushConstant(smi_object);
44 __ ReturnTOS(); 42 __ ReturnTOS();
45 } 43 }
46 44
47 } // namespace dart 45 } // namespace dart
48 46
49 #endif // defined TARGET_ARCH_DBC 47 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/object_arm_test.cc ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698