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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.h ('k') | src/mips/lithium-codegen-mips.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 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2158 ? isolate()->builtins()->StoreIC_Initialize_Strict() 2158 ? isolate()->builtins()->StoreIC_Initialize_Strict()
2159 : isolate()->builtins()->StoreIC_Initialize(); 2159 : isolate()->builtins()->StoreIC_Initialize();
2160 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); 2160 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
2161 } 2161 }
2162 2162
2163 2163
2164 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2164 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2165 Register context = ToRegister(instr->context()); 2165 Register context = ToRegister(instr->context());
2166 Register result = ToRegister(instr->result()); 2166 Register result = ToRegister(instr->result());
2167 __ mov(result, ContextOperand(context, instr->slot_index())); 2167 __ mov(result, ContextOperand(context, instr->slot_index()));
2168
2168 if (instr->hydrogen()->RequiresHoleCheck()) { 2169 if (instr->hydrogen()->RequiresHoleCheck()) {
2169 __ cmp(result, factory()->the_hole_value()); 2170 __ cmp(result, factory()->the_hole_value());
2170 DeoptimizeIf(equal, instr->environment()); 2171 if (instr->hydrogen()->DeoptimizesOnHole()) {
2172 DeoptimizeIf(equal, instr->environment());
2173 } else {
2174 Label is_not_hole;
2175 __ j(not_equal, &is_not_hole, Label::kNear);
2176 __ mov(result, factory()->undefined_value());
2177 __ bind(&is_not_hole);
2178 }
2171 } 2179 }
2172 } 2180 }
2173 2181
2174 2182
2175 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2183 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2176 Register context = ToRegister(instr->context()); 2184 Register context = ToRegister(instr->context());
2177 Register value = ToRegister(instr->value()); 2185 Register value = ToRegister(instr->value());
2186
2187 Label skip_assignment;
2188
2178 Operand target = ContextOperand(context, instr->slot_index()); 2189 Operand target = ContextOperand(context, instr->slot_index());
2179 if (instr->hydrogen()->RequiresHoleCheck()) { 2190 if (instr->hydrogen()->RequiresHoleCheck()) {
2180 __ cmp(target, factory()->the_hole_value()); 2191 __ cmp(target, factory()->the_hole_value());
2181 DeoptimizeIf(equal, instr->environment()); 2192 if (instr->hydrogen()->DeoptimizesOnHole()) {
2193 DeoptimizeIf(equal, instr->environment());
2194 } else {
2195 __ j(not_equal, &skip_assignment, Label::kNear);
2196 }
2182 } 2197 }
2198
2183 __ mov(target, value); 2199 __ mov(target, value);
2184 if (instr->hydrogen()->NeedsWriteBarrier()) { 2200 if (instr->hydrogen()->NeedsWriteBarrier()) {
2185 HType type = instr->hydrogen()->value()->type(); 2201 HType type = instr->hydrogen()->value()->type();
2186 SmiCheck check_needed = 2202 SmiCheck check_needed =
2187 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2203 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2188 Register temp = ToRegister(instr->TempAt(0)); 2204 Register temp = ToRegister(instr->TempAt(0));
2189 int offset = Context::SlotOffset(instr->slot_index()); 2205 int offset = Context::SlotOffset(instr->slot_index());
2190 __ RecordWriteContextSlot(context, 2206 __ RecordWriteContextSlot(context,
2191 offset, 2207 offset,
2192 value, 2208 value,
2193 temp, 2209 temp,
2194 kSaveFPRegs, 2210 kSaveFPRegs,
2195 EMIT_REMEMBERED_SET, 2211 EMIT_REMEMBERED_SET,
2196 check_needed); 2212 check_needed);
2197 } 2213 }
2214
2215 __ bind(&skip_assignment);
2198 } 2216 }
2199 2217
2200 2218
2201 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2219 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2202 Register object = ToRegister(instr->object()); 2220 Register object = ToRegister(instr->object());
2203 Register result = ToRegister(instr->result()); 2221 Register result = ToRegister(instr->result());
2204 if (instr->hydrogen()->is_in_object()) { 2222 if (instr->hydrogen()->is_in_object()) {
2205 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); 2223 __ mov(result, FieldOperand(object, instr->hydrogen()->offset()));
2206 } else { 2224 } else {
2207 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); 2225 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset));
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after
4617 this, pointers, Safepoint::kLazyDeopt); 4635 this, pointers, Safepoint::kLazyDeopt);
4618 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4636 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4619 } 4637 }
4620 4638
4621 4639
4622 #undef __ 4640 #undef __
4623 4641
4624 } } // namespace v8::internal 4642 } } // namespace v8::internal
4625 4643
4626 #endif // V8_TARGET_ARCH_IA32 4644 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698