OLD | NEW |
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 "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/compiler/code-stub-assembler.h" | 10 #include "src/compiler/code-stub-assembler.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 if (s.Contains(CompareNilICStub::UNDEFINED)) p.Add("Undefined"); | 548 if (s.Contains(CompareNilICStub::UNDEFINED)) p.Add("Undefined"); |
549 if (s.Contains(CompareNilICStub::NULL_TYPE)) p.Add("Null"); | 549 if (s.Contains(CompareNilICStub::NULL_TYPE)) p.Add("Null"); |
550 if (s.Contains(CompareNilICStub::MONOMORPHIC_MAP)) p.Add("MonomorphicMap"); | 550 if (s.Contains(CompareNilICStub::MONOMORPHIC_MAP)) p.Add("MonomorphicMap"); |
551 if (s.Contains(CompareNilICStub::GENERIC)) p.Add("Generic"); | 551 if (s.Contains(CompareNilICStub::GENERIC)) p.Add("Generic"); |
552 return os << ")"; | 552 return os << ")"; |
553 } | 553 } |
554 | 554 |
555 | 555 |
556 Type* CompareNilICStub::GetType(Zone* zone, Handle<Map> map) { | 556 Type* CompareNilICStub::GetType(Zone* zone, Handle<Map> map) { |
557 State state = this->state(); | 557 State state = this->state(); |
558 if (state.Contains(CompareNilICStub::GENERIC)) return Type::Any(zone); | 558 if (state.Contains(CompareNilICStub::GENERIC)) return Type::Any(); |
559 | 559 |
560 Type* result = Type::None(zone); | 560 Type* result = Type::None(); |
561 if (state.Contains(CompareNilICStub::UNDEFINED)) { | 561 if (state.Contains(CompareNilICStub::UNDEFINED)) { |
562 result = Type::Union(result, Type::Undefined(zone), zone); | 562 result = Type::Union(result, Type::Undefined(), zone); |
563 } | 563 } |
564 if (state.Contains(CompareNilICStub::NULL_TYPE)) { | 564 if (state.Contains(CompareNilICStub::NULL_TYPE)) { |
565 result = Type::Union(result, Type::Null(zone), zone); | 565 result = Type::Union(result, Type::Null(), zone); |
566 } | 566 } |
567 if (state.Contains(CompareNilICStub::MONOMORPHIC_MAP)) { | 567 if (state.Contains(CompareNilICStub::MONOMORPHIC_MAP)) { |
568 Type* type = | 568 Type* type = map.is_null() ? Type::Detectable() : Type::Class(map, zone); |
569 map.is_null() ? Type::Detectable(zone) : Type::Class(map, zone); | |
570 result = Type::Union(result, type, zone); | 569 result = Type::Union(result, type, zone); |
571 } | 570 } |
572 | 571 |
573 return result; | 572 return result; |
574 } | 573 } |
575 | 574 |
576 | 575 |
577 Type* CompareNilICStub::GetInputType(Zone* zone, Handle<Map> map) { | 576 Type* CompareNilICStub::GetInputType(Zone* zone, Handle<Map> map) { |
578 Type* output_type = GetType(zone, map); | 577 Type* output_type = GetType(zone, map); |
579 Type* nil_type = | 578 Type* nil_type = nil_value() == kNullValue ? Type::Null() : Type::Undefined(); |
580 nil_value() == kNullValue ? Type::Null(zone) : Type::Undefined(zone); | |
581 return Type::Union(output_type, nil_type, zone); | 579 return Type::Union(output_type, nil_type, zone); |
582 } | 580 } |
583 | 581 |
584 | 582 |
585 void CallICStub::PrintState(std::ostream& os) const { // NOLINT | 583 void CallICStub::PrintState(std::ostream& os) const { // NOLINT |
586 os << state(); | 584 os << state(); |
587 } | 585 } |
588 | 586 |
589 | 587 |
590 void JSEntryStub::FinishCode(Handle<Code> code) { | 588 void JSEntryStub::FinishCode(Handle<Code> code) { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 if (type->Is(Type::UntaggedPointer())) { | 1036 if (type->Is(Type::UntaggedPointer())) { |
1039 return Representation::External(); | 1037 return Representation::External(); |
1040 } | 1038 } |
1041 | 1039 |
1042 DCHECK(!type->Is(Type::Untagged())); | 1040 DCHECK(!type->Is(Type::Untagged())); |
1043 return Representation::Tagged(); | 1041 return Representation::Tagged(); |
1044 } | 1042 } |
1045 | 1043 |
1046 } // namespace internal | 1044 } // namespace internal |
1047 } // namespace v8 | 1045 } // namespace v8 |
OLD | NEW |