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

Unified Diff: src/objects.cc

Issue 2737373003: Move CopyValuesTo to SeededNumberDictionary. (Closed)
Patch Set: Created 3 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') | no next file » | 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 908e701e7f8622b9f9eab4576bb83901c3a8fdbe..8a7443caec2f844a28872b3d878a1f79af225d9a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -15810,23 +15810,6 @@ void Dictionary<Derived, Shape, Key>::Print() {
#endif
-template<typename Derived, typename Shape, typename Key>
-void Dictionary<Derived, Shape, Key>::CopyValuesTo(FixedArray* elements) {
- Isolate* isolate = this->GetIsolate();
- int pos = 0;
- int capacity = this->Capacity();
- DisallowHeapAllocation no_gc;
- WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc);
- for (int i = 0; i < capacity; i++) {
- Object* k = this->KeyAt(i);
- if (this->IsKey(isolate, k)) {
- elements->set(pos++, this->ValueAt(i), mode);
- }
- }
- DCHECK(pos == elements->length());
-}
-
-
MaybeHandle<Object> JSObject::GetPropertyWithInterceptor(LookupIterator* it,
bool* done) {
DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
@@ -17980,6 +17963,20 @@ Handle<SeededNumberDictionary> SeededNumberDictionary::AtNumberPut(
return AtPut(dictionary, key, value);
}
+void SeededNumberDictionary::CopyValuesTo(FixedArray* elements) {
+ Isolate* isolate = this->GetIsolate();
+ int pos = 0;
+ int capacity = this->Capacity();
+ DisallowHeapAllocation no_gc;
+ WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc);
+ for (int i = 0; i < capacity; i++) {
+ Object* k = this->KeyAt(i);
+ if (this->IsKey(isolate, k)) {
+ elements->set(pos++, this->ValueAt(i), mode);
+ }
+ }
+ DCHECK(pos == elements->length());
+}
Handle<UnseededNumberDictionary> UnseededNumberDictionary::AtNumberPut(
Handle<UnseededNumberDictionary> dictionary,
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698