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 4021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4032 EXPECT_NE(a_test1.SourceFingerprint(), a_test2.SourceFingerprint()); | 4032 EXPECT_NE(a_test1.SourceFingerprint(), a_test2.SourceFingerprint()); |
4033 EXPECT_NE(a_test2.SourceFingerprint(), a_test3.SourceFingerprint()); | 4033 EXPECT_NE(a_test2.SourceFingerprint(), a_test3.SourceFingerprint()); |
4034 EXPECT_NE(a_test3.SourceFingerprint(), a_test4.SourceFingerprint()); | 4034 EXPECT_NE(a_test3.SourceFingerprint(), a_test4.SourceFingerprint()); |
4035 EXPECT_NE(a_test4.SourceFingerprint(), a_test5.SourceFingerprint()); | 4035 EXPECT_NE(a_test4.SourceFingerprint(), a_test5.SourceFingerprint()); |
4036 EXPECT_EQ(a_test5.SourceFingerprint(), b_test5.SourceFingerprint()); | 4036 EXPECT_EQ(a_test5.SourceFingerprint(), b_test5.SourceFingerprint()); |
4037 EXPECT_NE(a_test6.SourceFingerprint(), b_test6.SourceFingerprint()); | 4037 EXPECT_NE(a_test6.SourceFingerprint(), b_test6.SourceFingerprint()); |
4038 } | 4038 } |
4039 | 4039 |
4040 | 4040 |
4041 TEST_CASE(FunctionWithBreakpointNotInlined) { | 4041 TEST_CASE(FunctionWithBreakpointNotInlined) { |
| 4042 if (!FLAG_support_debugger) { |
| 4043 return; |
| 4044 } |
4042 const char* kScriptChars = | 4045 const char* kScriptChars = |
4043 "class A {\n" | 4046 "class A {\n" |
4044 " a() {\n" | 4047 " a() {\n" |
4045 " }\n" | 4048 " }\n" |
4046 " b() {\n" | 4049 " b() {\n" |
4047 " a();\n" // This is line 5. | 4050 " a();\n" // This is line 5. |
4048 " }\n" | 4051 " }\n" |
4049 "}\n" | 4052 "}\n" |
4050 "test() {\n" | 4053 "test() {\n" |
4051 " new A().b();\n" | 4054 " new A().b();\n" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4101 cls = Object::dynamic_class(); | 4104 cls = Object::dynamic_class(); |
4102 array = cls.fields(); | 4105 array = cls.fields(); |
4103 EXPECT(!array.IsNull()); | 4106 EXPECT(!array.IsNull()); |
4104 EXPECT(array.IsArray()); | 4107 EXPECT(array.IsArray()); |
4105 array = cls.functions(); | 4108 array = cls.functions(); |
4106 EXPECT(!array.IsNull()); | 4109 EXPECT(!array.IsNull()); |
4107 EXPECT(array.IsArray()); | 4110 EXPECT(array.IsArray()); |
4108 } | 4111 } |
4109 | 4112 |
4110 | 4113 |
| 4114 #ifndef PRODUCT |
| 4115 |
| 4116 |
4111 class ObjectAccumulator : public ObjectVisitor { | 4117 class ObjectAccumulator : public ObjectVisitor { |
4112 public: | 4118 public: |
4113 explicit ObjectAccumulator(GrowableArray<Object*>* objects) | 4119 explicit ObjectAccumulator(GrowableArray<Object*>* objects) |
4114 : ObjectVisitor(Isolate::Current()), objects_(objects) {} | 4120 : ObjectVisitor(Isolate::Current()), objects_(objects) {} |
4115 virtual ~ObjectAccumulator() { } | 4121 virtual ~ObjectAccumulator() { } |
4116 virtual void VisitObject(RawObject* obj) { | 4122 virtual void VisitObject(RawObject* obj) { |
4117 // Free-list elements cannot even be wrapped in handles. | 4123 // Free-list elements cannot even be wrapped in handles. |
4118 if (obj->IsFreeListElement()) { | 4124 if (obj->IsFreeListElement()) { |
4119 return; | 4125 return; |
4120 } | 4126 } |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4429 LiteralToken& tok = LiteralToken::Handle(LiteralToken::New()); | 4435 LiteralToken& tok = LiteralToken::Handle(LiteralToken::New()); |
4430 tok.PrintJSON(&js, true); | 4436 tok.PrintJSON(&js, true); |
4431 ElideJSONSubstring("objects", js.ToCString(), buffer); | 4437 ElideJSONSubstring("objects", js.ToCString(), buffer); |
4432 EXPECT_STREQ( | 4438 EXPECT_STREQ( |
4433 "{\"type\":\"@Object\",\"_vmType\":\"LiteralToken\",\"id\":\"\"}", | 4439 "{\"type\":\"@Object\",\"_vmType\":\"LiteralToken\",\"id\":\"\"}", |
4434 buffer); | 4440 buffer); |
4435 } | 4441 } |
4436 } | 4442 } |
4437 | 4443 |
4438 | 4444 |
| 4445 #endif // !PRODUCT |
| 4446 |
| 4447 |
4439 TEST_CASE(InstanceEquality) { | 4448 TEST_CASE(InstanceEquality) { |
4440 // Test that Instance::OperatorEquals can call a user-defined operator==. | 4449 // Test that Instance::OperatorEquals can call a user-defined operator==. |
4441 const char* kScript = | 4450 const char* kScript = |
4442 "class A {\n" | 4451 "class A {\n" |
4443 " bool operator==(A other) { return true; }\n" | 4452 " bool operator==(A other) { return true; }\n" |
4444 "}\n" | 4453 "}\n" |
4445 "main() {\n" | 4454 "main() {\n" |
4446 " A a = new A();\n" | 4455 " A a = new A();\n" |
4447 "}"; | 4456 "}"; |
4448 | 4457 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4702 String& test = String::Handle(); | 4711 String& test = String::Handle(); |
4703 String& result = String::Handle(); | 4712 String& result = String::Handle(); |
4704 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4713 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { |
4705 test = String::New(tests[i].in); | 4714 test = String::New(tests[i].in); |
4706 result = String::IdentifierPrettyName(test); | 4715 result = String::IdentifierPrettyName(test); |
4707 EXPECT_STREQ(tests[i].out, result.ToCString()); | 4716 EXPECT_STREQ(tests[i].out, result.ToCString()); |
4708 } | 4717 } |
4709 } | 4718 } |
4710 | 4719 |
4711 } // namespace dart | 4720 } // namespace dart |
OLD | NEW |