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

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

Issue 1228113008: Crankshaft part of the 'loads and stores to global vars through property cell shortcuts' feature. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments + regression test Created 5 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
« no previous file with comments | « src/x87/lithium-x87.h ('k') | test/mjsunit/regress/regress-crbug-510738.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_X87 9 #if V8_TARGET_ARCH_X87
10 10
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 int index = GetNextSpillIndex(kind); 383 int index = GetNextSpillIndex(kind);
384 if (kind == DOUBLE_REGISTERS) { 384 if (kind == DOUBLE_REGISTERS) {
385 return LDoubleStackSlot::Create(index, zone()); 385 return LDoubleStackSlot::Create(index, zone());
386 } else { 386 } else {
387 DCHECK(kind == GENERAL_REGISTERS); 387 DCHECK(kind == GENERAL_REGISTERS);
388 return LStackSlot::Create(index, zone()); 388 return LStackSlot::Create(index, zone());
389 } 389 }
390 } 390 }
391 391
392 392
393 void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) {
394 stream->Add(String::cast(*name())->ToCString().get());
395 stream->Add(" depth:%d slot:%d", depth(), slot_index());
396 }
397
398
393 void LStoreNamedField::PrintDataTo(StringStream* stream) { 399 void LStoreNamedField::PrintDataTo(StringStream* stream) {
394 object()->PrintTo(stream); 400 object()->PrintTo(stream);
395 std::ostringstream os; 401 std::ostringstream os;
396 os << hydrogen()->access() << " <- "; 402 os << hydrogen()->access() << " <- ";
397 stream->Add(os.str().c_str()); 403 stream->Add(os.str().c_str());
398 value()->PrintTo(stream); 404 value()->PrintTo(stream);
399 } 405 }
400 406
401 407
402 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { 408 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
403 object()->PrintTo(stream); 409 object()->PrintTo(stream);
404 stream->Add("."); 410 stream->Add(".");
405 stream->Add(String::cast(*name())->ToCString().get()); 411 stream->Add(String::cast(*name())->ToCString().get());
406 stream->Add(" <- "); 412 stream->Add(" <- ");
407 value()->PrintTo(stream); 413 value()->PrintTo(stream);
408 } 414 }
409 415
410 416
417 void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) {
418 stream->Add(String::cast(*name())->ToCString().get());
419 stream->Add(" <- ");
420 value()->PrintTo(stream);
421 stream->Add(" depth:%d slot:%d", depth(), slot_index());
422 }
423
424
411 void LLoadKeyed::PrintDataTo(StringStream* stream) { 425 void LLoadKeyed::PrintDataTo(StringStream* stream) {
412 elements()->PrintTo(stream); 426 elements()->PrintTo(stream);
413 stream->Add("["); 427 stream->Add("[");
414 key()->PrintTo(stream); 428 key()->PrintTo(stream);
415 if (hydrogen()->IsDehoisted()) { 429 if (hydrogen()->IsDehoisted()) {
416 stream->Add(" + %d]", base_offset()); 430 stream->Add(" + %d]", base_offset());
417 } else { 431 } else {
418 stream->Add("]"); 432 stream->Add("]");
419 } 433 }
420 } 434 }
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 if (instr->HasVectorAndSlot()) { 2149 if (instr->HasVectorAndSlot()) {
2136 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); 2150 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
2137 } 2151 }
2138 2152
2139 LLoadGlobalGeneric* result = 2153 LLoadGlobalGeneric* result =
2140 new(zone()) LLoadGlobalGeneric(context, global_object, vector); 2154 new(zone()) LLoadGlobalGeneric(context, global_object, vector);
2141 return MarkAsCall(DefineFixed(result, eax), instr); 2155 return MarkAsCall(DefineFixed(result, eax), instr);
2142 } 2156 }
2143 2157
2144 2158
2159 LInstruction* LChunkBuilder::DoLoadGlobalViaContext(
2160 HLoadGlobalViaContext* instr) {
2161 LOperand* context = UseFixed(instr->context(), esi);
2162 DCHECK(instr->slot_index() > 0);
2163 LLoadGlobalViaContext* result = new (zone()) LLoadGlobalViaContext(context);
2164 return MarkAsCall(DefineFixed(result, eax), instr);
2165 }
2166
2167
2145 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { 2168 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
2146 LOperand* context = UseRegisterAtStart(instr->value()); 2169 LOperand* context = UseRegisterAtStart(instr->value());
2147 LInstruction* result = 2170 LInstruction* result =
2148 DefineAsRegister(new(zone()) LLoadContextSlot(context)); 2171 DefineAsRegister(new(zone()) LLoadContextSlot(context));
2149 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { 2172 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) {
2150 result = AssignEnvironment(result); 2173 result = AssignEnvironment(result);
2151 } 2174 }
2152 return result; 2175 return result;
2153 } 2176 }
2154 2177
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2480 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); 2503 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
2481 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); 2504 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
2482 } 2505 }
2483 2506
2484 LStoreNamedGeneric* result = 2507 LStoreNamedGeneric* result =
2485 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); 2508 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector);
2486 return MarkAsCall(result, instr); 2509 return MarkAsCall(result, instr);
2487 } 2510 }
2488 2511
2489 2512
2513 LInstruction* LChunkBuilder::DoStoreGlobalViaContext(
2514 HStoreGlobalViaContext* instr) {
2515 LOperand* context = UseFixed(instr->context(), esi);
2516 LOperand* value = UseFixed(instr->value(),
2517 StoreGlobalViaContextDescriptor::ValueRegister());
2518 DCHECK(instr->slot_index() > 0);
2519
2520 LStoreGlobalViaContext* result =
2521 new (zone()) LStoreGlobalViaContext(context, value);
2522 return MarkAsCall(result, instr);
2523 }
2524
2525
2490 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { 2526 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) {
2491 LOperand* context = UseFixed(instr->context(), esi); 2527 LOperand* context = UseFixed(instr->context(), esi);
2492 LOperand* left = UseFixed(instr->left(), edx); 2528 LOperand* left = UseFixed(instr->left(), edx);
2493 LOperand* right = UseFixed(instr->right(), eax); 2529 LOperand* right = UseFixed(instr->right(), eax);
2494 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right); 2530 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right);
2495 return MarkAsCall(DefineFixed(string_add, eax), instr); 2531 return MarkAsCall(DefineFixed(string_add, eax), instr);
2496 } 2532 }
2497 2533
2498 2534
2499 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { 2535 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 LAllocateBlockContext* result = 2793 LAllocateBlockContext* result =
2758 new(zone()) LAllocateBlockContext(context, function); 2794 new(zone()) LAllocateBlockContext(context, function);
2759 return MarkAsCall(DefineFixed(result, esi), instr); 2795 return MarkAsCall(DefineFixed(result, esi), instr);
2760 } 2796 }
2761 2797
2762 2798
2763 } // namespace internal 2799 } // namespace internal
2764 } // namespace v8 2800 } // namespace v8
2765 2801
2766 #endif // V8_TARGET_ARCH_X87 2802 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/lithium-x87.h ('k') | test/mjsunit/regress/regress-crbug-510738.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698