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

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

Issue 8857001: [hydrogen] don't bailout assignments to consts (Closed) Base URL: gh:v8/v8@master
Patch Set: style fixes Created 9 years 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 | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-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 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 2173 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
2174 ? isolate()->builtins()->StoreIC_Initialize_Strict() 2174 ? isolate()->builtins()->StoreIC_Initialize_Strict()
2175 : isolate()->builtins()->StoreIC_Initialize(); 2175 : isolate()->builtins()->StoreIC_Initialize();
2176 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); 2176 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
2177 } 2177 }
2178 2178
2179 2179
2180 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2180 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2181 Register context = ToRegister(instr->context()); 2181 Register context = ToRegister(instr->context());
2182 Register result = ToRegister(instr->result()); 2182 Register result = ToRegister(instr->result());
2183
2183 __ lw(result, ContextOperand(context, instr->slot_index())); 2184 __ lw(result, ContextOperand(context, instr->slot_index()));
2184 if (instr->hydrogen()->RequiresHoleCheck()) { 2185 if (instr->hydrogen()->RequiresHoleCheck()) {
2185 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2186 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2186 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); 2187
2188 if (instr->hydrogen()->DeoptimizesOnHole()) {
2189 DeoptimizeIf(eq, instr->environment(), result, Operand(at));
2190 } else {
2191 Label is_not_hole;
2192 __ Branch(&is_not_hole, ne, result, Operand(at));
2193 __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
2194 __ bind(&is_not_hole);
2195 }
2187 } 2196 }
2188 } 2197 }
2189 2198
2190 2199
2191 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2200 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2192 Register context = ToRegister(instr->context()); 2201 Register context = ToRegister(instr->context());
2193 Register value = ToRegister(instr->value()); 2202 Register value = ToRegister(instr->value());
2203 Register scratch = scratch0();
2194 MemOperand target = ContextOperand(context, instr->slot_index()); 2204 MemOperand target = ContextOperand(context, instr->slot_index());
2205
2206 Label skip_assignment;
2207
2195 if (instr->hydrogen()->RequiresHoleCheck()) { 2208 if (instr->hydrogen()->RequiresHoleCheck()) {
2196 Register scratch = scratch0();
2197 __ lw(scratch, target); 2209 __ lw(scratch, target);
2198 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2210 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2199 DeoptimizeIf(eq, instr->environment(), scratch, Operand(at)); 2211
2212 if (instr->hydrogen()->DeoptimizesOnHole()) {
2213 DeoptimizeIf(eq, instr->environment(), scratch, Operand(at));
2214 } else {
2215 __ Branch(&skip_assignment, ne, scratch, Operand(at));
2216 }
2200 } 2217 }
2218
2201 __ sw(value, target); 2219 __ sw(value, target);
2202 if (instr->hydrogen()->NeedsWriteBarrier()) { 2220 if (instr->hydrogen()->NeedsWriteBarrier()) {
2203 HType type = instr->hydrogen()->value()->type(); 2221 HType type = instr->hydrogen()->value()->type();
2204 SmiCheck check_needed = 2222 SmiCheck check_needed =
2205 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2223 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2206 __ RecordWriteContextSlot(context, 2224 __ RecordWriteContextSlot(context,
2207 target.offset(), 2225 target.offset(),
2208 value, 2226 value,
2209 scratch0(), 2227 scratch0(),
2210 kRAHasBeenSaved, 2228 kRAHasBeenSaved,
2211 kSaveFPRegs, 2229 kSaveFPRegs,
2212 EMIT_REMEMBERED_SET, 2230 EMIT_REMEMBERED_SET,
2213 check_needed); 2231 check_needed);
2214 } 2232 }
2233
2234 __ bind(&skip_assignment);
2215 } 2235 }
2216 2236
2217 2237
2218 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2238 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2219 Register object = ToRegister(instr->InputAt(0)); 2239 Register object = ToRegister(instr->InputAt(0));
2220 Register result = ToRegister(instr->result()); 2240 Register result = ToRegister(instr->result());
2221 if (instr->hydrogen()->is_in_object()) { 2241 if (instr->hydrogen()->is_in_object()) {
2222 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset())); 2242 __ lw(result, FieldMemOperand(object, instr->hydrogen()->offset()));
2223 } else { 2243 } else {
2224 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 2244 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after
4660 ASSERT(!environment->HasBeenRegistered()); 4680 ASSERT(!environment->HasBeenRegistered());
4661 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4681 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4662 ASSERT(osr_pc_offset_ == -1); 4682 ASSERT(osr_pc_offset_ == -1);
4663 osr_pc_offset_ = masm()->pc_offset(); 4683 osr_pc_offset_ = masm()->pc_offset();
4664 } 4684 }
4665 4685
4666 4686
4667 #undef __ 4687 #undef __
4668 4688
4669 } } // namespace v8::internal 4689 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698