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 "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.h" | 8 #include "vm/assembler.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); | 941 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); |
942 | 942 |
943 // Helper stub to implement Assembler::StoreIntoObject. | 943 // Helper stub to implement Assembler::StoreIntoObject. |
944 // Input parameters: | 944 // Input parameters: |
945 // RAX: Address being stored | 945 // RAX: Address being stored |
946 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { | 946 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { |
947 // Save registers being destroyed. | 947 // Save registers being destroyed. |
948 __ pushq(RDX); | 948 __ pushq(RDX); |
949 __ pushq(RCX); | 949 __ pushq(RCX); |
950 | 950 |
| 951 Label add_to_buffer; |
| 952 // Check whether this object has already been remembered. Skip adding to the |
| 953 // store buffer if the object is in the store buffer already. |
| 954 // Spilled: EDX, ECX |
| 955 // EAX: Address being stored |
| 956 __ movq(RCX, FieldAddress(RAX, Object::tags_offset())); |
| 957 __ testq(RCX, Immediate(1 << RawObject::kRememberedBit)); |
| 958 __ j(EQUAL, &add_to_buffer, Assembler::kNearJump); |
| 959 __ popq(RCX); |
| 960 __ popq(RDX); |
| 961 __ ret(); |
| 962 |
| 963 __ Bind(&add_to_buffer); |
| 964 __ orq(RCX, Immediate(1 << RawObject::kRememberedBit)); |
| 965 __ movq(FieldAddress(RAX, Object::tags_offset()), RCX); |
| 966 |
951 // Load the isolate out of the context. | 967 // Load the isolate out of the context. |
952 // RAX: Address being stored | 968 // RAX: Address being stored |
953 __ movq(RDX, FieldAddress(CTX, Context::isolate_offset())); | 969 __ movq(RDX, FieldAddress(CTX, Context::isolate_offset())); |
954 | 970 |
955 // Load top_ out of the StoreBufferBlock and add the address to the pointers_. | 971 // Load top_ out of the StoreBufferBlock and add the address to the pointers_. |
956 // RAX: Address being stored | 972 // RAX: Address being stored |
957 // RDX: Isolate | 973 // RDX: Isolate |
958 intptr_t store_buffer_offset = Isolate::store_buffer_block_offset(); | 974 intptr_t store_buffer_offset = Isolate::store_buffer_block_offset(); |
959 __ movl(RCX, | 975 __ movl(RCX, |
960 Address(RDX, store_buffer_offset + StoreBufferBlock::top_offset())); | 976 Address(RDX, store_buffer_offset + StoreBufferBlock::top_offset())); |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 __ cmpq(left, right); | 2070 __ cmpq(left, right); |
2055 __ Bind(&done); | 2071 __ Bind(&done); |
2056 __ popq(right); | 2072 __ popq(right); |
2057 __ popq(left); | 2073 __ popq(left); |
2058 __ ret(); | 2074 __ ret(); |
2059 } | 2075 } |
2060 | 2076 |
2061 } // namespace dart | 2077 } // namespace dart |
2062 | 2078 |
2063 #endif // defined TARGET_ARCH_X64 | 2079 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |