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

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

Issue 9004017: MIPS: Clean up handling of global cell stores in the optimizing compiler. (Closed)
Patch Set: 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 | « no previous file | src/mips/lithium-mips.h » ('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 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 2134
2135 __ li(a2, Operand(instr->name())); 2135 __ li(a2, Operand(instr->name()));
2136 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET 2136 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET
2137 : RelocInfo::CODE_TARGET_CONTEXT; 2137 : RelocInfo::CODE_TARGET_CONTEXT;
2138 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); 2138 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
2139 CallCode(ic, mode, instr); 2139 CallCode(ic, mode, instr);
2140 } 2140 }
2141 2141
2142 2142
2143 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2143 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2144 Register value = ToRegister(instr->InputAt(0)); 2144 Register value = ToRegister(instr->value());
2145 Register scratch = scratch0(); 2145 Register cell = scratch0();
2146 Register scratch2 = ToRegister(instr->TempAt(0));
2147 2146
2148 // Load the cell. 2147 // Load the cell.
2149 __ li(scratch, Operand(Handle<Object>(instr->hydrogen()->cell()))); 2148 __ li(cell, Operand(instr->hydrogen()->cell()));
2150 2149
2151 // If the cell we are storing to contains the hole it could have 2150 // If the cell we are storing to contains the hole it could have
2152 // been deleted from the property dictionary. In that case, we need 2151 // been deleted from the property dictionary. In that case, we need
2153 // to update the property details in the property dictionary to mark 2152 // to update the property details in the property dictionary to mark
2154 // it as no longer deleted. 2153 // it as no longer deleted.
2155 if (instr->hydrogen()->RequiresHoleCheck()) { 2154 if (instr->hydrogen()->RequiresHoleCheck()) {
2156 __ lw(scratch2, 2155 // We use a temp to check the payload.
2157 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); 2156 Register payload = ToRegister(instr->TempAt(0));
2157 __ lw(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset));
2158 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2158 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2159 DeoptimizeIf(eq, instr->environment(), scratch2, Operand(at)); 2159 DeoptimizeIf(eq, instr->environment(), payload, Operand(at));
2160 } 2160 }
2161 2161
2162 // Store the value. 2162 // Store the value.
2163 __ sw(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); 2163 __ sw(value, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset));
2164 // Cells are always rescanned, so no write barrier here. 2164 // Cells are always rescanned, so no write barrier here.
2165 } 2165 }
2166 2166
2167 2167
2168 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { 2168 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
2169 ASSERT(ToRegister(instr->global_object()).is(a1)); 2169 ASSERT(ToRegister(instr->global_object()).is(a1));
2170 ASSERT(ToRegister(instr->value()).is(a0)); 2170 ASSERT(ToRegister(instr->value()).is(a0));
2171 2171
2172 __ li(a2, Operand(instr->name())); 2172 __ li(a2, Operand(instr->name()));
2173 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 2173 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after
4680 ASSERT(!environment->HasBeenRegistered()); 4680 ASSERT(!environment->HasBeenRegistered());
4681 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4681 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4682 ASSERT(osr_pc_offset_ == -1); 4682 ASSERT(osr_pc_offset_ == -1);
4683 osr_pc_offset_ = masm()->pc_offset(); 4683 osr_pc_offset_ = masm()->pc_offset();
4684 } 4684 }
4685 4685
4686 4686
4687 #undef __ 4687 #undef __
4688 4688
4689 } } // namespace v8::internal 4689 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698