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/x64/lithium-x64.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/x64/lithium-x64.h ('k') | src/x87/lithium-codegen-x87.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 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_X64 9 #if V8_TARGET_ARCH_X64
10 10
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 int index = GetNextSpillIndex(kind); 367 int index = GetNextSpillIndex(kind);
368 if (kind == DOUBLE_REGISTERS) { 368 if (kind == DOUBLE_REGISTERS) {
369 return LDoubleStackSlot::Create(index, zone()); 369 return LDoubleStackSlot::Create(index, zone());
370 } else { 370 } else {
371 DCHECK(kind == GENERAL_REGISTERS); 371 DCHECK(kind == GENERAL_REGISTERS);
372 return LStackSlot::Create(index, zone()); 372 return LStackSlot::Create(index, zone());
373 } 373 }
374 } 374 }
375 375
376 376
377 void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) {
378 stream->Add(String::cast(*name())->ToCString().get());
379 stream->Add(" depth:%d slot:%d", depth(), slot_index());
380 }
381
382
377 void LStoreNamedField::PrintDataTo(StringStream* stream) { 383 void LStoreNamedField::PrintDataTo(StringStream* stream) {
378 object()->PrintTo(stream); 384 object()->PrintTo(stream);
379 std::ostringstream os; 385 std::ostringstream os;
380 os << hydrogen()->access() << " <- "; 386 os << hydrogen()->access() << " <- ";
381 stream->Add(os.str().c_str()); 387 stream->Add(os.str().c_str());
382 value()->PrintTo(stream); 388 value()->PrintTo(stream);
383 } 389 }
384 390
385 391
386 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { 392 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
387 object()->PrintTo(stream); 393 object()->PrintTo(stream);
388 stream->Add("."); 394 stream->Add(".");
389 stream->Add(String::cast(*name())->ToCString().get()); 395 stream->Add(String::cast(*name())->ToCString().get());
390 stream->Add(" <- "); 396 stream->Add(" <- ");
391 value()->PrintTo(stream); 397 value()->PrintTo(stream);
392 } 398 }
393 399
394 400
401 void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) {
402 stream->Add(String::cast(*name())->ToCString().get());
403 stream->Add(" <- ");
404 value()->PrintTo(stream);
405 stream->Add(" depth:%d slot:%d", depth(), slot_index());
406 }
407
408
395 void LLoadKeyed::PrintDataTo(StringStream* stream) { 409 void LLoadKeyed::PrintDataTo(StringStream* stream) {
396 elements()->PrintTo(stream); 410 elements()->PrintTo(stream);
397 stream->Add("["); 411 stream->Add("[");
398 key()->PrintTo(stream); 412 key()->PrintTo(stream);
399 if (hydrogen()->IsDehoisted()) { 413 if (hydrogen()->IsDehoisted()) {
400 stream->Add(" + %d]", base_offset()); 414 stream->Add(" + %d]", base_offset());
401 } else { 415 } else {
402 stream->Add("]"); 416 stream->Add("]");
403 } 417 }
404 } 418 }
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 if (instr->HasVectorAndSlot()) { 2113 if (instr->HasVectorAndSlot()) {
2100 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); 2114 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister());
2101 } 2115 }
2102 2116
2103 LLoadGlobalGeneric* result = 2117 LLoadGlobalGeneric* result =
2104 new(zone()) LLoadGlobalGeneric(context, global_object, vector); 2118 new(zone()) LLoadGlobalGeneric(context, global_object, vector);
2105 return MarkAsCall(DefineFixed(result, rax), instr); 2119 return MarkAsCall(DefineFixed(result, rax), instr);
2106 } 2120 }
2107 2121
2108 2122
2123 LInstruction* LChunkBuilder::DoLoadGlobalViaContext(
2124 HLoadGlobalViaContext* instr) {
2125 LOperand* context = UseFixed(instr->context(), rsi);
2126 DCHECK(instr->slot_index() > 0);
2127 LLoadGlobalViaContext* result = new (zone()) LLoadGlobalViaContext(context);
2128 return MarkAsCall(DefineFixed(result, rax), instr);
2129 }
2130
2131
2109 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { 2132 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
2110 LOperand* context = UseRegisterAtStart(instr->value()); 2133 LOperand* context = UseRegisterAtStart(instr->value());
2111 LInstruction* result = 2134 LInstruction* result =
2112 DefineAsRegister(new(zone()) LLoadContextSlot(context)); 2135 DefineAsRegister(new(zone()) LLoadContextSlot(context));
2113 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { 2136 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) {
2114 result = AssignEnvironment(result); 2137 result = AssignEnvironment(result);
2115 } 2138 }
2116 return result; 2139 return result;
2117 } 2140 }
2118 2141
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); 2487 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister());
2465 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); 2488 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister());
2466 } 2489 }
2467 2490
2468 LStoreNamedGeneric* result = 2491 LStoreNamedGeneric* result =
2469 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); 2492 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector);
2470 return MarkAsCall(result, instr); 2493 return MarkAsCall(result, instr);
2471 } 2494 }
2472 2495
2473 2496
2497 LInstruction* LChunkBuilder::DoStoreGlobalViaContext(
2498 HStoreGlobalViaContext* instr) {
2499 LOperand* context = UseFixed(instr->context(), rsi);
2500 LOperand* value = UseFixed(instr->value(),
2501 StoreGlobalViaContextDescriptor::ValueRegister());
2502 DCHECK(instr->slot_index() > 0);
2503
2504 LStoreGlobalViaContext* result =
2505 new (zone()) LStoreGlobalViaContext(context, value);
2506 return MarkAsCall(result, instr);
2507 }
2508
2509
2474 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { 2510 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) {
2475 LOperand* context = UseFixed(instr->context(), rsi); 2511 LOperand* context = UseFixed(instr->context(), rsi);
2476 LOperand* left = UseFixed(instr->left(), rdx); 2512 LOperand* left = UseFixed(instr->left(), rdx);
2477 LOperand* right = UseFixed(instr->right(), rax); 2513 LOperand* right = UseFixed(instr->right(), rax);
2478 return MarkAsCall( 2514 return MarkAsCall(
2479 DefineFixed(new(zone()) LStringAdd(context, left, right), rax), instr); 2515 DefineFixed(new(zone()) LStringAdd(context, left, right), rax), instr);
2480 } 2516 }
2481 2517
2482 2518
2483 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { 2519 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 LAllocateBlockContext* result = 2773 LAllocateBlockContext* result =
2738 new(zone()) LAllocateBlockContext(context, function); 2774 new(zone()) LAllocateBlockContext(context, function);
2739 return MarkAsCall(DefineFixed(result, rsi), instr); 2775 return MarkAsCall(DefineFixed(result, rsi), instr);
2740 } 2776 }
2741 2777
2742 2778
2743 } // namespace internal 2779 } // namespace internal
2744 } // namespace v8 2780 } // namespace v8
2745 2781
2746 #endif // V8_TARGET_ARCH_X64 2782 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698