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/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 4458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4469 os << name << "_" << ElementsKindToString(elements_kind()); | 4469 os << name << "_" << ElementsKindToString(elements_kind()); |
4470 if (override_mode() == DISABLE_ALLOCATION_SITES) { | 4470 if (override_mode() == DISABLE_ALLOCATION_SITES) { |
4471 os << "_DISABLE_ALLOCATION_SITES"; | 4471 os << "_DISABLE_ALLOCATION_SITES"; |
4472 } | 4472 } |
4473 return os; | 4473 return os; |
4474 } | 4474 } |
4475 | 4475 |
4476 bool ToBooleanICStub::UpdateStatus(Handle<Object> object) { | 4476 bool ToBooleanICStub::UpdateStatus(Handle<Object> object) { |
4477 Types new_types = types(); | 4477 Types new_types = types(); |
4478 Types old_types = new_types; | 4478 Types old_types = new_types; |
4479 bool to_boolean_value = new_types.UpdateStatus(object); | 4479 bool to_boolean_value = new_types.UpdateStatus(isolate(), object); |
4480 TraceTransition(old_types, new_types); | 4480 TraceTransition(old_types, new_types); |
4481 set_sub_minor_key(TypesBits::update(sub_minor_key(), new_types.ToIntegral())); | 4481 set_sub_minor_key(TypesBits::update(sub_minor_key(), new_types.ToIntegral())); |
4482 return to_boolean_value; | 4482 return to_boolean_value; |
4483 } | 4483 } |
4484 | 4484 |
4485 void ToBooleanICStub::PrintState(std::ostream& os) const { // NOLINT | 4485 void ToBooleanICStub::PrintState(std::ostream& os) const { // NOLINT |
4486 os << types(); | 4486 os << types(); |
4487 } | 4487 } |
4488 | 4488 |
4489 std::ostream& operator<<(std::ostream& os, const ToBooleanICStub::Types& s) { | 4489 std::ostream& operator<<(std::ostream& os, const ToBooleanICStub::Types& s) { |
4490 os << "("; | 4490 os << "("; |
4491 SimpleListPrinter p(os); | 4491 SimpleListPrinter p(os); |
4492 if (s.IsEmpty()) p.Add("None"); | 4492 if (s.IsEmpty()) p.Add("None"); |
4493 if (s.Contains(ToBooleanICStub::UNDEFINED)) p.Add("Undefined"); | 4493 if (s.Contains(ToBooleanICStub::UNDEFINED)) p.Add("Undefined"); |
4494 if (s.Contains(ToBooleanICStub::BOOLEAN)) p.Add("Bool"); | 4494 if (s.Contains(ToBooleanICStub::BOOLEAN)) p.Add("Bool"); |
4495 if (s.Contains(ToBooleanICStub::NULL_TYPE)) p.Add("Null"); | 4495 if (s.Contains(ToBooleanICStub::NULL_TYPE)) p.Add("Null"); |
4496 if (s.Contains(ToBooleanICStub::SMI)) p.Add("Smi"); | 4496 if (s.Contains(ToBooleanICStub::SMI)) p.Add("Smi"); |
4497 if (s.Contains(ToBooleanICStub::SPEC_OBJECT)) p.Add("SpecObject"); | 4497 if (s.Contains(ToBooleanICStub::SPEC_OBJECT)) p.Add("SpecObject"); |
4498 if (s.Contains(ToBooleanICStub::STRING)) p.Add("String"); | 4498 if (s.Contains(ToBooleanICStub::STRING)) p.Add("String"); |
4499 if (s.Contains(ToBooleanICStub::SYMBOL)) p.Add("Symbol"); | 4499 if (s.Contains(ToBooleanICStub::SYMBOL)) p.Add("Symbol"); |
4500 if (s.Contains(ToBooleanICStub::HEAP_NUMBER)) p.Add("HeapNumber"); | 4500 if (s.Contains(ToBooleanICStub::HEAP_NUMBER)) p.Add("HeapNumber"); |
4501 if (s.Contains(ToBooleanICStub::SIMD_VALUE)) p.Add("SimdValue"); | 4501 if (s.Contains(ToBooleanICStub::SIMD_VALUE)) p.Add("SimdValue"); |
4502 return os << ")"; | 4502 return os << ")"; |
4503 } | 4503 } |
4504 | 4504 |
4505 bool ToBooleanICStub::Types::UpdateStatus(Handle<Object> object) { | 4505 bool ToBooleanICStub::Types::UpdateStatus(Isolate* isolate, |
4506 if (object->IsUndefined()) { | 4506 Handle<Object> object) { |
| 4507 if (object->IsUndefined(isolate)) { |
4507 Add(UNDEFINED); | 4508 Add(UNDEFINED); |
4508 return false; | 4509 return false; |
4509 } else if (object->IsBoolean()) { | 4510 } else if (object->IsBoolean()) { |
4510 Add(BOOLEAN); | 4511 Add(BOOLEAN); |
4511 return object->IsTrue(); | 4512 return object->IsTrue(); |
4512 } else if (object->IsNull()) { | 4513 } else if (object->IsNull()) { |
4513 Add(NULL_TYPE); | 4514 Add(NULL_TYPE); |
4514 return false; | 4515 return false; |
4515 } else if (object->IsSmi()) { | 4516 } else if (object->IsSmi()) { |
4516 Add(SMI); | 4517 Add(SMI); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4739 if (type->Is(Type::UntaggedPointer())) { | 4740 if (type->Is(Type::UntaggedPointer())) { |
4740 return Representation::External(); | 4741 return Representation::External(); |
4741 } | 4742 } |
4742 | 4743 |
4743 DCHECK(!type->Is(Type::Untagged())); | 4744 DCHECK(!type->Is(Type::Untagged())); |
4744 return Representation::Tagged(); | 4745 return Representation::Tagged(); |
4745 } | 4746 } |
4746 | 4747 |
4747 } // namespace internal | 4748 } // namespace internal |
4748 } // namespace v8 | 4749 } // namespace v8 |
OLD | NEW |