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

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
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/full-codegen-x64.cc » ('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 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
5190 // The first instruction is generated as a label so as to get the offset
5191 // fixed up correctly by the bind(Label*) call. We patch it back and forth
5192 // between a 2-byte compare instruction (a nop in this position) and the real
5193 // branch when we start and stop incremental heap marking.
5194 __ jmp(&skip_non_incremental_part, Label::kNear);
5195 if (!masm->isolate()->heap()->incremental_marking()->IsMarking()) {
5196 ASSERT(masm->byte_at(masm->pc_offset() - 2) ==
5197 kSkipNonIncrementalPartInstruction);
5198 masm->set_byte_at(masm->pc_offset() - 2, kTwoByteNopInstruction);
5199 }
5200
5201 if (remembered_set_action_ == EMIT_REMEMBERED_SET) {
5202 __ RememberedSetHelper(
5203 address_, value_, save_fp_regs_mode_, MacroAssembler::kReturnAtEnd);
5204 } else {
5205 __ ret(0);
5206 }
5207
5208 __ bind(&skip_non_incremental_part);
5209 __ int3();
5210 }
5211
5212
5181 #undef __ 5213 #undef __
5182 5214
5183 } } // namespace v8::internal 5215 } } // namespace v8::internal
5184 5216
5185 #endif // V8_TARGET_ARCH_X64 5217 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698