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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 // Update the tags that this object has been remembered. | 947 // Update the tags that this object has been remembered. |
948 // EDX: Address being stored | 948 // EDX: Address being stored |
949 // EAX: Current tag value | 949 // EAX: Current tag value |
950 __ Bind(&add_to_buffer); | 950 __ Bind(&add_to_buffer); |
951 __ movl(ECX, EAX); | 951 __ movl(ECX, EAX); |
952 __ orl(ECX, Immediate(1 << RawObject::kRememberedBit)); | 952 __ orl(ECX, Immediate(1 << RawObject::kRememberedBit)); |
953 // Compare the tag word with EAX, update to ECX if unchanged. | 953 // Compare the tag word with EAX, update to ECX if unchanged. |
954 __ LockCmpxchgl(FieldAddress(EDX, Object::tags_offset()), ECX); | 954 __ LockCmpxchgl(FieldAddress(EDX, Object::tags_offset()), ECX); |
955 __ j(NOT_EQUAL, &reload); | 955 __ j(NOT_EQUAL, &reload); |
956 | 956 |
957 // Load the isolate. | 957 // Load the StoreBuffer block out of the thread. Then load top_ out of the |
958 // Spilled: EAX, ECX | |
959 // EDX: Address being stored | |
960 __ LoadIsolate(EAX); | |
961 | |
962 // Load the StoreBuffer block out of the isolate. Then load top_ out of the | |
963 // StoreBufferBlock and add the address to the pointers_. | 958 // StoreBufferBlock and add the address to the pointers_. |
964 // Spilled: EAX, ECX | 959 // Spilled: EAX, ECX |
965 // EDX: Address being stored | 960 // EDX: Address being stored |
966 // EAX: Isolate | 961 __ movl(EAX, Address(THR, Thread::store_buffer_block_offset())); |
967 __ movl(EAX, Address(EAX, Isolate::store_buffer_offset())); | |
968 __ movl(ECX, Address(EAX, StoreBufferBlock::top_offset())); | 962 __ movl(ECX, Address(EAX, StoreBufferBlock::top_offset())); |
969 __ movl(Address(EAX, ECX, TIMES_4, StoreBufferBlock::pointers_offset()), EDX); | 963 __ movl(Address(EAX, ECX, TIMES_4, StoreBufferBlock::pointers_offset()), EDX); |
970 | 964 |
971 // Increment top_ and check for overflow. | 965 // Increment top_ and check for overflow. |
972 // Spilled: EAX, ECX | 966 // Spilled: EAX, ECX |
973 // ECX: top_ | 967 // ECX: top_ |
974 // EAX: StoreBufferBlock | 968 // EAX: StoreBufferBlock |
975 Label L; | 969 Label L; |
976 __ incl(ECX); | 970 __ incl(ECX); |
977 __ movl(Address(EAX, StoreBufferBlock::top_offset()), ECX); | 971 __ movl(Address(EAX, StoreBufferBlock::top_offset()), ECX); |
978 __ cmpl(ECX, Immediate(StoreBufferBlock::kSize)); | 972 __ cmpl(ECX, Immediate(StoreBufferBlock::kSize)); |
979 // Restore values. | 973 // Restore values. |
980 // Spilled: EAX, ECX | 974 // Spilled: EAX, ECX |
981 __ popl(ECX); | 975 __ popl(ECX); |
982 __ popl(EAX); | 976 __ popl(EAX); |
983 __ j(EQUAL, &L, Assembler::kNearJump); | 977 __ j(EQUAL, &L, Assembler::kNearJump); |
984 __ ret(); | 978 __ ret(); |
985 | 979 |
986 // Handle overflow: Call the runtime leaf function. | 980 // Handle overflow: Call the runtime leaf function. |
987 __ Bind(&L); | 981 __ Bind(&L); |
988 // Setup frame, push callee-saved registers. | 982 // Setup frame, push callee-saved registers. |
989 | 983 |
990 __ EnterCallRuntimeFrame(1 * kWordSize); | 984 __ EnterCallRuntimeFrame(1 * kWordSize); |
991 __ LoadIsolate(EDX); | 985 __ movl(Address(ESP, 0), THR); // Push the thread as the only argument. |
992 __ movl(Address(ESP, 0), EDX); // Push the isolate as the only argument. | |
993 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); | 986 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); |
994 // Restore callee-saved registers, tear down frame. | 987 // Restore callee-saved registers, tear down frame. |
995 __ LeaveCallRuntimeFrame(); | 988 __ LeaveCallRuntimeFrame(); |
996 __ ret(); | 989 __ ret(); |
997 } | 990 } |
998 | 991 |
999 | 992 |
1000 // Called for inline allocation of objects. | 993 // Called for inline allocation of objects. |
1001 // Input parameters: | 994 // Input parameters: |
1002 // ESP + 4 : type arguments object (only if class is parameterized). | 995 // ESP + 4 : type arguments object (only if class is parameterized). |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 // EBX: entry point. | 2082 // EBX: entry point. |
2090 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2083 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2091 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); | 2084 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); |
2092 __ ret(); | 2085 __ ret(); |
2093 } | 2086 } |
2094 | 2087 |
2095 | 2088 |
2096 } // namespace dart | 2089 } // namespace dart |
2097 | 2090 |
2098 #endif // defined TARGET_ARCH_IA32 | 2091 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |