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

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

Issue 160713002: MIPS: Omit redundant smi checks in write barriers. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 3949 matching lines...) Expand 10 before | Expand all | Expand 10 after
3960 int offset = access.offset(); 3960 int offset = access.offset();
3961 3961
3962 if (access.IsExternalMemory()) { 3962 if (access.IsExternalMemory()) {
3963 Register value = ToRegister(instr->value()); 3963 Register value = ToRegister(instr->value());
3964 MemOperand operand = MemOperand(object, offset); 3964 MemOperand operand = MemOperand(object, offset);
3965 __ Store(value, operand, representation); 3965 __ Store(value, operand, representation);
3966 return; 3966 return;
3967 } 3967 }
3968 3968
3969 Handle<Map> transition = instr->transition(); 3969 Handle<Map> transition = instr->transition();
3970 SmiCheck check_needed =
3971 instr->hydrogen()->value()->IsHeapObject()
3972 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
3970 3973
3971 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 3974 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
3972 Register value = ToRegister(instr->value()); 3975 Register value = ToRegister(instr->value());
3973 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 3976 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
3974 __ SmiTst(value, scratch); 3977 __ SmiTst(value, scratch);
3975 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); 3978 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg));
3979
3980 // We know that value is a smi now, so we can omit the check below.
3981 check_needed = OMIT_SMI_CHECK;
3976 } 3982 }
3977 } else if (representation.IsDouble()) { 3983 } else if (representation.IsDouble()) {
3978 ASSERT(transition.is_null()); 3984 ASSERT(transition.is_null());
3979 ASSERT(access.IsInobject()); 3985 ASSERT(access.IsInobject());
3980 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 3986 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
3981 DoubleRegister value = ToDoubleRegister(instr->value()); 3987 DoubleRegister value = ToDoubleRegister(instr->value());
3982 __ sdc1(value, FieldMemOperand(object, offset)); 3988 __ sdc1(value, FieldMemOperand(object, offset));
3983 return; 3989 return;
3984 } 3990 }
3985 3991
3986 if (!transition.is_null()) { 3992 if (!transition.is_null()) {
3987 __ li(scratch, Operand(transition)); 3993 __ li(scratch, Operand(transition));
3988 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 3994 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
3989 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { 3995 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
3990 Register temp = ToRegister(instr->temp()); 3996 Register temp = ToRegister(instr->temp());
3991 // Update the write barrier for the map field. 3997 // Update the write barrier for the map field.
3992 __ RecordWriteField(object, 3998 __ RecordWriteField(object,
3993 HeapObject::kMapOffset, 3999 HeapObject::kMapOffset,
3994 scratch, 4000 scratch,
3995 temp, 4001 temp,
3996 GetRAState(), 4002 GetRAState(),
3997 kSaveFPRegs, 4003 kSaveFPRegs,
3998 OMIT_REMEMBERED_SET, 4004 OMIT_REMEMBERED_SET,
3999 OMIT_SMI_CHECK); 4005 OMIT_SMI_CHECK);
4000 } 4006 }
4001 } 4007 }
4002 4008
4003 // Do the store. 4009 // Do the store.
4004 Register value = ToRegister(instr->value()); 4010 Register value = ToRegister(instr->value());
4005 SmiCheck check_needed =
4006 instr->hydrogen()->value()->IsHeapObject()
4007 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4008 if (access.IsInobject()) { 4011 if (access.IsInobject()) {
4009 MemOperand operand = FieldMemOperand(object, offset); 4012 MemOperand operand = FieldMemOperand(object, offset);
4010 __ Store(value, operand, representation); 4013 __ Store(value, operand, representation);
4011 if (instr->hydrogen()->NeedsWriteBarrier()) { 4014 if (instr->hydrogen()->NeedsWriteBarrier()) {
4012 // Update the write barrier for the object for in-object properties. 4015 // Update the write barrier for the object for in-object properties.
4013 __ RecordWriteField(object, 4016 __ RecordWriteField(object,
4014 offset, 4017 offset,
4015 value, 4018 value,
4016 scratch, 4019 scratch,
4017 GetRAState(), 4020 GetRAState(),
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
5730 __ Subu(scratch, result, scratch); 5733 __ Subu(scratch, result, scratch);
5731 __ lw(result, FieldMemOperand(scratch, 5734 __ lw(result, FieldMemOperand(scratch,
5732 FixedArray::kHeaderSize - kPointerSize)); 5735 FixedArray::kHeaderSize - kPointerSize));
5733 __ bind(&done); 5736 __ bind(&done);
5734 } 5737 }
5735 5738
5736 5739
5737 #undef __ 5740 #undef __
5738 5741
5739 } } // namespace v8::internal 5742 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698