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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 19562003: Add support for IncrementCounter in Hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More code style Created 7 years, 5 months 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
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 1990
1991 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { 1991 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1992 Representation r = instr->representation(); 1992 Representation r = instr->representation();
1993 if (r.IsSmi()) { 1993 if (r.IsSmi()) {
1994 return DefineAsRegister(new(zone()) LConstantS); 1994 return DefineAsRegister(new(zone()) LConstantS);
1995 } else if (r.IsInteger32()) { 1995 } else if (r.IsInteger32()) {
1996 return DefineAsRegister(new(zone()) LConstantI); 1996 return DefineAsRegister(new(zone()) LConstantI);
1997 } else if (r.IsDouble()) { 1997 } else if (r.IsDouble()) {
1998 LOperand* temp = TempRegister(); 1998 LOperand* temp = TempRegister();
1999 return DefineAsRegister(new(zone()) LConstantD(temp)); 1999 return DefineAsRegister(new(zone()) LConstantD(temp));
2000 } else if (r.IsExternal()) {
2001 return DefineAsRegister(new(zone()) LConstantE);
2000 } else if (r.IsTagged()) { 2002 } else if (r.IsTagged()) {
2001 return DefineAsRegister(new(zone()) LConstantT); 2003 return DefineAsRegister(new(zone()) LConstantT);
2002 } else { 2004 } else {
2003 UNREACHABLE(); 2005 UNREACHABLE();
2004 return NULL; 2006 return NULL;
2005 } 2007 }
2006 } 2008 }
2007 2009
2008 2010
2009 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { 2011 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 context = UseRegister(instr->context()); 2069 context = UseRegister(instr->context());
2068 value = UseRegister(instr->value()); 2070 value = UseRegister(instr->value());
2069 temp = NULL; 2071 temp = NULL;
2070 } 2072 }
2071 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); 2073 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp);
2072 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2074 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2073 } 2075 }
2074 2076
2075 2077
2076 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 2078 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
2079 if (instr->access().IsExternalMemory() && instr->access().offset() == 0) {
2080 LOperand* obj = UseRegisterOrConstantAtStart(instr->object());
2081 return DefineFixed(new(zone()) LLoadNamedField(obj), rax);
2082 }
2077 LOperand* obj = UseRegisterAtStart(instr->object()); 2083 LOperand* obj = UseRegisterAtStart(instr->object());
2078 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); 2084 return DefineAsRegister(new(zone()) LLoadNamedField(obj));
2079 } 2085 }
2080 2086
2081 2087
2082 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( 2088 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic(
2083 HLoadNamedFieldPolymorphic* instr) { 2089 HLoadNamedFieldPolymorphic* instr) {
2084 ASSERT(instr->representation().IsTagged()); 2090 ASSERT(instr->representation().IsTagged());
2085 if (instr->need_generic()) { 2091 if (instr->need_generic()) {
2086 LOperand* obj = UseFixed(instr->object(), rax); 2092 LOperand* obj = UseFixed(instr->object(), rax);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 LOperand* object = UseRegister(instr->object()); 2257 LOperand* object = UseRegister(instr->object());
2252 LOperand* temp = TempRegister(); 2258 LOperand* temp = TempRegister();
2253 LTrapAllocationMemento* result = 2259 LTrapAllocationMemento* result =
2254 new(zone()) LTrapAllocationMemento(object, temp); 2260 new(zone()) LTrapAllocationMemento(object, temp);
2255 return AssignEnvironment(result); 2261 return AssignEnvironment(result);
2256 } 2262 }
2257 2263
2258 2264
2259 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { 2265 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
2260 bool is_in_object = instr->access().IsInobject(); 2266 bool is_in_object = instr->access().IsInobject();
2267 bool is_external_location = instr->access().IsExternalMemory() &&
2268 instr->access().offset() == 0;
2261 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2269 bool needs_write_barrier = instr->NeedsWriteBarrier();
2262 bool needs_write_barrier_for_map = !instr->transition().is_null() && 2270 bool needs_write_barrier_for_map = !instr->transition().is_null() &&
2263 instr->NeedsWriteBarrierForMap(); 2271 instr->NeedsWriteBarrierForMap();
2264 2272
2265 LOperand* obj; 2273 LOperand* obj;
2266 if (needs_write_barrier) { 2274 if (needs_write_barrier) {
2267 obj = is_in_object 2275 obj = is_in_object
2268 ? UseRegister(instr->object()) 2276 ? UseRegister(instr->object())
2269 : UseTempRegister(instr->object()); 2277 : UseTempRegister(instr->object());
2278 } else if (is_external_location) {
2279 ASSERT(!is_in_object);
2280 ASSERT(!needs_write_barrier);
2281 ASSERT(!needs_write_barrier_for_map);
2282 obj = UseRegisterOrConstant(instr->object());
2270 } else { 2283 } else {
2271 obj = needs_write_barrier_for_map 2284 obj = needs_write_barrier_for_map
2272 ? UseRegister(instr->object()) 2285 ? UseRegister(instr->object())
2273 : UseRegisterAtStart(instr->object()); 2286 : UseRegisterAtStart(instr->object());
2274 } 2287 }
2275 2288
2276 bool can_be_constant = instr->value()->IsConstant() && 2289 bool can_be_constant = instr->value()->IsConstant() &&
2277 HConstant::cast(instr->value())->NotInNewSpace() && 2290 HConstant::cast(instr->value())->NotInNewSpace() &&
2278 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); 2291 !(FLAG_track_double_fields && instr->field_representation().IsDouble());
2279 2292
2280 LOperand* val; 2293 LOperand* val;
2281 if (needs_write_barrier) { 2294 if (needs_write_barrier) {
2282 val = UseTempRegister(instr->value()); 2295 val = UseTempRegister(instr->value());
2296 } else if (is_external_location) {
2297 val = UseFixed(instr->value(), rax);
2283 } else if (can_be_constant) { 2298 } else if (can_be_constant) {
2284 val = UseRegisterOrConstant(instr->value()); 2299 val = UseRegisterOrConstant(instr->value());
2285 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { 2300 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) {
2286 val = UseTempRegister(instr->value()); 2301 val = UseTempRegister(instr->value());
2287 } else if (FLAG_track_double_fields && 2302 } else if (FLAG_track_double_fields &&
2288 instr->field_representation().IsDouble()) { 2303 instr->field_representation().IsDouble()) {
2289 val = UseRegisterAtStart(instr->value()); 2304 val = UseRegisterAtStart(instr->value());
2290 } else { 2305 } else {
2291 val = UseRegister(instr->value()); 2306 val = UseRegister(instr->value());
2292 } 2307 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
2563 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2578 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2564 LOperand* object = UseRegister(instr->object()); 2579 LOperand* object = UseRegister(instr->object());
2565 LOperand* index = UseTempRegister(instr->index()); 2580 LOperand* index = UseTempRegister(instr->index());
2566 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2581 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2567 } 2582 }
2568 2583
2569 2584
2570 } } // namespace v8::internal 2585 } } // namespace v8::internal
2571 2586
2572 #endif // V8_TARGET_ARCH_X64 2587 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698