| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler_macros.h" | 8 #include "vm/assembler_macros.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 uword tags = 0; | 54 uword tags = 0; |
| 55 tags = RawObject::SizeTag::update(instance_size, tags); | 55 tags = RawObject::SizeTag::update(instance_size, tags); |
| 56 ASSERT(cls.index() != kIllegalObjectKind); | 56 ASSERT(cls.index() != kIllegalObjectKind); |
| 57 tags = RawObject::ClassTag::update(cls.index(), tags); | 57 tags = RawObject::ClassTag::update(cls.index(), tags); |
| 58 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); | 58 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags)); |
| 59 } else { | 59 } else { |
| 60 __ jmp(failure); | 60 __ jmp(failure); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 |
| 65 void AssemblerMacros::EnterDartFrame(Assembler* assembler, |
| 66 intptr_t frame_size) { |
| 67 const intptr_t offset = assembler->CodeSize(); |
| 68 __ EnterFrame(0); |
| 69 Label dart_entry; |
| 70 __ call(&dart_entry); |
| 71 __ Bind(&dart_entry); |
| 72 // Adjust saved PC for any intrinsic code that could have been generated |
| 73 // before a frame is created. |
| 74 if (offset != 0) { |
| 75 __ addq(Address(RSP, 0), Immediate(-offset)); |
| 76 } |
| 77 if (frame_size != 0) { |
| 78 __ subq(RSP, Immediate(frame_size)); |
| 79 } |
| 80 } |
| 81 |
| 82 |
| 83 void AssemblerMacros::EnterStubFrame(Assembler* assembler) { |
| 84 __ EnterFrame(0); |
| 85 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. |
| 86 } |
| 87 |
| 64 #undef __ | 88 #undef __ |
| 65 | 89 |
| 66 } // namespace dart | 90 } // namespace dart |
| 67 | 91 |
| 68 #endif // defined TARGET_ARCH_X64 | 92 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |