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

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

Issue 1270803003: VM: More abstract interface for generating stub calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 call(&StubCode::UpdateStoreBufferLabel()); 2369 Call(*StubCode::UpdateStoreBuffer_entry());
2370 if (value != EDX) { 2370 if (value != EDX) {
2371 popl(EDX); // Restore EDX. 2371 popl(EDX); // Restore EDX.
2372 } 2372 }
2373 Bind(&done); 2373 Bind(&done);
2374 } 2374 }
2375 2375
2376 2376
2377 void Assembler::StoreIntoObjectNoBarrier(Register object, 2377 void Assembler::StoreIntoObjectNoBarrier(Register object,
2378 const Address& dest, 2378 const Address& dest,
2379 Register value, 2379 Register value,
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 leave(); 2614 leave();
2615 } 2615 }
2616 2616
2617 2617
2618 void Assembler::CallRuntime(const RuntimeEntry& entry, 2618 void Assembler::CallRuntime(const RuntimeEntry& entry,
2619 intptr_t argument_count) { 2619 intptr_t argument_count) {
2620 entry.Call(this, argument_count); 2620 entry.Call(this, argument_count);
2621 } 2621 }
2622 2622
2623 2623
2624 void Assembler::Call(const StubEntry& stub_entry) {
2625 const ExternalLabel label(stub_entry.EntryPoint());
2626 call(&label);
2627 }
2628
2629
2630 void Assembler::Jmp(const StubEntry& stub_entry) {
2631 const ExternalLabel label(stub_entry.EntryPoint());
2632 jmp(&label);
2633 }
2634
2635
2636 void Assembler::J(Condition condition, const StubEntry& stub_entry) {
2637 const ExternalLabel label(stub_entry.EntryPoint());
2638 j(condition, &label);
2639 }
2640
2641
2624 void Assembler::Align(intptr_t alignment, intptr_t offset) { 2642 void Assembler::Align(intptr_t alignment, intptr_t offset) {
2625 ASSERT(Utils::IsPowerOfTwo(alignment)); 2643 ASSERT(Utils::IsPowerOfTwo(alignment));
2626 intptr_t pos = offset + buffer_.GetPosition(); 2644 intptr_t pos = offset + buffer_.GetPosition();
2627 intptr_t mod = pos & (alignment - 1); 2645 intptr_t mod = pos & (alignment - 1);
2628 if (mod == 0) { 2646 if (mod == 0) {
2629 return; 2647 return;
2630 } 2648 }
2631 intptr_t bytes_needed = alignment - mod; 2649 intptr_t bytes_needed = alignment - mod;
2632 while (bytes_needed > MAX_NOP_SIZE) { 2650 while (bytes_needed > MAX_NOP_SIZE) {
2633 nop(MAX_NOP_SIZE); 2651 nop(MAX_NOP_SIZE);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 void Assembler::EnterStubFrame() { 2918 void Assembler::EnterStubFrame() {
2901 EnterFrame(0); 2919 EnterFrame(0);
2902 pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames. 2920 pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames.
2903 } 2921 }
2904 2922
2905 2923
2906 void Assembler::Stop(const char* message) { 2924 void Assembler::Stop(const char* message) {
2907 if (FLAG_print_stop_message) { 2925 if (FLAG_print_stop_message) {
2908 pushl(EAX); // Preserve EAX. 2926 pushl(EAX); // Preserve EAX.
2909 movl(EAX, Immediate(reinterpret_cast<int32_t>(message))); 2927 movl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
2910 call(&StubCode::PrintStopMessageLabel()); // Passing message in EAX. 2928 Call(*StubCode::PrintStopMessage_entry()); // Passing message in EAX.
2911 popl(EAX); // Restore EAX. 2929 popl(EAX); // Restore EAX.
2912 } else { 2930 } else {
2913 // Emit the message address as immediate operand in the test instruction. 2931 // Emit the message address as immediate operand in the test instruction.
2914 testl(EAX, Immediate(reinterpret_cast<int32_t>(message))); 2932 testl(EAX, Immediate(reinterpret_cast<int32_t>(message)));
2915 } 2933 }
2916 // Emit the int3 instruction. 2934 // Emit the int3 instruction.
2917 int3(); // Execution can be resumed with the 'cont' command in gdb. 2935 int3(); // Execution can be resumed with the 'cont' command in gdb.
2918 } 2936 }
2919 2937
2920 2938
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3198 3216
3199 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3217 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3200 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3218 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3201 return xmm_reg_names[reg]; 3219 return xmm_reg_names[reg];
3202 } 3220 }
3203 3221
3204 3222
3205 } // namespace dart 3223 } // namespace dart
3206 3224
3207 #endif // defined TARGET_ARCH_IA32 3225 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698