2014-03-12 10:11:38 +00:00
|
|
|
// Copyright 2014 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2014-03-12 10:11:38 +00:00
|
|
|
|
|
|
|
#ifndef V8_PROPERTY_DETAILS_INL_H_
|
|
|
|
#define V8_PROPERTY_DETAILS_INL_H_
|
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/conversions.h"
|
|
|
|
#include "src/objects.h"
|
|
|
|
#include "src/property-details.h"
|
|
|
|
#include "src/types.h"
|
2014-03-12 10:11:38 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
Representation Representation::FromType(Type* type) {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (type->Is(Type::None())) return Representation::None();
|
|
|
|
if (type->Is(Type::SignedSmall())) return Representation::Smi();
|
|
|
|
if (type->Is(Type::Signed32())) return Representation::Integer32();
|
|
|
|
if (type->Is(Type::Number())) return Representation::Double();
|
|
|
|
return Representation::Tagged();
|
|
|
|
}
|
|
|
|
|
2014-03-12 10:11:38 +00:00
|
|
|
} } // namespace v8::internal
|
|
|
|
|
|
|
|
#endif // V8_PROPERTY_DETAILS_INL_H_
|