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

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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/precompiler.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 (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 4107 matching lines...) Expand 10 before | Expand all | Expand 10 after
4118 4118
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 if (obj->IsPseudoObject()) {
4129 if (obj->IsFreeListElement()) { 4129 return; // Cannot be wrapped in handles.
4130 return;
4131 } 4130 }
4132 Object& handle = Object::Handle(obj); 4131 Object& handle = Object::Handle(obj);
4133 // Skip some common simple objects to run in reasonable time. 4132 // Skip some common simple objects to run in reasonable time.
4134 if (handle.IsString() || 4133 if (handle.IsString() ||
4135 handle.IsArray() || 4134 handle.IsArray() ||
4136 handle.IsLiteralToken()) { 4135 handle.IsLiteralToken()) {
4137 return; 4136 return;
4138 } 4137 }
4139 objects_->Add(&handle); 4138 objects_->Add(&handle);
4140 } 4139 }
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
4718 String& test = String::Handle(); 4717 String& test = String::Handle();
4719 String& result = String::Handle(); 4718 String& result = String::Handle();
4720 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { 4719 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) {
4721 test = String::New(tests[i].in); 4720 test = String::New(tests[i].in);
4722 result = String::ScrubName(test); 4721 result = String::ScrubName(test);
4723 EXPECT_STREQ(tests[i].out, result.ToCString()); 4722 EXPECT_STREQ(tests[i].out, result.ToCString());
4724 } 4723 }
4725 } 4724 }
4726 4725
4727 } // namespace dart 4726 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698