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

Side by Side Diff: src/x64/lithium-codegen-x64.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/mips/lithium-codegen-mips.cc ('k') | test/mjsunit/function-named-self-reference.js » ('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 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr); 2062 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
2063 } 2063 }
2064 2064
2065 2065
2066 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2066 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2067 Register context = ToRegister(instr->context()); 2067 Register context = ToRegister(instr->context());
2068 Register result = ToRegister(instr->result()); 2068 Register result = ToRegister(instr->result());
2069 __ movq(result, ContextOperand(context, instr->slot_index())); 2069 __ movq(result, ContextOperand(context, instr->slot_index()));
2070 if (instr->hydrogen()->RequiresHoleCheck()) { 2070 if (instr->hydrogen()->RequiresHoleCheck()) {
2071 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2071 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2072 DeoptimizeIf(equal, instr->environment()); 2072 if (instr->hydrogen()->DeoptimizesOnHole()) {
2073 DeoptimizeIf(equal, instr->environment());
2074 } else {
2075 Label is_not_hole;
2076 __ j(not_equal, &is_not_hole, Label::kNear);
2077 __ movq(result, factory()->undefined_value(), RelocInfo::NONE);
2078 __ bind(&is_not_hole);
2079 }
2073 } 2080 }
2074 } 2081 }
2075 2082
2076 2083
2077 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2084 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2078 Register context = ToRegister(instr->context()); 2085 Register context = ToRegister(instr->context());
2079 Register value = ToRegister(instr->value()); 2086 Register value = ToRegister(instr->value());
2087
2080 Operand target = ContextOperand(context, instr->slot_index()); 2088 Operand target = ContextOperand(context, instr->slot_index());
2089
2090 Label skip_assignment;
2081 if (instr->hydrogen()->RequiresHoleCheck()) { 2091 if (instr->hydrogen()->RequiresHoleCheck()) {
2082 __ CompareRoot(target, Heap::kTheHoleValueRootIndex); 2092 __ CompareRoot(target, Heap::kTheHoleValueRootIndex);
2083 DeoptimizeIf(equal, instr->environment()); 2093 if (instr->hydrogen()->DeoptimizesOnHole()) {
2094 DeoptimizeIf(equal, instr->environment());
2095 } else {
2096 __ j(not_equal, &skip_assignment, Label::kNear);
2097 }
2084 } 2098 }
2085 __ movq(target, value); 2099 __ movq(target, value);
2100
2086 if (instr->hydrogen()->NeedsWriteBarrier()) { 2101 if (instr->hydrogen()->NeedsWriteBarrier()) {
2087 HType type = instr->hydrogen()->value()->type(); 2102 HType type = instr->hydrogen()->value()->type();
2088 SmiCheck check_needed = 2103 SmiCheck check_needed =
2089 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2104 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2090 int offset = Context::SlotOffset(instr->slot_index()); 2105 int offset = Context::SlotOffset(instr->slot_index());
2091 Register scratch = ToRegister(instr->TempAt(0)); 2106 Register scratch = ToRegister(instr->TempAt(0));
2092 __ RecordWriteContextSlot(context, 2107 __ RecordWriteContextSlot(context,
2093 offset, 2108 offset,
2094 value, 2109 value,
2095 scratch, 2110 scratch,
2096 kSaveFPRegs, 2111 kSaveFPRegs,
2097 EMIT_REMEMBERED_SET, 2112 EMIT_REMEMBERED_SET,
2098 check_needed); 2113 check_needed);
2099 } 2114 }
2115
2116 __ bind(&skip_assignment);
2100 } 2117 }
2101 2118
2102 2119
2103 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2120 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2104 Register object = ToRegister(instr->InputAt(0)); 2121 Register object = ToRegister(instr->InputAt(0));
2105 Register result = ToRegister(instr->result()); 2122 Register result = ToRegister(instr->result());
2106 if (instr->hydrogen()->is_in_object()) { 2123 if (instr->hydrogen()->is_in_object()) {
2107 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); 2124 __ movq(result, FieldOperand(object, instr->hydrogen()->offset()));
2108 } else { 2125 } else {
2109 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); 2126 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after
4317 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4334 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4318 ASSERT(osr_pc_offset_ == -1); 4335 ASSERT(osr_pc_offset_ == -1);
4319 osr_pc_offset_ = masm()->pc_offset(); 4336 osr_pc_offset_ = masm()->pc_offset();
4320 } 4337 }
4321 4338
4322 #undef __ 4339 #undef __
4323 4340
4324 } } // namespace v8::internal 4341 } } // namespace v8::internal
4325 4342
4326 #endif // V8_TARGET_ARCH_X64 4343 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | test/mjsunit/function-named-self-reference.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698