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

Side by Side Diff: src/arm/stub-cache-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/macro-assembler-arm.cc ('k') | src/ia32/code-stubs-ia32.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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 index -= object->map()->inobject_properties(); 426 index -= object->map()->inobject_properties();
427 427
428 if (index < 0) { 428 if (index < 0) {
429 // Set the property straight into the object. 429 // Set the property straight into the object.
430 int offset = object->map()->instance_size() + (index * kPointerSize); 430 int offset = object->map()->instance_size() + (index * kPointerSize);
431 __ str(r0, FieldMemOperand(receiver_reg, offset)); 431 __ str(r0, FieldMemOperand(receiver_reg, offset));
432 432
433 // Update the write barrier for the array address. 433 // Update the write barrier for the array address.
434 // Pass the now unused name_reg as a scratch register. 434 // Pass the now unused name_reg as a scratch register.
435 __ mov(name_reg, r0); 435 __ mov(name_reg, r0);
436 __ RecordWriteField( 436 __ RecordWriteField(receiver_reg,
437 receiver_reg, offset, name_reg, scratch, kDontSaveFPRegs); 437 offset,
438 name_reg,
439 scratch,
440 kLRHasNotBeenSaved,
441 kDontSaveFPRegs);
438 } else { 442 } else {
439 // Write to the properties array. 443 // Write to the properties array.
440 int offset = index * kPointerSize + FixedArray::kHeaderSize; 444 int offset = index * kPointerSize + FixedArray::kHeaderSize;
441 // Get the properties array 445 // Get the properties array
442 __ ldr(scratch, FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); 446 __ ldr(scratch, FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset));
443 __ str(r0, FieldMemOperand(scratch, offset)); 447 __ str(r0, FieldMemOperand(scratch, offset));
444 448
445 // Update the write barrier for the array address. 449 // Update the write barrier for the array address.
446 // Ok to clobber receiver_reg and name_reg, since we return. 450 // Ok to clobber receiver_reg and name_reg, since we return.
447 __ mov(name_reg, r0); 451 __ mov(name_reg, r0);
448 __ RecordWriteField( 452 __ RecordWriteField(scratch,
449 scratch, offset, name_reg, receiver_reg, kDontSaveFPRegs); 453 offset,
454 name_reg,
455 receiver_reg,
456 kLRHasNotBeenSaved,
457 kDontSaveFPRegs);
450 } 458 }
451 459
452 // Return the value (register r0). 460 // Return the value (register r0).
453 __ bind(&exit); 461 __ bind(&exit);
454 __ Ret(); 462 __ Ret();
455 } 463 }
456 464
457 465
458 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) { 466 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
459 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC); 467 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 Label with_write_barrier; 1595 Label with_write_barrier;
1588 __ JumpIfNotSmi(r4, &with_write_barrier); 1596 __ JumpIfNotSmi(r4, &with_write_barrier);
1589 __ bind(&exit); 1597 __ bind(&exit);
1590 __ Drop(argc + 1); 1598 __ Drop(argc + 1);
1591 __ Ret(); 1599 __ Ret();
1592 1600
1593 __ bind(&with_write_barrier); 1601 __ bind(&with_write_barrier);
1594 __ RecordWrite(elements, 1602 __ RecordWrite(elements,
1595 end_elements, 1603 end_elements,
1596 r4, 1604 r4,
1605 kLRHasNotBeenSaved,
1597 kDontSaveFPRegs, 1606 kDontSaveFPRegs,
1598 EMIT_REMEMBERED_SET, 1607 EMIT_REMEMBERED_SET,
1599 OMIT_SMI_CHECK); 1608 OMIT_SMI_CHECK);
1600 __ Drop(argc + 1); 1609 __ Drop(argc + 1);
1601 __ Ret(); 1610 __ Ret();
1602 1611
1603 __ bind(&attempt_to_grow_elements); 1612 __ bind(&attempt_to_grow_elements);
1604 // r0: array's length + 1. 1613 // r0: array's length + 1.
1605 // r4: elements' length. 1614 // r4: elements' length.
1606 1615
(...skipping 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after
4221 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4230 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4222 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 4231 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
4223 __ add(scratch, 4232 __ add(scratch,
4224 scratch, 4233 scratch,
4225 Operand(key_reg, LSL, kPointerSizeLog2 - kSmiTagSize)); 4234 Operand(key_reg, LSL, kPointerSizeLog2 - kSmiTagSize));
4226 __ str(value_reg, MemOperand(scratch)); 4235 __ str(value_reg, MemOperand(scratch));
4227 __ mov(receiver_reg, value_reg); 4236 __ mov(receiver_reg, value_reg);
4228 __ RecordWrite(elements_reg, // Object. 4237 __ RecordWrite(elements_reg, // Object.
4229 scratch, // Address. 4238 scratch, // Address.
4230 receiver_reg, // Value. 4239 receiver_reg, // Value.
4240 kLRHasNotBeenSaved,
4231 kDontSaveFPRegs); 4241 kDontSaveFPRegs);
4232 4242
4233 // value_reg (r0) is preserved. 4243 // value_reg (r0) is preserved.
4234 // Done. 4244 // Done.
4235 __ Ret(); 4245 __ Ret();
4236 4246
4237 __ bind(&miss_force_generic); 4247 __ bind(&miss_force_generic);
4238 Handle<Code> ic = 4248 Handle<Code> ic =
4239 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4249 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4240 __ Jump(ic, RelocInfo::CODE_TARGET); 4250 __ Jump(ic, RelocInfo::CODE_TARGET);
4241 } 4251 }
4242 4252
4243 4253
4244 #undef __ 4254 #undef __
4245 4255
4246 } } // namespace v8::internal 4256 } } // namespace v8::internal
4247 4257
4248 #endif // V8_TARGET_ARCH_ARM 4258 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698