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

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

Issue 8965038: Clean up handling of global cell stores in the optimizing compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/assembler.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 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 2255
2256 __ mov(r2, Operand(instr->name())); 2256 __ mov(r2, Operand(instr->name()));
2257 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET 2257 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET
2258 : RelocInfo::CODE_TARGET_CONTEXT; 2258 : RelocInfo::CODE_TARGET_CONTEXT;
2259 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); 2259 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
2260 CallCode(ic, mode, instr); 2260 CallCode(ic, mode, instr);
2261 } 2261 }
2262 2262
2263 2263
2264 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2264 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2265 Register value = ToRegister(instr->InputAt(0)); 2265 Register value = ToRegister(instr->value());
2266 Register scratch = scratch0(); 2266 Register cell = scratch0();
2267 Register scratch2 = ToRegister(instr->TempAt(0));
2268 2267
2269 // Load the cell. 2268 // Load the cell.
2270 __ mov(scratch, Operand(Handle<Object>(instr->hydrogen()->cell()))); 2269 __ mov(cell, Operand(instr->hydrogen()->cell()));
2271 2270
2272 // If the cell we are storing to contains the hole it could have 2271 // If the cell we are storing to contains the hole it could have
2273 // been deleted from the property dictionary. In that case, we need 2272 // been deleted from the property dictionary. In that case, we need
2274 // to update the property details in the property dictionary to mark 2273 // to update the property details in the property dictionary to mark
2275 // it as no longer deleted. 2274 // it as no longer deleted.
2276 if (instr->hydrogen()->RequiresHoleCheck()) { 2275 if (instr->hydrogen()->RequiresHoleCheck()) {
2277 __ ldr(scratch2, 2276 // We use a temp to check the payload (CompareRoot might clobber ip).
2278 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); 2277 Register payload = ToRegister(instr->TempAt(0));
2279 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 2278 __ ldr(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset));
2280 __ cmp(scratch2, ip); 2279 __ CompareRoot(payload, Heap::kTheHoleValueRootIndex);
2281 DeoptimizeIf(eq, instr->environment()); 2280 DeoptimizeIf(eq, instr->environment());
2282 } 2281 }
2283 2282
2284 // Store the value. 2283 // Store the value.
2285 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); 2284 __ str(value, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset));
2286 // Cells are always rescanned, so no write barrier here. 2285 // Cells are always rescanned, so no write barrier here.
2287 } 2286 }
2288 2287
2289 2288
2290 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { 2289 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
2291 ASSERT(ToRegister(instr->global_object()).is(r1)); 2290 ASSERT(ToRegister(instr->global_object()).is(r1));
2292 ASSERT(ToRegister(instr->value()).is(r0)); 2291 ASSERT(ToRegister(instr->value()).is(r0));
2293 2292
2294 __ mov(r2, Operand(instr->name())); 2293 __ mov(r2, Operand(instr->name()));
2295 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 2294 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after
4728 ASSERT(osr_pc_offset_ == -1); 4727 ASSERT(osr_pc_offset_ == -1);
4729 osr_pc_offset_ = masm()->pc_offset(); 4728 osr_pc_offset_ = masm()->pc_offset();
4730 } 4729 }
4731 4730
4732 4731
4733 4732
4734 4733
4735 #undef __ 4734 #undef __
4736 4735
4737 } } // namespace v8::internal 4736 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698