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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 6026017: Fix/implement new write barrier for x64. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/code-stubs-x64.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
===================================================================
--- src/x64/code-stubs-x64.cc (revision 6183)
+++ src/x64/code-stubs-x64.cc (working copy)
@@ -255,6 +255,58 @@
}
+void WriteBufferOverflowStub::Generate(MacroAssembler* masm) {
+ // We don't allow a GC during a write buffer overflow so there is no need to
+ // store the registers in any particular way, but we do have to store and
+ // restore them.
+ __ push(rax);
Vyacheslav Egorov (Chromium) 2011/01/06 12:35:29 Does it make sense to make something like static
+ __ push(rcx);
+ __ push(rdx);
+ __ push(rbx);
+ __ push(rbp);
+ __ push(rsi);
+ __ push(rdi);
+ __ push(r8);
+ __ push(r9);
+ __ push(r10);
+ __ push(r11);
+ // R12 to r15 are callee save on all platforms.
+ if (save_doubles_ == kSaveFPRegs) {
+ CpuFeatures::Scope scope(SSE2);
+ __ subq(rsp, Immediate(kDoubleSize * XMMRegister::kNumRegisters));
+ for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
+ XMMRegister reg = XMMRegister::from_code(i);
+ __ movsd(Operand(rsp, i * kDoubleSize), reg);
+ }
+ }
+ const int argument_count = 0;
+ __ PrepareCallCFunction(argument_count);
+ ExternalReference write_buffer_overflow =
+ ExternalReference(Runtime::FunctionForId(Runtime::kWriteBufferOverflow));
+ __ CallCFunction(write_buffer_overflow, argument_count);
+ if (save_doubles_ == kSaveFPRegs) {
+ CpuFeatures::Scope scope(SSE2);
+ for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
+ XMMRegister reg = XMMRegister::from_code(i);
+ __ movsd(reg, Operand(rsp, i * kDoubleSize));
+ }
+ __ addq(rsp, Immediate(kDoubleSize * XMMRegister::kNumRegisters));
+ }
+ __ pop(r11);
+ __ pop(r10);
+ __ pop(r9);
+ __ pop(r8);
+ __ pop(rdi);
+ __ pop(rsi);
+ __ pop(rbp);
+ __ pop(rbx);
+ __ pop(rdx);
+ __ pop(rcx);
+ __ pop(rax);
+ __ ret(0);
+}
+
+
const char* GenericBinaryOpStub::GetName() {
if (name_ != NULL) return name_;
const int kMaxNameLength = 100;
@@ -1971,16 +2023,16 @@
// Store last subject and last input.
__ movq(rax, Operand(rsp, kSubjectOffset));
__ movq(FieldOperand(rbx, RegExpImpl::kLastSubjectOffset), rax);
-#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
__ movq(rcx, rbx);
- __ RecordWrite(rcx, RegExpImpl::kLastSubjectOffset, rax, rdi);
-#endif
+ __ RecordWrite(rcx,
+ RegExpImpl::kLastSubjectOffset,
+ rax,
+ rdi,
+ kDontSaveFPRegs);
__ movq(rax, Operand(rsp, kSubjectOffset));
__ movq(FieldOperand(rbx, RegExpImpl::kLastInputOffset), rax);
-#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
__ movq(rcx, rbx);
- __ RecordWrite(rcx, RegExpImpl::kLastInputOffset, rax, rdi);
-#endif
+ __ RecordWrite(rcx, RegExpImpl::kLastInputOffset, rax, rdi, kDontSaveFPRegs);
// Get the static offsets vector filled by the native regexp code.
__ movq(rcx, ExternalReference::address_of_static_offsets_vector());
« no previous file with comments | « src/x64/code-stubs-x64.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698