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

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

Issue 10443052: Fix missing write barrier in store field stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed missing write barrier in optimized code. Created 8 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 CallRuntime(instr->function(), instr->arity(), instr); 3311 CallRuntime(instr->function(), instr->arity(), instr);
3312 } 3312 }
3313 3313
3314 3314
3315 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { 3315 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
3316 Register object = ToRegister(instr->object()); 3316 Register object = ToRegister(instr->object());
3317 Register value = ToRegister(instr->value()); 3317 Register value = ToRegister(instr->value());
3318 int offset = instr->offset(); 3318 int offset = instr->offset();
3319 3319
3320 if (!instr->transition().is_null()) { 3320 if (!instr->transition().is_null()) {
3321 __ Move(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); 3321 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) {
3322 __ Move(FieldOperand(object, HeapObject::kMapOffset),
3323 instr->transition());
3324 } else {
3325 Register temp = ToRegister(instr->TempAt(0));
3326 Register temp_map = ToRegister(instr->TempAt(1));
3327 __ Move(temp_map, instr->transition());
3328 __ movq(FieldOperand(object, HeapObject::kMapOffset), temp_map);
3329 // Update the write barrier for the map field.
3330 __ RecordWriteField(object,
3331 HeapObject::kMapOffset,
3332 temp_map,
3333 temp,
3334 kSaveFPRegs,
3335 OMIT_REMEMBERED_SET,
3336 OMIT_SMI_CHECK);
3337 }
3322 } 3338 }
3323 3339
3324 // Do the store. 3340 // Do the store.
3325 HType type = instr->hydrogen()->value()->type(); 3341 HType type = instr->hydrogen()->value()->type();
3326 SmiCheck check_needed = 3342 SmiCheck check_needed =
3327 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 3343 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
3328 if (instr->is_in_object()) { 3344 if (instr->is_in_object()) {
3329 __ movq(FieldOperand(object, offset), value); 3345 __ movq(FieldOperand(object, offset), value);
3330 if (instr->hydrogen()->NeedsWriteBarrier()) { 3346 if (instr->hydrogen()->NeedsWriteBarrier()) {
3331 Register temp = ToRegister(instr->TempAt(0)); 3347 Register temp = ToRegister(instr->TempAt(0));
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
4879 FixedArray::kHeaderSize - kPointerSize)); 4895 FixedArray::kHeaderSize - kPointerSize));
4880 __ bind(&done); 4896 __ bind(&done);
4881 } 4897 }
4882 4898
4883 4899
4884 #undef __ 4900 #undef __
4885 4901
4886 } } // namespace v8::internal 4902 } } // namespace v8::internal
4887 4903
4888 #endif // V8_TARGET_ARCH_X64 4904 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698