| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/globals.h" | 6 #include "vm/globals.h" |
| 7 #if defined(TARGET_ARCH_MIPS) | 7 #if defined(TARGET_ARCH_MIPS) |
| 8 | 8 |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 | 32 |
| 33 // Generate a dart code sequence that embeds a string object in it. | 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. | 34 // This is used to test Embedded String objects in the instructions. |
| 35 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) { | 35 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) { |
| 36 __ EnterDartFrame(0); // To setup pp. | 36 __ EnterDartFrame(0); // To setup pp. |
| 37 const String& string_object = | 37 const String& string_object = |
| 38 String::ZoneHandle(String::New(str, Heap::kOld)); | 38 String::ZoneHandle(String::New(str, Heap::kOld)); |
| 39 __ LoadObject(V0, string_object); | 39 __ LoadObject(V0, string_object); |
| 40 __ LeaveDartFrame(); | 40 __ LeaveDartFrameAndReturn(); |
| 41 __ Ret(); | |
| 42 } | 41 } |
| 43 | 42 |
| 44 | 43 |
| 45 // Generate a dart code sequence that embeds a smi object in it. | 44 // Generate a dart code sequence that embeds a smi object in it. |
| 46 // This is used to test Embedded Smi objects in the instructions. | 45 // This is used to test Embedded Smi objects in the instructions. |
| 47 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) { | 46 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) { |
| 48 // No need to setup pp, since Smis are not stored in the object pool. | 47 // No need to setup pp, since Smis are not stored in the object pool. |
| 49 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value)); | 48 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value)); |
| 50 __ LoadObject(V0, smi_object); | 49 __ LoadObject(V0, smi_object); |
| 51 __ Ret(); | 50 __ Ret(); |
| 52 } | 51 } |
| 53 | 52 |
| 54 } // namespace dart | 53 } // namespace dart |
| 55 | 54 |
| 56 #endif // defined TARGET_ARCH_MIPS | 55 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |