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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 7113012: Call a stub for the write barrier on ARM. This is a step (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/arm/ic-arm.cc ('k') | src/arm/macro-assembler-arm.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 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 Slot* slot = scope()->parameter(i)->AsSlot(); 201 Slot* slot = scope()->parameter(i)->AsSlot();
202 if (slot != NULL && slot->type() == Slot::CONTEXT) { 202 if (slot != NULL && slot->type() == Slot::CONTEXT) {
203 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 203 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
204 (num_parameters - 1 - i) * kPointerSize; 204 (num_parameters - 1 - i) * kPointerSize;
205 // Load parameter from stack. 205 // Load parameter from stack.
206 __ ldr(r0, MemOperand(fp, parameter_offset)); 206 __ ldr(r0, MemOperand(fp, parameter_offset));
207 // Store it in the context. 207 // Store it in the context.
208 MemOperand target = ContextOperand(cp, slot->index()); 208 MemOperand target = ContextOperand(cp, slot->index());
209 __ str(r0, target); 209 __ str(r0, target);
210 // Update the write barrier. This clobbers r3 and r0. 210 // Update the write barrier. This clobbers r3 and r0.
211 __ RecordWriteContextSlot(cp, target.offset(), r0, r3, kSaveFPRegs); 211 __ RecordWriteContextSlot(
212 cp, target.offset(), r0, r3, kLRHasBeenSaved, kSaveFPRegs);
212 } 213 }
213 } 214 }
214 Comment(";;; End allocate local context"); 215 Comment(";;; End allocate local context");
215 } 216 }
216 217
217 // Trace the call. 218 // Trace the call.
218 if (FLAG_trace) { 219 if (FLAG_trace) {
219 __ CallRuntime(Runtime::kTraceEnter, 0); 220 __ CallRuntime(Runtime::kTraceEnter, 0);
220 } 221 }
221 return !is_aborted(); 222 return !is_aborted();
(...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 __ ldr(result, ContextOperand(context, instr->slot_index())); 2358 __ ldr(result, ContextOperand(context, instr->slot_index()));
2358 } 2359 }
2359 2360
2360 2361
2361 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2362 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2362 Register context = ToRegister(instr->context()); 2363 Register context = ToRegister(instr->context());
2363 Register value = ToRegister(instr->value()); 2364 Register value = ToRegister(instr->value());
2364 MemOperand target = ContextOperand(context, instr->slot_index()); 2365 MemOperand target = ContextOperand(context, instr->slot_index());
2365 __ str(value, target); 2366 __ str(value, target);
2366 if (instr->needs_write_barrier()) { 2367 if (instr->needs_write_barrier()) {
2367 __ RecordWriteContextSlot( 2368 __ RecordWriteContextSlot(context,
2368 context, target.offset(), value, scratch0(), kSaveFPRegs); 2369 target.offset(),
2370 value,
2371 scratch0(),
2372 kLRHasBeenSaved,
2373 kSaveFPRegs);
2369 } 2374 }
2370 } 2375 }
2371 2376
2372 2377
2373 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2378 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2374 Register object = ToRegister(instr->InputAt(0)); 2379 Register object = ToRegister(instr->InputAt(0));
2375 Register result = ToRegister(instr->result()); 2380 Register result = ToRegister(instr->result());
2376 if (instr->hydrogen()->is_in_object()) { 2381 if (instr->hydrogen()->is_in_object()) {
2377 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); 2382 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset()));
2378 } else { 2383 } else {
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
3298 if (!instr->transition().is_null()) { 3303 if (!instr->transition().is_null()) {
3299 __ mov(scratch, Operand(instr->transition())); 3304 __ mov(scratch, Operand(instr->transition()));
3300 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 3305 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
3301 } 3306 }
3302 3307
3303 // Do the store. 3308 // Do the store.
3304 if (instr->is_in_object()) { 3309 if (instr->is_in_object()) {
3305 __ str(value, FieldMemOperand(object, offset)); 3310 __ str(value, FieldMemOperand(object, offset));
3306 if (instr->needs_write_barrier()) { 3311 if (instr->needs_write_barrier()) {
3307 // Update the write barrier for the object for in-object properties. 3312 // Update the write barrier for the object for in-object properties.
3308 __ RecordWriteField(object, offset, value, scratch, kSaveFPRegs); 3313 __ RecordWriteField(
3314 object, offset, value, scratch, kLRHasBeenSaved, kSaveFPRegs);
3309 } 3315 }
3310 } else { 3316 } else {
3311 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); 3317 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
3312 __ str(value, FieldMemOperand(scratch, offset)); 3318 __ str(value, FieldMemOperand(scratch, offset));
3313 if (instr->needs_write_barrier()) { 3319 if (instr->needs_write_barrier()) {
3314 // Update the write barrier for the properties array. 3320 // Update the write barrier for the properties array.
3315 // object is used as a scratch register. 3321 // object is used as a scratch register.
3316 __ RecordWriteField(scratch, offset, value, object, kSaveFPRegs); 3322 __ RecordWriteField(
3323 scratch, offset, value, object, kLRHasBeenSaved, kSaveFPRegs);
3317 } 3324 }
3318 } 3325 }
3319 } 3326 }
3320 3327
3321 3328
3322 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 3329 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
3323 ASSERT(ToRegister(instr->object()).is(r1)); 3330 ASSERT(ToRegister(instr->object()).is(r1));
3324 ASSERT(ToRegister(instr->value()).is(r0)); 3331 ASSERT(ToRegister(instr->value()).is(r0));
3325 3332
3326 // Name is always in r2. 3333 // Name is always in r2.
(...skipping 25 matching lines...) Expand all
3352 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; 3359 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize;
3353 __ str(value, FieldMemOperand(elements, offset)); 3360 __ str(value, FieldMemOperand(elements, offset));
3354 } else { 3361 } else {
3355 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); 3362 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2));
3356 __ str(value, FieldMemOperand(scratch, FixedArray::kHeaderSize)); 3363 __ str(value, FieldMemOperand(scratch, FixedArray::kHeaderSize));
3357 } 3364 }
3358 3365
3359 if (instr->hydrogen()->NeedsWriteBarrier()) { 3366 if (instr->hydrogen()->NeedsWriteBarrier()) {
3360 // Compute address of modified element and store it into key register. 3367 // Compute address of modified element and store it into key register.
3361 __ add(key, scratch, Operand(FixedArray::kHeaderSize)); 3368 __ add(key, scratch, Operand(FixedArray::kHeaderSize));
3362 __ RecordWrite(elements, key, value, kSaveFPRegs); 3369 __ RecordWrite(elements, key, value, kLRHasBeenSaved, kSaveFPRegs);
3363 } 3370 }
3364 } 3371 }
3365 3372
3366 3373
3367 void LCodeGen::DoStoreKeyedSpecializedArrayElement( 3374 void LCodeGen::DoStoreKeyedSpecializedArrayElement(
3368 LStoreKeyedSpecializedArrayElement* instr) { 3375 LStoreKeyedSpecializedArrayElement* instr) {
3369 3376
3370 Register external_pointer = ToRegister(instr->external_pointer()); 3377 Register external_pointer = ToRegister(instr->external_pointer());
3371 Register key = no_reg; 3378 Register key = no_reg;
3372 ExternalArrayType array_type = instr->array_type(); 3379 ExternalArrayType array_type = instr->array_type();
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
4515 ASSERT(osr_pc_offset_ == -1); 4522 ASSERT(osr_pc_offset_ == -1);
4516 osr_pc_offset_ = masm()->pc_offset(); 4523 osr_pc_offset_ = masm()->pc_offset();
4517 } 4524 }
4518 4525
4519 4526
4520 4527
4521 4528
4522 #undef __ 4529 #undef __
4523 4530
4524 } } // namespace v8::internal 4531 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698