Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: runtime/vm/assembler_ia32.cc

Issue 1247783002: Make array allocation stub shared between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 } else { 2359 } else {
2360 StoreIntoObjectFilterNoSmi(object, value, &done); 2360 StoreIntoObjectFilterNoSmi(object, value, &done);
2361 } 2361 }
2362 // A store buffer update is required. 2362 // A store buffer update is required.
2363 if (value != EDX) { 2363 if (value != EDX) {
2364 pushl(EDX); // Preserve EDX. 2364 pushl(EDX); // Preserve EDX.
2365 } 2365 }
2366 if (object != EDX) { 2366 if (object != EDX) {
2367 movl(EDX, object); 2367 movl(EDX, object);
2368 } 2368 }
2369 StubCode* stub_code = Isolate::Current()->stub_code(); 2369 call(&StubCode::UpdateStoreBufferLabel());
2370 call(&stub_code->UpdateStoreBufferLabel());
2371 if (value != EDX) { 2370 if (value != EDX) {
2372 popl(EDX); // Restore EDX. 2371 popl(EDX); // Restore EDX.
2373 } 2372 }
2374 Bind(&done); 2373 Bind(&done);
2375 } 2374 }
2376 2375
2377 2376
2378 void Assembler::StoreIntoObjectNoBarrier(Register object, 2377 void Assembler::StoreIntoObjectNoBarrier(Register object,
2379 const Address& dest, 2378 const Address& dest,
2380 Register value, 2379 Register value,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2656 ASSERT(Utils::IsInt(8, offset)); 2655 ASSERT(Utils::IsInt(8, offset));
2657 buffer_.Store<int8_t>(position, offset); 2656 buffer_.Store<int8_t>(position, offset);
2658 } 2657 }
2659 label->BindTo(bound); 2658 label->BindTo(bound);
2660 } 2659 }
2661 2660
2662 2661
2663 void Assembler::MaybeTraceAllocation(intptr_t cid, 2662 void Assembler::MaybeTraceAllocation(intptr_t cid,
2664 Register temp_reg, 2663 Register temp_reg,
2665 Label* trace, 2664 Label* trace,
2666 bool near_jump) { 2665 bool near_jump,
2666 bool inline_isolate) {
2667 ASSERT(cid > 0); 2667 ASSERT(cid > 0);
2668 Address state_address(kNoRegister, 0); 2668 Address state_address(kNoRegister, 0);
2669 intptr_t state_offset; 2669 intptr_t state_offset = ClassTable::StateOffsetFor(cid);
2670 ClassTable* class_table = Isolate::Current()->class_table(); 2670 if (inline_isolate) {
2671 ClassHeapStats** table_ptr = 2671 ClassTable* class_table = Isolate::Current()->class_table();
2672 class_table->StateAddressFor(cid, &state_offset); 2672 ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
2673 if (cid < kNumPredefinedCids) { 2673 if (cid < kNumPredefinedCids) {
2674 state_address = Address::Absolute( 2674 state_address = Address::Absolute(
2675 reinterpret_cast<uword>(*table_ptr) + state_offset); 2675 reinterpret_cast<uword>(*table_ptr) + state_offset);
2676 } else {
2677 ASSERT(temp_reg != kNoRegister);
2678 // temp_reg gets address of class table pointer.
2679 movl(temp_reg,
2680 Address::Absolute(reinterpret_cast<uword>(table_ptr)));
2681 state_address = Address(temp_reg, state_offset);
2682 }
2676 } else { 2683 } else {
2677 ASSERT(temp_reg != kNoRegister); 2684 LoadIsolate(temp_reg);
2678 // temp_reg gets address of class table pointer. 2685 intptr_t table_offset =
2679 movl(temp_reg, 2686 Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
2680 Address::Absolute(reinterpret_cast<uword>(table_ptr))); 2687 movl(temp_reg, Address(temp_reg, table_offset));
2681 state_address = Address(temp_reg, state_offset); 2688 state_address = Address(temp_reg, state_offset);
2682 } 2689 }
2683 testb(state_address, Immediate(ClassHeapStats::TraceAllocationMask())); 2690 testb(state_address, Immediate(ClassHeapStats::TraceAllocationMask()));
2684 // We are tracing for this class, jump to the trace label which will use 2691 // We are tracing for this class, jump to the trace label which will use
2685 // the allocation stub. 2692 // the allocation stub.
2686 j(NOT_ZERO, trace, near_jump); 2693 j(NOT_ZERO, trace, near_jump);
2687 } 2694 }
2688 2695
2689 2696
2690 void Assembler::UpdateAllocationStats(intptr_t cid, 2697 void Assembler::UpdateAllocationStats(intptr_t cid,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2884 2891
2885 2892
2886 void Assembler::EnterStubFrame() { 2893 void Assembler::EnterStubFrame() {
2887 EnterFrame(0); 2894 EnterFrame(0);
2888 pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames. 2895 pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames.
2889 } 2896 }
2890 2897
2891 2898
2892 void Assembler::Stop(const char* message) { 2899 void Assembler::Stop(const char* message) {
2893 if (FLAG_print_stop_message) { 2900 if (FLAG_print_stop_message) {
2894 StubCode* stub_code = Isolate::Current()->stub_code();
2895 pushl(EAX); // Preserve EAX. 2901 pushl(EAX); // Preserve EAX.
2896 movl(EAX, Immediate(reinterpret_cast<int32_t>(message))); 2902 movl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
2897 call(&stub_code->PrintStopMessageLabel()); // Passing message in EAX. 2903 call(&StubCode::PrintStopMessageLabel()); // Passing message in EAX.
2898 popl(EAX); // Restore EAX. 2904 popl(EAX); // Restore EAX.
2899 } else { 2905 } else {
2900 // Emit the message address as immediate operand in the test instruction. 2906 // Emit the message address as immediate operand in the test instruction.
2901 testl(EAX, Immediate(reinterpret_cast<int32_t>(message))); 2907 testl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
2902 } 2908 }
2903 // Emit the int3 instruction. 2909 // Emit the int3 instruction.
2904 int3(); // Execution can be resumed with the 'cont' command in gdb. 2910 int3(); // Execution can be resumed with the 'cont' command in gdb.
2905 } 2911 }
2906 2912
2907 2913
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3185 3191
3186 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3192 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3187 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3193 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3188 return xmm_reg_names[reg]; 3194 return xmm_reg_names[reg];
3189 } 3195 }
3190 3196
3191 3197
3192 } // namespace dart 3198 } // namespace dart
3193 3199
3194 #endif // defined TARGET_ARCH_IA32 3200 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698