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

Unified Diff: src/property.h

Issue 1704353002: [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/transitions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property.h
diff --git a/src/property.h b/src/property.h
index c8da9aa60723c67ca9c37bad55f02893d98495c1..add9e4d11bfca0ef25f3606b6e343d11e8ba05a6 100644
--- a/src/property.h
+++ b/src/property.h
@@ -20,13 +20,6 @@ namespace internal {
// optionally a piece of data.
class Descriptor BASE_EMBEDDED {
public:
- void KeyToUniqueName() {
- if (!key_->IsUniqueName()) {
- key_ = key_->GetIsolate()->factory()->InternalizeString(
- Handle<String>::cast(key_));
- }
- }
-
Handle<Name> GetKey() const { return key_; }
Handle<Object> GetValue() const { return value_; }
PropertyDetails GetDetails() const { return details_; }
@@ -42,25 +35,25 @@ class Descriptor BASE_EMBEDDED {
Descriptor() : details_(Smi::FromInt(0)) {}
void Init(Handle<Name> key, Handle<Object> value, PropertyDetails details) {
+ DCHECK(key->IsUniqueName());
key_ = key;
value_ = value;
details_ = details;
}
Descriptor(Handle<Name> key, Handle<Object> value, PropertyDetails details)
+ : key_(key), value_(value), details_(details) {
+ DCHECK(key->IsUniqueName());
+ }
+
+ Descriptor(Handle<Name> key, Handle<Object> value,
+ PropertyAttributes attributes, PropertyType type,
+ Representation representation, int field_index = 0)
: key_(key),
value_(value),
- details_(details) { }
-
- Descriptor(Handle<Name> key,
- Handle<Object> value,
- PropertyAttributes attributes,
- PropertyType type,
- Representation representation,
- int field_index = 0)
- : key_(key),
- value_(value),
- details_(attributes, type, representation, field_index) { }
+ details_(attributes, type, representation, field_index) {
+ DCHECK(key->IsUniqueName());
+ }
friend class DescriptorArray;
friend class Map;
« no previous file with comments | « src/objects-inl.h ('k') | src/transitions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698