Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/objects.cc

Issue 1696333002: Don't include field-type.h into objects-inl.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
11 #include "src/accessors.h" 11 #include "src/accessors.h"
12 #include "src/allocation-site-scopes.h" 12 #include "src/allocation-site-scopes.h"
13 #include "src/api.h" 13 #include "src/api.h"
14 #include "src/api-natives.h" 14 #include "src/api-natives.h"
15 #include "src/arguments.h" 15 #include "src/arguments.h"
16 #include "src/base/bits.h" 16 #include "src/base/bits.h"
17 #include "src/base/utils/random-number-generator.h" 17 #include "src/base/utils/random-number-generator.h"
18 #include "src/bootstrapper.h" 18 #include "src/bootstrapper.h"
19 #include "src/code-stubs.h" 19 #include "src/code-stubs.h"
20 #include "src/codegen.h" 20 #include "src/codegen.h"
21 #include "src/compilation-dependencies.h" 21 #include "src/compilation-dependencies.h"
22 #include "src/compiler.h" 22 #include "src/compiler.h"
23 #include "src/date.h" 23 #include "src/date.h"
24 #include "src/debug/debug.h" 24 #include "src/debug/debug.h"
25 #include "src/deoptimizer.h" 25 #include "src/deoptimizer.h"
26 #include "src/elements.h" 26 #include "src/elements.h"
27 #include "src/execution.h" 27 #include "src/execution.h"
28 #include "src/field-index-inl.h"
28 #include "src/field-index.h" 29 #include "src/field-index.h"
29 #include "src/field-index-inl.h" 30 #include "src/field-type.h"
30 #include "src/full-codegen/full-codegen.h" 31 #include "src/full-codegen/full-codegen.h"
31 #include "src/ic/ic.h" 32 #include "src/ic/ic.h"
32 #include "src/identity-map.h" 33 #include "src/identity-map.h"
33 #include "src/interpreter/bytecodes.h" 34 #include "src/interpreter/bytecodes.h"
34 #include "src/interpreter/source-position-table.h" 35 #include "src/interpreter/source-position-table.h"
35 #include "src/isolate-inl.h" 36 #include "src/isolate-inl.h"
36 #include "src/key-accumulator.h" 37 #include "src/key-accumulator.h"
37 #include "src/list.h" 38 #include "src/list.h"
38 #include "src/log.h" 39 #include "src/log.h"
39 #include "src/lookup.h" 40 #include "src/lookup.h"
(...skipping 9859 matching lines...) Expand 10 before | Expand all | Expand 10 after
9899 new_map->set_is_extensible(false); 9900 new_map->set_is_extensible(false);
9900 if (!IsFixedTypedArrayElementsKind(map->elements_kind())) { 9901 if (!IsFixedTypedArrayElementsKind(map->elements_kind())) {
9901 ElementsKind new_kind = IsStringWrapperElementsKind(map->elements_kind()) 9902 ElementsKind new_kind = IsStringWrapperElementsKind(map->elements_kind())
9902 ? SLOW_STRING_WRAPPER_ELEMENTS 9903 ? SLOW_STRING_WRAPPER_ELEMENTS
9903 : DICTIONARY_ELEMENTS; 9904 : DICTIONARY_ELEMENTS;
9904 new_map->set_elements_kind(new_kind); 9905 new_map->set_elements_kind(new_kind);
9905 } 9906 }
9906 return new_map; 9907 return new_map;
9907 } 9908 }
9908 9909
9910 FieldType* DescriptorArray::GetFieldType(int descriptor_number) {
9911 DCHECK(GetDetails(descriptor_number).location() == kField);
9912 Object* value = GetValue(descriptor_number);
9913 if (value->IsWeakCell()) {
9914 if (WeakCell::cast(value)->cleared()) return FieldType::None();
9915 value = WeakCell::cast(value)->value();
9916 }
9917 return FieldType::cast(value);
9918 }
9909 9919
9910 bool DescriptorArray::CanHoldValue(int descriptor, Object* value) { 9920 bool DescriptorArray::CanHoldValue(int descriptor, Object* value) {
9911 PropertyDetails details = GetDetails(descriptor); 9921 PropertyDetails details = GetDetails(descriptor);
9912 switch (details.type()) { 9922 switch (details.type()) {
9913 case DATA: 9923 case DATA:
9914 return value->FitsRepresentation(details.representation()) && 9924 return value->FitsRepresentation(details.representation()) &&
9915 GetFieldType(descriptor)->NowContains(value); 9925 GetFieldType(descriptor)->NowContains(value);
9916 9926
9917 case DATA_CONSTANT: 9927 case DATA_CONSTANT:
9918 DCHECK(GetConstant(descriptor) != value || 9928 DCHECK(GetConstant(descriptor) != value ||
(...skipping 10066 matching lines...) Expand 10 before | Expand all | Expand 10 after
19985 if (cell->value() != *new_value) { 19995 if (cell->value() != *new_value) {
19986 cell->set_value(*new_value); 19996 cell->set_value(*new_value);
19987 Isolate* isolate = cell->GetIsolate(); 19997 Isolate* isolate = cell->GetIsolate();
19988 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19998 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19989 isolate, DependentCode::kPropertyCellChangedGroup); 19999 isolate, DependentCode::kPropertyCellChangedGroup);
19990 } 20000 }
19991 } 20001 }
19992 20002
19993 } // namespace internal 20003 } // namespace internal
19994 } // namespace v8 20004 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698