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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 7122003: Make x64 to use the RecordWrite stub. This is a step towards getting (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 2420
2421 // rbx: last_match_info backing store (FixedArray) 2421 // rbx: last_match_info backing store (FixedArray)
2422 // rdx: number of capture registers 2422 // rdx: number of capture registers
2423 // Store the capture count. 2423 // Store the capture count.
2424 __ Integer32ToSmi(kScratchRegister, rdx); 2424 __ Integer32ToSmi(kScratchRegister, rdx);
2425 __ movq(FieldOperand(rbx, RegExpImpl::kLastCaptureCountOffset), 2425 __ movq(FieldOperand(rbx, RegExpImpl::kLastCaptureCountOffset),
2426 kScratchRegister); 2426 kScratchRegister);
2427 // Store last subject and last input. 2427 // Store last subject and last input.
2428 __ movq(rax, Operand(rsp, kSubjectOffset)); 2428 __ movq(rax, Operand(rsp, kSubjectOffset));
2429 __ movq(FieldOperand(rbx, RegExpImpl::kLastSubjectOffset), rax); 2429 __ movq(FieldOperand(rbx, RegExpImpl::kLastSubjectOffset), rax);
2430 __ movq(rcx, rbx); 2430 __ RecordWriteField(rbx,
2431 __ RecordWrite(rcx, 2431 RegExpImpl::kLastSubjectOffset,
2432 RegExpImpl::kLastSubjectOffset, 2432 rax,
2433 rax, 2433 rdi,
2434 rdi, 2434 kDontSaveFPRegs);
2435 kDontSaveFPRegs);
2436 __ movq(rax, Operand(rsp, kSubjectOffset)); 2435 __ movq(rax, Operand(rsp, kSubjectOffset));
2437 __ movq(FieldOperand(rbx, RegExpImpl::kLastInputOffset), rax); 2436 __ movq(FieldOperand(rbx, RegExpImpl::kLastInputOffset), rax);
2438 __ movq(rcx, rbx); 2437 __ RecordWriteField(rbx,
2439 __ RecordWrite(rcx, RegExpImpl::kLastInputOffset, rax, rdi, kDontSaveFPRegs); 2438 RegExpImpl::kLastInputOffset,
2439 rax,
2440 rdi,
2441 kDontSaveFPRegs);
2440 2442
2441 // Get the static offsets vector filled by the native regexp code. 2443 // Get the static offsets vector filled by the native regexp code.
2442 __ LoadAddress(rcx, 2444 __ LoadAddress(rcx,
2443 ExternalReference::address_of_static_offsets_vector(isolate)); 2445 ExternalReference::address_of_static_offsets_vector(isolate));
2444 2446
2445 // rbx: last_match_info backing store (FixedArray) 2447 // rbx: last_match_info backing store (FixedArray)
2446 // rcx: offsets vector 2448 // rcx: offsets vector
2447 // rdx: number of capture registers 2449 // rdx: number of capture registers
2448 Label next_capture, done; 2450 Label next_capture, done;
2449 // Capture register counter starts from number of capture registers and 2451 // Capture register counter starts from number of capture registers and
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after
5171 __ Drop(1); 5173 __ Drop(1);
5172 __ ret(2 * kPointerSize); 5174 __ ret(2 * kPointerSize);
5173 5175
5174 __ bind(&not_in_dictionary); 5176 __ bind(&not_in_dictionary);
5175 __ movq(scratch, Immediate(0)); 5177 __ movq(scratch, Immediate(0));
5176 __ Drop(1); 5178 __ Drop(1);
5177 __ ret(2 * kPointerSize); 5179 __ ret(2 * kPointerSize);
5178 } 5180 }
5179 5181
5180 5182
5183 // Takes the input in 3 registers: address_ value_ and object_. A pointer to
5184 // the value has just been written into the object, now this stub makes sure
5185 // we keep the GC informed. The word in the object where the value has been
5186 // written is in the address register.
5187 void RecordWriteStub::Generate(MacroAssembler* masm) {
5188 Label skip_non_incremental_part;
5189 __ jmp(&skip_non_incremental_part, Label::kNear);
Lasse Reichstein 2011/06/07 14:02:53 But why overwrite? Why not just: if (!HEAP->incr
Erik Corry 2011/06/08 10:38:55 We will be ovewriting the opcode every time we sta
5190 if (!HEAP->incremental_marking()->IsMarking()) {
Lasse Reichstein 2011/06/07 14:02:53 HEAP should be replaced by something faster. Maybe
Erik Corry 2011/06/08 10:38:55 Done.
5191 ASSERT(masm->get_opcode(-2) == kSkipNonIncrementalPartInstruction);
5192 masm->set_opcode(-2, kTwoByteNopInstruction);
5193 }
5194
5195 if (remembered_set_action_ == EMIT_REMEMBERED_SET) {
5196 __ RememberedSetHelper(
5197 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
5198 } else {
5199 __ ret(0);
5200 }
5201
5202 __ bind(&skip_non_incremental_part);
5203 __ int3();
5204 }
5205
5206
5181 #undef __ 5207 #undef __
5182 5208
5183 } } // namespace v8::internal 5209 } } // namespace v8::internal
5184 5210
5185 #endif // V8_TARGET_ARCH_X64 5211 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698