Don't include field-type.h/field-index.h into property.h

BUG=

Review URL: https://codereview.chromium.org/1696333002

Cr-Commit-Position: refs/heads/master@{#34035}
This commit is contained in:
verwaest 2016-02-16 05:28:12 -08:00 committed by Commit bot
parent 099271a189
commit 036d23ec73
29 changed files with 67 additions and 33 deletions

View File

@ -8,6 +8,7 @@
#include "src/compilation-dependencies.h"
#include "src/compiler/access-info.h"
#include "src/field-index-inl.h"
#include "src/field-type.h"
#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
#include "src/type-cache.h"

View File

@ -4,6 +4,7 @@
#include "src/crankshaft/hydrogen-types.h"
#include "src/field-type.h"
#include "src/handles-inl.h"
#include "src/ostreams.h"

View File

@ -34,6 +34,7 @@
#include "src/crankshaft/hydrogen-uint32-analysis.h"
#include "src/crankshaft/lithium-allocator.h"
#include "src/crankshaft/typing.h"
#include "src/field-type.h"
#include "src/full-codegen/full-codegen.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
@ -6258,6 +6259,13 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
return instr;
}
Handle<FieldType>
HOptimizedGraphBuilder::PropertyAccessInfo::GetFieldTypeFromMap(
Handle<Map> map) const {
DCHECK(IsFound());
DCHECK(number_ < map->NumberOfOwnDescriptors());
return handle(map->instance_descriptors()->GetFieldType(number_), isolate());
}
bool HOptimizedGraphBuilder::PropertyAccessInfo::IsCompatible(
PropertyAccessInfo* info) {

View File

@ -2622,12 +2622,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
Handle<Object> GetAccessorsFromMap(Handle<Map> map) const {
return GetConstantFromMap(map);
}
Handle<FieldType> GetFieldTypeFromMap(Handle<Map> map) const {
DCHECK(IsFound());
DCHECK(number_ < map->NumberOfOwnDescriptors());
return handle(map->instance_descriptors()->GetFieldType(number_),
isolate());
}
Handle<FieldType> GetFieldTypeFromMap(Handle<Map> map) const;
Handle<Map> GetFieldOwnerFromMap(Handle<Map> map) const {
DCHECK(IsFound());
DCHECK(number_ < map->NumberOfOwnDescriptors());

View File

@ -35,6 +35,7 @@
#endif
#include "src/d8.h"
#include "src/ostreams.h"
#include "include/libplatform/libplatform.h"
#ifndef V8_SHARED

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_ARM
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_ARM64
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -4,9 +4,10 @@
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/ic/ic-inl.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"
#include "src/profiler/cpu-profiler.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_IA32
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -11,6 +11,7 @@
#include "src/codegen.h"
#include "src/conversions.h"
#include "src/execution.h"
#include "src/field-type.h"
#include "src/frames-inl.h"
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_MIPS
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_MIPS64
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_PPC
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_X64
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_X87
#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
#include "src/field-type.h"
#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"

View File

@ -9,6 +9,7 @@
#include "src/conversions.h"
#include "src/debug/debug.h"
#include "src/factory.h"
#include "src/field-type.h"
#include "src/messages.h"
#include "src/parsing/scanner.h"
#include "src/parsing/token.h"

View File

@ -7,6 +7,7 @@
#include "src/bootstrapper.h"
#include "src/deoptimizer.h"
#include "src/elements.h"
#include "src/field-type.h"
#include "src/isolate-inl.h"
namespace v8 {

View File

@ -7,6 +7,7 @@
#include "src/bootstrapper.h"
#include "src/disasm.h"
#include "src/disassembler.h"
#include "src/field-type.h"
#include "src/macro-assembler.h"
#include "src/ostreams.h"
#include "src/regexp/jsregexp.h"

View File

@ -2813,17 +2813,6 @@ int DescriptorArray::GetFieldIndex(int descriptor_number) {
return GetDetails(descriptor_number).field_index();
}
FieldType* DescriptorArray::GetFieldType(int descriptor_number) {
DCHECK(GetDetails(descriptor_number).location() == kField);
Object* value = GetValue(descriptor_number);
if (value->IsWeakCell()) {
if (WeakCell::cast(value)->cleared()) return FieldType::None();
value = WeakCell::cast(value)->value();
}
return FieldType::cast(value);
}
Object* DescriptorArray::GetConstant(int descriptor_number) {
return GetValue(descriptor_number);
}

View File

@ -25,8 +25,9 @@
#include "src/deoptimizer.h"
#include "src/elements.h"
#include "src/execution.h"
#include "src/field-index.h"
#include "src/field-index-inl.h"
#include "src/field-index.h"
#include "src/field-type.h"
#include "src/full-codegen/full-codegen.h"
#include "src/ic/ic.h"
#include "src/identity-map.h"
@ -9906,6 +9907,15 @@ Handle<Map> Map::CopyForPreventExtensions(Handle<Map> map,
return new_map;
}
FieldType* DescriptorArray::GetFieldType(int descriptor_number) {
DCHECK(GetDetails(descriptor_number).location() == kField);
Object* value = GetValue(descriptor_number);
if (value->IsWeakCell()) {
if (WeakCell::cast(value)->cleared()) return FieldType::None();
value = WeakCell::cast(value)->value();
}
return FieldType::cast(value);
}
bool DescriptorArray::CanHoldValue(int descriptor, Object* value) {
PropertyDetails details = GetDetails(descriptor);

View File

@ -2973,7 +2973,7 @@ class DescriptorArray: public FixedArray {
inline PropertyDetails GetDetails(int descriptor_number);
inline PropertyType GetType(int descriptor_number);
inline int GetFieldIndex(int descriptor_number);
inline FieldType* GetFieldType(int descriptor_number);
FieldType* GetFieldType(int descriptor_number);
inline Object* GetConstant(int descriptor_number);
inline Object* GetCallbacksObject(int descriptor_number);
inline AccessorDescriptor* GetCallbacks(int descriptor_number);

View File

@ -4,6 +4,7 @@
#include "src/property.h"
#include "src/field-type.h"
#include "src/handles-inl.h"
#include "src/ostreams.h"
@ -20,6 +21,11 @@ std::ostream& operator<<(std::ostream& os,
return os;
}
DataDescriptor::DataDescriptor(Handle<Name> key, int field_index,
PropertyAttributes attributes,
Representation representation)
: Descriptor(key, FieldType::Any(key->GetIsolate()), attributes, DATA,
representation, field_index) {}
struct FastPropertyDetails {
explicit FastPropertyDetails(const PropertyDetails& v) : details(v) {}

View File

@ -8,8 +8,6 @@
#include <iosfwd>
#include "src/factory.h"
#include "src/field-index.h"
#include "src/field-type.h"
#include "src/isolate.h"
namespace v8 {
@ -75,9 +73,7 @@ std::ostream& operator<<(std::ostream& os, const Descriptor& d);
class DataDescriptor final : public Descriptor {
public:
DataDescriptor(Handle<Name> key, int field_index,
PropertyAttributes attributes, Representation representation)
: Descriptor(key, FieldType::Any(key->GetIsolate()), attributes, DATA,
representation, field_index) {}
PropertyAttributes attributes, Representation representation);
// The field type is either a simple type or a map wrapped in a weak cell.
DataDescriptor(Handle<Name> key, int field_index,
Handle<Object> wrapped_field_type,

View File

@ -8,6 +8,7 @@
#include "src/factory.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/regexp/jsregexp.h"
#include "src/utils.h"

View File

@ -11,6 +11,7 @@
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecodes.h"
#include "src/isolate-inl.h"
#include "src/ostreams.h"
namespace v8 {
namespace internal {

View File

@ -33,6 +33,7 @@
#include "src/deoptimizer.h"
#include "src/execution.h"
#include "src/factory.h"
#include "src/field-type.h"
#include "src/global-handles.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/memory-reducer.h"

View File

@ -12,6 +12,7 @@
#include "src/compilation-cache.h"
#include "src/execution.h"
#include "src/factory.h"
#include "src/field-type.h"
#include "src/global-handles.h"
#include "src/ic/stub-cache.h"
#include "src/macro-assembler.h"

View File

@ -10,6 +10,7 @@
#include "src/compilation-cache.h"
#include "src/execution.h"
#include "src/factory.h"
#include "src/field-type.h"
#include "src/global-handles.h"
#include "test/cctest/cctest.h"

View File

@ -10,6 +10,7 @@
#include "src/compilation-cache.h"
#include "src/execution.h"
#include "src/factory.h"
#include "src/field-type.h"
#include "src/global-handles.h"
#include "src/heap/slots-buffer.h"
#include "src/ic/ic.h"