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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
952 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); | 952 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); |
953 | 953 |
954 // Helper stub to implement Assembler::StoreIntoObject. | 954 // Helper stub to implement Assembler::StoreIntoObject. |
955 // Input parameters: | 955 // Input parameters: |
956 // EAX: Address being stored | 956 // EAX: Address being stored |
957 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { | 957 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { |
958 // Save values being destroyed. | 958 // Save values being destroyed. |
959 __ pushl(EDX); | 959 __ pushl(EDX); |
960 __ pushl(ECX); | 960 __ pushl(ECX); |
961 | 961 |
962 Label add_to_buffer; | |
963 // Check whether this object has already been remembered. Skip adding to the | |
964 // store buffer if the object is in the store buffer already. | |
965 // Spilled: EDX, ECX | |
966 // EAX: Address being stored | |
967 __ movl(ECX, FieldAddress(EAX, Object::tags_offset())); | |
Vyacheslav Egorov (Google)
2013/04/27 19:34:46
I wonder if doing testl with memory operand before
Ivan Posva
2013/05/03 21:01:37
Different CL.
| |
968 __ testl(ECX, Immediate(1 << RawObject::kRememberedBit)); | |
969 __ j(EQUAL, &add_to_buffer, Assembler::kNearJump); | |
970 __ popl(ECX); | |
971 __ popl(EDX); | |
972 __ ret(); | |
973 | |
974 __ Bind(&add_to_buffer); | |
975 __ orl(ECX, Immediate(1 << RawObject::kRememberedBit)); | |
976 __ movl(FieldAddress(EAX, Object::tags_offset()), ECX); | |
977 | |
962 // Load the isolate out of the context. | 978 // Load the isolate out of the context. |
963 // Spilled: EDX, ECX | 979 // Spilled: EDX, ECX |
964 // EAX: Address being stored | 980 // EAX: Address being stored |
965 __ movl(EDX, FieldAddress(CTX, Context::isolate_offset())); | 981 __ movl(EDX, FieldAddress(CTX, Context::isolate_offset())); |
966 | 982 |
967 // Load top_ out of the StoreBufferBlock and add the address to the pointers_. | 983 // Load top_ out of the StoreBufferBlock and add the address to the pointers_. |
968 // Spilled: EDX, ECX | 984 // Spilled: EDX, ECX |
969 // EAX: Address being stored | 985 // EAX: Address being stored |
970 // EDX: Isolate | 986 // EDX: Isolate |
971 intptr_t store_buffer_offset = Isolate::store_buffer_block_offset(); | 987 intptr_t store_buffer_offset = Isolate::store_buffer_block_offset(); |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2100 __ Bind(&done); | 2116 __ Bind(&done); |
2101 __ popl(temp); | 2117 __ popl(temp); |
2102 __ popl(right); | 2118 __ popl(right); |
2103 __ popl(left); | 2119 __ popl(left); |
2104 __ ret(); | 2120 __ ret(); |
2105 } | 2121 } |
2106 | 2122 |
2107 } // namespace dart | 2123 } // namespace dart |
2108 | 2124 |
2109 #endif // defined TARGET_ARCH_IA32 | 2125 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |