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

Side by Side Diff: src/property.h

Issue 960103003: Revert of Fix memory leak caused by field type in descriptor array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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-inl.h ('k') | test/cctest/test-heap.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_PROPERTY_H_ 5 #ifndef V8_PROPERTY_H_
6 #define V8_PROPERTY_H_ 6 #define V8_PROPERTY_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 std::ostream& operator<<(std::ostream& os, const Descriptor& d); 73 std::ostream& operator<<(std::ostream& os, const Descriptor& d);
74 74
75 75
76 class DataDescriptor FINAL : public Descriptor { 76 class DataDescriptor FINAL : public Descriptor {
77 public: 77 public:
78 DataDescriptor(Handle<Name> key, int field_index, 78 DataDescriptor(Handle<Name> key, int field_index,
79 PropertyAttributes attributes, Representation representation) 79 PropertyAttributes attributes, Representation representation)
80 : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA, 80 : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA,
81 representation, field_index) {} 81 representation, field_index) {}
82 // The field type is either a simple type or a map wrapped in a weak cell. 82 DataDescriptor(Handle<Name> key, int field_index, Handle<HeapType> field_type,
83 DataDescriptor(Handle<Name> key, int field_index,
84 Handle<Object> wrapped_field_type,
85 PropertyAttributes attributes, Representation representation) 83 PropertyAttributes attributes, Representation representation)
86 : Descriptor(key, wrapped_field_type, attributes, DATA, representation, 84 : Descriptor(key, field_type, attributes, DATA, representation,
87 field_index) { 85 field_index) {}
88 DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell());
89 }
90 }; 86 };
91 87
92 88
93 class DataConstantDescriptor FINAL : public Descriptor { 89 class DataConstantDescriptor FINAL : public Descriptor {
94 public: 90 public:
95 DataConstantDescriptor(Handle<Name> key, Handle<Object> value, 91 DataConstantDescriptor(Handle<Name> key, Handle<Object> value,
96 PropertyAttributes attributes) 92 PropertyAttributes attributes)
97 : Descriptor(key, value, attributes, DATA_CONSTANT, 93 : Descriptor(key, value, attributes, DATA_CONSTANT,
98 value->OptimalRepresentation()) {} 94 value->OptimalRepresentation()) {}
99 }; 95 };
100 96
101 97
102 class AccessorConstantDescriptor FINAL : public Descriptor { 98 class AccessorConstantDescriptor FINAL : public Descriptor {
103 public: 99 public:
104 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign, 100 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign,
105 PropertyAttributes attributes) 101 PropertyAttributes attributes)
106 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, 102 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT,
107 Representation::Tagged()) {} 103 Representation::Tagged()) {}
108 }; 104 };
109 105
110 106
111 } } // namespace v8::internal 107 } } // namespace v8::internal
112 108
113 #endif // V8_PROPERTY_H_ 109 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698