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

Side by Side Diff: src/property.h

Issue 955063002: Fix memory leak caused by field type in descriptor array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unused var in release. 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 DataDescriptor(Handle<Name> key, int field_index, Handle<HeapType> field_type, 82 // The field type is either a simple type or a map wrapped in a weak cell.
83 DataDescriptor(Handle<Name> key, int field_index,
84 Handle<Object> wrapped_field_type,
83 PropertyAttributes attributes, Representation representation) 85 PropertyAttributes attributes, Representation representation)
84 : Descriptor(key, field_type, attributes, DATA, representation, 86 : Descriptor(key, wrapped_field_type, attributes, DATA, representation,
85 field_index) {} 87 field_index) {
88 DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell());
89 }
86 }; 90 };
87 91
88 92
89 class DataConstantDescriptor FINAL : public Descriptor { 93 class DataConstantDescriptor FINAL : public Descriptor {
90 public: 94 public:
91 DataConstantDescriptor(Handle<Name> key, Handle<Object> value, 95 DataConstantDescriptor(Handle<Name> key, Handle<Object> value,
92 PropertyAttributes attributes) 96 PropertyAttributes attributes)
93 : Descriptor(key, value, attributes, DATA_CONSTANT, 97 : Descriptor(key, value, attributes, DATA_CONSTANT,
94 value->OptimalRepresentation()) {} 98 value->OptimalRepresentation()) {}
95 }; 99 };
96 100
97 101
98 class AccessorConstantDescriptor FINAL : public Descriptor { 102 class AccessorConstantDescriptor FINAL : public Descriptor {
99 public: 103 public:
100 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign, 104 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign,
101 PropertyAttributes attributes) 105 PropertyAttributes attributes)
102 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, 106 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT,
103 Representation::Tagged()) {} 107 Representation::Tagged()) {}
104 }; 108 };
105 109
106 110
107 } } // namespace v8::internal 111 } } // namespace v8::internal
108 112
109 #endif // V8_PROPERTY_H_ 113 #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