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

Unified Diff: src/objects.cc

Issue 1834633003: [debugger] allow debug-evaluate to change stack and context values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments Created 4 years, 9 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.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f92499a5564c8f6d5278b401ef3cb4bccaca5604..a6b3edef56f8953d69dbf16602ad6a03bedee366 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -17940,6 +17940,25 @@ String* StringTable::LookupKeyIfExists(Isolate* isolate, HashTableKey* key) {
return NULL;
}
+Handle<StringSet> StringSet::New(Isolate* isolate) {
+ return HashTable::New(isolate, 0);
+}
+
+Handle<StringSet> StringSet::Add(Handle<StringSet> stringset,
+ Handle<String> name) {
+ if (!stringset->Has(name)) {
+ stringset = EnsureCapacity(stringset, 1, *name);
+ uint32_t hash = StringSetShape::Hash(*name);
+ int entry = stringset->FindInsertionEntry(hash);
+ stringset->set(EntryToIndex(entry), *name);
+ stringset->ElementAdded();
+ }
+ return stringset;
+}
+
+bool StringSet::Has(Handle<String> name) {
+ return FindEntry(*name) != kNotFound;
+}
Handle<Object> CompilationCacheTable::Lookup(Handle<String> src,
Handle<Context> context,
@@ -18097,40 +18116,6 @@ void CompilationCacheTable::Remove(Object* value) {
}
-// StringsKey used for HashTable where key is array of internalized strings.
-class StringsKey : public HashTableKey {
- public:
- explicit StringsKey(Handle<FixedArray> strings) : strings_(strings) { }
-
- bool IsMatch(Object* strings) override {
- FixedArray* o = FixedArray::cast(strings);
- int len = strings_->length();
- if (o->length() != len) return false;
- for (int i = 0; i < len; i++) {
- if (o->get(i) != strings_->get(i)) return false;
- }
- return true;
- }
-
- uint32_t Hash() override { return HashForObject(*strings_); }
-
- uint32_t HashForObject(Object* obj) override {
- FixedArray* strings = FixedArray::cast(obj);
- int len = strings->length();
- uint32_t hash = 0;
- for (int i = 0; i < len; i++) {
- hash ^= String::cast(strings->get(i))->Hash();
- }
- return hash;
- }
-
- Handle<Object> AsHandle(Isolate* isolate) override { return strings_; }
-
- private:
- Handle<FixedArray> strings_;
-};
-
-
template<typename Derived, typename Shape, typename Key>
Handle<Derived> Dictionary<Derived, Shape, Key>::New(
Isolate* isolate,
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698