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

Side by Side Diff: src/ia32/lithium-ia32.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
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 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 Representation r = instr->representation(); 2129 Representation r = instr->representation();
2130 if (r.IsSmi()) { 2130 if (r.IsSmi()) {
2131 return DefineAsRegister(new(zone()) LConstantS); 2131 return DefineAsRegister(new(zone()) LConstantS);
2132 } else if (r.IsInteger32()) { 2132 } else if (r.IsInteger32()) {
2133 return DefineAsRegister(new(zone()) LConstantI); 2133 return DefineAsRegister(new(zone()) LConstantI);
2134 } else if (r.IsDouble()) { 2134 } else if (r.IsDouble()) {
2135 double value = instr->DoubleValue(); 2135 double value = instr->DoubleValue();
2136 bool value_is_zero = BitCast<uint64_t, double>(value) == 0; 2136 bool value_is_zero = BitCast<uint64_t, double>(value) == 0;
2137 LOperand* temp = value_is_zero ? NULL : TempRegister(); 2137 LOperand* temp = value_is_zero ? NULL : TempRegister();
2138 return DefineAsRegister(new(zone()) LConstantD(temp)); 2138 return DefineAsRegister(new(zone()) LConstantD(temp));
2139 } else if (r.IsExternal()) {
2140 return DefineAsRegister(new(zone()) LConstantE);
2139 } else if (r.IsTagged()) { 2141 } else if (r.IsTagged()) {
2140 return DefineAsRegister(new(zone()) LConstantT); 2142 return DefineAsRegister(new(zone()) LConstantT);
2141 } else { 2143 } else {
2142 UNREACHABLE(); 2144 UNREACHABLE();
2143 return NULL; 2145 return NULL;
2144 } 2146 }
2145 } 2147 }
2146 2148
2147 2149
2148 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { 2150 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 } else { 2207 } else {
2206 value = UseRegister(instr->value()); 2208 value = UseRegister(instr->value());
2207 temp = NULL; 2209 temp = NULL;
2208 } 2210 }
2209 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); 2211 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp);
2210 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2212 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2211 } 2213 }
2212 2214
2213 2215
2214 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 2216 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
2215 LOperand* obj = UseRegisterAtStart(instr->object()); 2217 LOperand* obj = (instr->access().IsExternalMemory() &&
2218 instr->access().offset() == 0)
2219 ? UseRegisterOrConstantAtStart(instr->object())
2220 : UseRegisterAtStart(instr->object());
2216 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); 2221 return DefineAsRegister(new(zone()) LLoadNamedField(obj));
2217 } 2222 }
2218 2223
2219 2224
2220 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( 2225 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic(
2221 HLoadNamedFieldPolymorphic* instr) { 2226 HLoadNamedFieldPolymorphic* instr) {
2222 ASSERT(instr->representation().IsTagged()); 2227 ASSERT(instr->representation().IsTagged());
2223 if (instr->need_generic()) { 2228 if (instr->need_generic()) {
2224 LOperand* context = UseFixed(instr->context(), esi); 2229 LOperand* context = UseFixed(instr->context(), esi);
2225 LOperand* obj = UseFixed(instr->object(), edx); 2230 LOperand* obj = UseFixed(instr->object(), edx);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 LOperand* object = UseRegister(instr->object()); 2434 LOperand* object = UseRegister(instr->object());
2430 LOperand* temp = TempRegister(); 2435 LOperand* temp = TempRegister();
2431 LTrapAllocationMemento* result = 2436 LTrapAllocationMemento* result =
2432 new(zone()) LTrapAllocationMemento(object, temp); 2437 new(zone()) LTrapAllocationMemento(object, temp);
2433 return AssignEnvironment(result); 2438 return AssignEnvironment(result);
2434 } 2439 }
2435 2440
2436 2441
2437 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { 2442 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
2438 bool is_in_object = instr->access().IsInobject(); 2443 bool is_in_object = instr->access().IsInobject();
2444 bool is_external_location = instr->access().IsExternalMemory() &&
2445 instr->access().offset() == 0;
2439 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2446 bool needs_write_barrier = instr->NeedsWriteBarrier();
2440 bool needs_write_barrier_for_map = !instr->transition().is_null() && 2447 bool needs_write_barrier_for_map = !instr->transition().is_null() &&
2441 instr->NeedsWriteBarrierForMap(); 2448 instr->NeedsWriteBarrierForMap();
2442 2449
2443 LOperand* obj; 2450 LOperand* obj;
2444 if (needs_write_barrier) { 2451 if (needs_write_barrier) {
2445 obj = is_in_object 2452 obj = is_in_object
2446 ? UseRegister(instr->object()) 2453 ? UseRegister(instr->object())
2447 : UseTempRegister(instr->object()); 2454 : UseTempRegister(instr->object());
2455 } else if (is_external_location) {
2456 ASSERT(!is_in_object);
2457 ASSERT(!needs_write_barrier);
2458 ASSERT(!needs_write_barrier_for_map);
2459 obj = UseRegisterOrConstant(instr->object());
2448 } else { 2460 } else {
2449 obj = needs_write_barrier_for_map 2461 obj = needs_write_barrier_for_map
2450 ? UseRegister(instr->object()) 2462 ? UseRegister(instr->object())
2451 : UseRegisterAtStart(instr->object()); 2463 : UseRegisterAtStart(instr->object());
2452 } 2464 }
2453 2465
2454 bool can_be_constant = instr->value()->IsConstant() && 2466 bool can_be_constant = instr->value()->IsConstant() &&
2455 HConstant::cast(instr->value())->NotInNewSpace() && 2467 HConstant::cast(instr->value())->NotInNewSpace() &&
2456 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); 2468 !(FLAG_track_double_fields && instr->field_representation().IsDouble());
2457 2469
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2765 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2777 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2766 LOperand* object = UseRegister(instr->object()); 2778 LOperand* object = UseRegister(instr->object());
2767 LOperand* index = UseTempRegister(instr->index()); 2779 LOperand* index = UseTempRegister(instr->index());
2768 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2780 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2769 } 2781 }
2770 2782
2771 2783
2772 } } // namespace v8::internal 2784 } } // namespace v8::internal
2773 2785
2774 #endif // V8_TARGET_ARCH_IA32 2786 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698