OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/lithium-inl.h" | 10 #include "src/lithium-inl.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { | 337 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { |
338 arguments()->PrintTo(stream); | 338 arguments()->PrintTo(stream); |
339 stream->Add(" length "); | 339 stream->Add(" length "); |
340 length()->PrintTo(stream); | 340 length()->PrintTo(stream); |
341 stream->Add(" index "); | 341 stream->Add(" index "); |
342 index()->PrintTo(stream); | 342 index()->PrintTo(stream); |
343 } | 343 } |
344 | 344 |
345 | 345 |
| 346 void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) { |
| 347 stream->Add(String::cast(*name())->ToCString().get()); |
| 348 stream->Add(" depth:%d slot:%d", depth(), slot_index()); |
| 349 } |
| 350 |
| 351 |
346 void LStoreNamedField::PrintDataTo(StringStream* stream) { | 352 void LStoreNamedField::PrintDataTo(StringStream* stream) { |
347 object()->PrintTo(stream); | 353 object()->PrintTo(stream); |
348 std::ostringstream os; | 354 std::ostringstream os; |
349 os << hydrogen()->access() << " <- "; | 355 os << hydrogen()->access() << " <- "; |
350 stream->Add(os.str().c_str()); | 356 stream->Add(os.str().c_str()); |
351 value()->PrintTo(stream); | 357 value()->PrintTo(stream); |
352 } | 358 } |
353 | 359 |
354 | 360 |
355 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { | 361 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { |
356 object()->PrintTo(stream); | 362 object()->PrintTo(stream); |
357 stream->Add("."); | 363 stream->Add("."); |
358 stream->Add(String::cast(*name())->ToCString().get()); | 364 stream->Add(String::cast(*name())->ToCString().get()); |
359 stream->Add(" <- "); | 365 stream->Add(" <- "); |
360 value()->PrintTo(stream); | 366 value()->PrintTo(stream); |
361 } | 367 } |
362 | 368 |
363 | 369 |
| 370 void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) { |
| 371 stream->Add(String::cast(*name())->ToCString().get()); |
| 372 stream->Add(" <- "); |
| 373 value()->PrintTo(stream); |
| 374 stream->Add(" depth:%d slot:%d", depth(), slot_index()); |
| 375 } |
| 376 |
| 377 |
364 void LLoadKeyed::PrintDataTo(StringStream* stream) { | 378 void LLoadKeyed::PrintDataTo(StringStream* stream) { |
365 elements()->PrintTo(stream); | 379 elements()->PrintTo(stream); |
366 stream->Add("["); | 380 stream->Add("["); |
367 key()->PrintTo(stream); | 381 key()->PrintTo(stream); |
368 if (hydrogen()->IsDehoisted()) { | 382 if (hydrogen()->IsDehoisted()) { |
369 stream->Add(" + %d]", base_offset()); | 383 stream->Add(" + %d]", base_offset()); |
370 } else { | 384 } else { |
371 stream->Add("]"); | 385 stream->Add("]"); |
372 } | 386 } |
373 } | 387 } |
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2101 LOperand* vector = NULL; | 2115 LOperand* vector = NULL; |
2102 if (instr->HasVectorAndSlot()) { | 2116 if (instr->HasVectorAndSlot()) { |
2103 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | 2117 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
2104 } | 2118 } |
2105 LLoadGlobalGeneric* result = | 2119 LLoadGlobalGeneric* result = |
2106 new (zone()) LLoadGlobalGeneric(context, global_object, vector); | 2120 new (zone()) LLoadGlobalGeneric(context, global_object, vector); |
2107 return MarkAsCall(DefineFixed(result, r3), instr); | 2121 return MarkAsCall(DefineFixed(result, r3), instr); |
2108 } | 2122 } |
2109 | 2123 |
2110 | 2124 |
| 2125 LInstruction* LChunkBuilder::DoLoadGlobalViaContext( |
| 2126 HLoadGlobalViaContext* instr) { |
| 2127 LOperand* context = UseFixed(instr->context(), cp); |
| 2128 DCHECK(instr->slot_index() > 0); |
| 2129 LLoadGlobalViaContext* result = new (zone()) LLoadGlobalViaContext(context); |
| 2130 return MarkAsCall(DefineFixed(result, r3), instr); |
| 2131 } |
| 2132 |
| 2133 |
2111 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2134 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
2112 LOperand* context = UseRegisterAtStart(instr->value()); | 2135 LOperand* context = UseRegisterAtStart(instr->value()); |
2113 LInstruction* result = | 2136 LInstruction* result = |
2114 DefineAsRegister(new (zone()) LLoadContextSlot(context)); | 2137 DefineAsRegister(new (zone()) LLoadContextSlot(context)); |
2115 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | 2138 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
2116 result = AssignEnvironment(result); | 2139 result = AssignEnvironment(result); |
2117 } | 2140 } |
2118 return result; | 2141 return result; |
2119 } | 2142 } |
2120 | 2143 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | 2404 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
2382 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | 2405 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
2383 } | 2406 } |
2384 | 2407 |
2385 LStoreNamedGeneric* result = | 2408 LStoreNamedGeneric* result = |
2386 new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector); | 2409 new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector); |
2387 return MarkAsCall(result, instr); | 2410 return MarkAsCall(result, instr); |
2388 } | 2411 } |
2389 | 2412 |
2390 | 2413 |
| 2414 LInstruction* LChunkBuilder::DoStoreGlobalViaContext( |
| 2415 HStoreGlobalViaContext* instr) { |
| 2416 LOperand* context = UseFixed(instr->context(), cp); |
| 2417 LOperand* value = UseFixed(instr->value(), |
| 2418 StoreGlobalViaContextDescriptor::ValueRegister()); |
| 2419 DCHECK(instr->slot_index() > 0); |
| 2420 |
| 2421 LStoreGlobalViaContext* result = |
| 2422 new (zone()) LStoreGlobalViaContext(context, value); |
| 2423 return MarkAsCall(result, instr); |
| 2424 } |
| 2425 |
| 2426 |
2391 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2427 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
2392 LOperand* context = UseFixed(instr->context(), cp); | 2428 LOperand* context = UseFixed(instr->context(), cp); |
2393 LOperand* left = UseFixed(instr->left(), r4); | 2429 LOperand* left = UseFixed(instr->left(), r4); |
2394 LOperand* right = UseFixed(instr->right(), r3); | 2430 LOperand* right = UseFixed(instr->right(), r3); |
2395 return MarkAsCall( | 2431 return MarkAsCall( |
2396 DefineFixed(new (zone()) LStringAdd(context, left, right), r3), instr); | 2432 DefineFixed(new (zone()) LStringAdd(context, left, right), r3), instr); |
2397 } | 2433 } |
2398 | 2434 |
2399 | 2435 |
2400 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2436 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2638 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2674 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
2639 HAllocateBlockContext* instr) { | 2675 HAllocateBlockContext* instr) { |
2640 LOperand* context = UseFixed(instr->context(), cp); | 2676 LOperand* context = UseFixed(instr->context(), cp); |
2641 LOperand* function = UseRegisterAtStart(instr->function()); | 2677 LOperand* function = UseRegisterAtStart(instr->function()); |
2642 LAllocateBlockContext* result = | 2678 LAllocateBlockContext* result = |
2643 new (zone()) LAllocateBlockContext(context, function); | 2679 new (zone()) LAllocateBlockContext(context, function); |
2644 return MarkAsCall(DefineFixed(result, cp), instr); | 2680 return MarkAsCall(DefineFixed(result, cp), instr); |
2645 } | 2681 } |
2646 } // namespace internal | 2682 } // namespace internal |
2647 } // namespace v8 | 2683 } // namespace v8 |
OLD | NEW |