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 "src/compiler/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
9 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
10 | 10 |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 UNREACHABLE(); | 512 UNREACHABLE(); |
513 } | 513 } |
514 value_ = info.value(); | 514 value_ = info.value(); |
515 rmode_ = info.rmode(); | 515 rmode_ = info.rmode(); |
516 } | 516 } |
517 | 517 |
518 Handle<HeapObject> Constant::ToHeapObject() const { | 518 Handle<HeapObject> Constant::ToHeapObject() const { |
519 DCHECK_EQ(kHeapObject, type()); | 519 DCHECK_EQ(kHeapObject, type()); |
520 Handle<HeapObject> value( | 520 Handle<HeapObject> value( |
521 bit_cast<HeapObject**>(static_cast<intptr_t>(value_))); | 521 bit_cast<HeapObject**>(static_cast<intptr_t>(value_))); |
522 if (value->IsConsString()) { | |
523 value = String::Flatten(Handle<String>::cast(value), TENURED); | |
524 } | |
525 return value; | 522 return value; |
526 } | 523 } |
527 | 524 |
528 std::ostream& operator<<(std::ostream& os, const Constant& constant) { | 525 std::ostream& operator<<(std::ostream& os, const Constant& constant) { |
529 switch (constant.type()) { | 526 switch (constant.type()) { |
530 case Constant::kInt32: | 527 case Constant::kInt32: |
531 return os << constant.ToInt32(); | 528 return os << constant.ToInt32(); |
532 case Constant::kInt64: | 529 case Constant::kInt64: |
533 return os << constant.ToInt64() << "l"; | 530 return os << constant.ToInt64() << "l"; |
534 case Constant::kFloat32: | 531 case Constant::kFloat32: |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 } | 1015 } |
1019 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 1016 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
1020 printable.sequence_->PrintBlock(printable.register_configuration_, i); | 1017 printable.sequence_->PrintBlock(printable.register_configuration_, i); |
1021 } | 1018 } |
1022 return os; | 1019 return os; |
1023 } | 1020 } |
1024 | 1021 |
1025 } // namespace compiler | 1022 } // namespace compiler |
1026 } // namespace internal | 1023 } // namespace internal |
1027 } // namespace v8 | 1024 } // namespace v8 |
OLD | NEW |