| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 7 #if defined(TARGET_ARCH_ARM64) |
| 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 const String& string_object = | 36 const String& string_object = |
| 37 String::ZoneHandle(String::New(str, Heap::kOld)); | 37 String::ZoneHandle(String::New(str, Heap::kOld)); |
| 38 __ mov(SP, CSP); | 38 __ mov(SP, CSP); |
| 39 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. | 39 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 40 __ LoadPoolPointer(PP); | 40 __ LoadPoolPointer(); |
| 41 __ LoadObject(R0, string_object, PP); | 41 __ LoadObject(R0, string_object); |
| 42 __ set_constant_pool_allowed(false); |
| 42 __ PopAndUntagPP(); // Restore caller's pool pointer. | 43 __ PopAndUntagPP(); // Restore caller's pool pointer. |
| 43 __ ret(); | 44 __ ret(); |
| 44 } | 45 } |
| 45 | 46 |
| 46 | 47 |
| 47 // Generate a dart code sequence that embeds a smi object in it. | 48 // Generate a dart code sequence that embeds a smi object in it. |
| 48 // This is used to test Embedded Smi objects in the instructions. | 49 // This is used to test Embedded Smi objects in the instructions. |
| 49 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) { | 50 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) { |
| 50 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value)); | 51 const Smi& smi_object = Smi::ZoneHandle(Smi::New(value)); |
| 51 const int64_t val = reinterpret_cast<int64_t>(smi_object.raw()); | 52 const int64_t val = reinterpret_cast<int64_t>(smi_object.raw()); |
| 52 __ LoadImmediate(R0, val, kNoRegister); | 53 __ LoadImmediate(R0, val); |
| 53 __ ret(); | 54 __ ret(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace dart | 57 } // namespace dart |
| 57 | 58 |
| 58 #endif // defined TARGET_ARCH_ARM64 | 59 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |