| 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/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 3957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3968 EXPECT_NE(a_test3.SourceFingerprint(), a_test4.SourceFingerprint()); | 3968 EXPECT_NE(a_test3.SourceFingerprint(), a_test4.SourceFingerprint()); |
| 3969 EXPECT_NE(a_test4.SourceFingerprint(), a_test5.SourceFingerprint()); | 3969 EXPECT_NE(a_test4.SourceFingerprint(), a_test5.SourceFingerprint()); |
| 3970 EXPECT_EQ(a_test5.SourceFingerprint(), b_test5.SourceFingerprint()); | 3970 EXPECT_EQ(a_test5.SourceFingerprint(), b_test5.SourceFingerprint()); |
| 3971 // Although a_test6's receiver type is different than b_test6's receiver type, | 3971 // Although a_test6's receiver type is different than b_test6's receiver type, |
| 3972 // the fingerprints are identical. The token stream does not reflect the | 3972 // the fingerprints are identical. The token stream does not reflect the |
| 3973 // receiver's type. This is not a problem, since we recognize functions | 3973 // receiver's type. This is not a problem, since we recognize functions |
| 3974 // of a given class and of a given name. | 3974 // of a given class and of a given name. |
| 3975 EXPECT_EQ(a_test6.SourceFingerprint(), b_test6.SourceFingerprint()); | 3975 EXPECT_EQ(a_test6.SourceFingerprint(), b_test6.SourceFingerprint()); |
| 3976 } | 3976 } |
| 3977 | 3977 |
| 3978 #ifndef PRODUCT |
| 3979 |
| 3978 TEST_CASE(FunctionWithBreakpointNotInlined) { | 3980 TEST_CASE(FunctionWithBreakpointNotInlined) { |
| 3979 if (!FLAG_support_debugger) { | |
| 3980 return; | |
| 3981 } | |
| 3982 const char* kScriptChars = | 3981 const char* kScriptChars = |
| 3983 "class A {\n" | 3982 "class A {\n" |
| 3984 " a() {\n" | 3983 " a() {\n" |
| 3985 " }\n" | 3984 " }\n" |
| 3986 " b() {\n" | 3985 " b() {\n" |
| 3987 " a();\n" // This is line 5. | 3986 " a();\n" // This is line 5. |
| 3988 " }\n" | 3987 " }\n" |
| 3989 "}\n" | 3988 "}\n" |
| 3990 "test() {\n" | 3989 "test() {\n" |
| 3991 " new A().b();\n" | 3990 " new A().b();\n" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4036 | 4035 |
| 4037 cls = Object::dynamic_class(); | 4036 cls = Object::dynamic_class(); |
| 4038 array = cls.fields(); | 4037 array = cls.fields(); |
| 4039 EXPECT(!array.IsNull()); | 4038 EXPECT(!array.IsNull()); |
| 4040 EXPECT(array.IsArray()); | 4039 EXPECT(array.IsArray()); |
| 4041 array = cls.functions(); | 4040 array = cls.functions(); |
| 4042 EXPECT(!array.IsNull()); | 4041 EXPECT(!array.IsNull()); |
| 4043 EXPECT(array.IsArray()); | 4042 EXPECT(array.IsArray()); |
| 4044 } | 4043 } |
| 4045 | 4044 |
| 4046 #ifndef PRODUCT | |
| 4047 | |
| 4048 class ObjectAccumulator : public ObjectVisitor { | 4045 class ObjectAccumulator : public ObjectVisitor { |
| 4049 public: | 4046 public: |
| 4050 explicit ObjectAccumulator(GrowableArray<Object*>* objects) | 4047 explicit ObjectAccumulator(GrowableArray<Object*>* objects) |
| 4051 : objects_(objects) {} | 4048 : objects_(objects) {} |
| 4052 virtual ~ObjectAccumulator() {} | 4049 virtual ~ObjectAccumulator() {} |
| 4053 virtual void VisitObject(RawObject* obj) { | 4050 virtual void VisitObject(RawObject* obj) { |
| 4054 if (obj->IsPseudoObject()) { | 4051 if (obj->IsPseudoObject()) { |
| 4055 return; // Cannot be wrapped in handles. | 4052 return; // Cannot be wrapped in handles. |
| 4056 } | 4053 } |
| 4057 Object& handle = Object::Handle(obj); | 4054 Object& handle = Object::Handle(obj); |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4642 // utf32->utf16 conversion. | 4639 // utf32->utf16 conversion. |
| 4643 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, | 4640 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, |
| 4644 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; | 4641 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; |
| 4645 | 4642 |
| 4646 const String& str = | 4643 const String& str = |
| 4647 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); | 4644 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); |
| 4648 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); | 4645 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); |
| 4649 } | 4646 } |
| 4650 | 4647 |
| 4651 } // namespace dart | 4648 } // namespace dart |
| OLD | NEW |