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

Side by Side Diff: runtime/vm/object_test.cc

Issue 2026643004: Don't overload FreeListElement for become. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 4108 matching lines...) Expand 10 before | Expand all | Expand 10 after
4119 #ifndef PRODUCT 4119 #ifndef PRODUCT
4120 4120
4121 4121
4122 class ObjectAccumulator : public ObjectVisitor { 4122 class ObjectAccumulator : public ObjectVisitor {
4123 public: 4123 public:
4124 explicit ObjectAccumulator(GrowableArray<Object*>* objects) 4124 explicit ObjectAccumulator(GrowableArray<Object*>* objects)
4125 : objects_(objects) { } 4125 : objects_(objects) { }
4126 virtual ~ObjectAccumulator() { } 4126 virtual ~ObjectAccumulator() { }
4127 virtual void VisitObject(RawObject* obj) { 4127 virtual void VisitObject(RawObject* obj) {
4128 // Free-list elements cannot even be wrapped in handles. 4128 // Free-list elements cannot even be wrapped in handles.
4129 if (obj->IsFreeListElement()) { 4129 if (obj->IsFreeListElement() || obj->IsForwardingCorpse()) {
4130 return; 4130 return;
4131 } 4131 }
4132 Object& handle = Object::Handle(obj); 4132 Object& handle = Object::Handle(obj);
4133 // Skip some common simple objects to run in reasonable time. 4133 // Skip some common simple objects to run in reasonable time.
4134 if (handle.IsString() || 4134 if (handle.IsString() ||
4135 handle.IsArray() || 4135 handle.IsArray() ||
4136 handle.IsLiteralToken()) { 4136 handle.IsLiteralToken()) {
4137 return; 4137 return;
4138 } 4138 }
4139 objects_->Add(&handle); 4139 objects_->Add(&handle);
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
4718 String& test = String::Handle(); 4718 String& test = String::Handle();
4719 String& result = String::Handle(); 4719 String& result = String::Handle();
4720 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { 4720 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) {
4721 test = String::New(tests[i].in); 4721 test = String::New(tests[i].in);
4722 result = String::ScrubName(test); 4722 result = String::ScrubName(test);
4723 EXPECT_STREQ(tests[i].out, result.ToCString()); 4723 EXPECT_STREQ(tests[i].out, result.ToCString());
4724 } 4724 }
4725 } 4725 }
4726 4726
4727 } // namespace dart 4727 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698