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 4484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4495 return os << ")"; | 4495 return os << ")"; |
4496 } | 4496 } |
4497 | 4497 |
4498 bool ToBooleanICStub::Types::UpdateStatus(Isolate* isolate, | 4498 bool ToBooleanICStub::Types::UpdateStatus(Isolate* isolate, |
4499 Handle<Object> object) { | 4499 Handle<Object> object) { |
4500 if (object->IsUndefined(isolate)) { | 4500 if (object->IsUndefined(isolate)) { |
4501 Add(UNDEFINED); | 4501 Add(UNDEFINED); |
4502 return false; | 4502 return false; |
4503 } else if (object->IsBoolean()) { | 4503 } else if (object->IsBoolean()) { |
4504 Add(BOOLEAN); | 4504 Add(BOOLEAN); |
4505 return object->IsTrue(isolate); | 4505 return object->IsTrue(); |
4506 } else if (object->IsNull(isolate)) { | 4506 } else if (object->IsNull()) { |
4507 Add(NULL_TYPE); | 4507 Add(NULL_TYPE); |
4508 return false; | 4508 return false; |
4509 } else if (object->IsSmi()) { | 4509 } else if (object->IsSmi()) { |
4510 Add(SMI); | 4510 Add(SMI); |
4511 return Smi::cast(*object)->value() != 0; | 4511 return Smi::cast(*object)->value() != 0; |
4512 } else if (object->IsJSReceiver()) { | 4512 } else if (object->IsJSReceiver()) { |
4513 Add(SPEC_OBJECT); | 4513 Add(SPEC_OBJECT); |
4514 return !object->IsUndetectable(); | 4514 return !object->IsUndetectable(); |
4515 } else if (object->IsString()) { | 4515 } else if (object->IsString()) { |
4516 DCHECK(!object->IsUndetectable()); | 4516 DCHECK(!object->IsUndetectable()); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4718 if (type->Is(Type::UntaggedPointer())) { | 4718 if (type->Is(Type::UntaggedPointer())) { |
4719 return Representation::External(); | 4719 return Representation::External(); |
4720 } | 4720 } |
4721 | 4721 |
4722 DCHECK(!type->Is(Type::Untagged())); | 4722 DCHECK(!type->Is(Type::Untagged())); |
4723 return Representation::Tagged(); | 4723 return Representation::Tagged(); |
4724 } | 4724 } |
4725 | 4725 |
4726 } // namespace internal | 4726 } // namespace internal |
4727 } // namespace v8 | 4727 } // namespace v8 |
OLD | NEW |