OLD | NEW |
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 4103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4114 EXPECT(array.IsArray()); | 4114 EXPECT(array.IsArray()); |
4115 } | 4115 } |
4116 | 4116 |
4117 | 4117 |
4118 #ifndef PRODUCT | 4118 #ifndef PRODUCT |
4119 | 4119 |
4120 | 4120 |
4121 class ObjectAccumulator : public ObjectVisitor { | 4121 class ObjectAccumulator : public ObjectVisitor { |
4122 public: | 4122 public: |
4123 explicit ObjectAccumulator(GrowableArray<Object*>* objects) | 4123 explicit ObjectAccumulator(GrowableArray<Object*>* objects) |
4124 : ObjectVisitor(Isolate::Current()), objects_(objects) {} | 4124 : objects_(objects) { } |
4125 virtual ~ObjectAccumulator() { } | 4125 virtual ~ObjectAccumulator() { } |
4126 virtual void VisitObject(RawObject* obj) { | 4126 virtual void VisitObject(RawObject* obj) { |
4127 // Free-list elements cannot even be wrapped in handles. | 4127 // Free-list elements cannot even be wrapped in handles. |
4128 if (obj->IsFreeListElement()) { | 4128 if (obj->IsFreeListElement()) { |
4129 return; | 4129 return; |
4130 } | 4130 } |
4131 Object& handle = Object::Handle(obj); | 4131 Object& handle = Object::Handle(obj); |
4132 // Skip some common simple objects to run in reasonable time. | 4132 // Skip some common simple objects to run in reasonable time. |
4133 if (handle.IsString() || | 4133 if (handle.IsString() || |
4134 handle.IsArray() || | 4134 handle.IsArray() || |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4715 String& test = String::Handle(); | 4715 String& test = String::Handle(); |
4716 String& result = String::Handle(); | 4716 String& result = String::Handle(); |
4717 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4717 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { |
4718 test = String::New(tests[i].in); | 4718 test = String::New(tests[i].in); |
4719 result = String::ScrubName(test); | 4719 result = String::ScrubName(test); |
4720 EXPECT_STREQ(tests[i].out, result.ToCString()); | 4720 EXPECT_STREQ(tests[i].out, result.ToCString()); |
4721 } | 4721 } |
4722 } | 4722 } |
4723 | 4723 |
4724 } // namespace dart | 4724 } // namespace dart |
OLD | NEW |