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 4049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4060 EXPECT_VALID(result); | 4060 EXPECT_VALID(result); |
4061 | 4061 |
4062 // With no breakpoint, function A.b is inlineable. | 4062 // With no breakpoint, function A.b is inlineable. |
4063 const String& name = String::Handle(String::New(TestCase::url())); | 4063 const String& name = String::Handle(String::New(TestCase::url())); |
4064 const Library& vmlib = Library::Handle(Library::LookupLibrary(name)); | 4064 const Library& vmlib = Library::Handle(Library::LookupLibrary(name)); |
4065 EXPECT(!vmlib.IsNull()); | 4065 EXPECT(!vmlib.IsNull()); |
4066 const Class& class_a = Class::Handle( | 4066 const Class& class_a = Class::Handle( |
4067 vmlib.LookupClass(String::Handle(Symbols::New("A")))); | 4067 vmlib.LookupClass(String::Handle(Symbols::New("A")))); |
4068 const Function& func_b = | 4068 const Function& func_b = |
4069 Function::Handle(GetFunction(class_a, "b")); | 4069 Function::Handle(GetFunction(class_a, "b")); |
4070 EXPECT(func_b.IsInlineable()); | 4070 EXPECT(func_b.CanBeInlined()); |
4071 | 4071 |
4072 // After setting a breakpoint in a function A.b, it is no longer inlineable. | 4072 // After setting a breakpoint in a function A.b, it is no longer inlineable. |
4073 SourceBreakpoint* bpt = | 4073 SourceBreakpoint* bpt = |
4074 Isolate::Current()->debugger()->SetBreakpointAtLine(name, | 4074 Isolate::Current()->debugger()->SetBreakpointAtLine(name, |
4075 kBreakpointLine); | 4075 kBreakpointLine); |
4076 ASSERT(bpt != NULL); | 4076 ASSERT(bpt != NULL); |
4077 EXPECT(!func_b.IsInlineable()); | 4077 EXPECT(!func_b.CanBeInlined()); |
4078 } | 4078 } |
4079 | 4079 |
4080 | 4080 |
4081 TEST_CASE(SpecialClassesHaveEmptyArrays) { | 4081 TEST_CASE(SpecialClassesHaveEmptyArrays) { |
4082 ObjectStore* object_store = Isolate::Current()->object_store(); | 4082 ObjectStore* object_store = Isolate::Current()->object_store(); |
4083 Class& cls = Class::Handle(); | 4083 Class& cls = Class::Handle(); |
4084 Object& array = Object::Handle(); | 4084 Object& array = Object::Handle(); |
4085 | 4085 |
4086 cls = object_store->null_class(); | 4086 cls = object_store->null_class(); |
4087 array = cls.fields(); | 4087 array = cls.fields(); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4471 EXPECT_VALID(h_result); | 4471 EXPECT_VALID(h_result); |
4472 Integer& result = Integer::Handle(); | 4472 Integer& result = Integer::Handle(); |
4473 result ^= Api::UnwrapHandle(h_result); | 4473 result ^= Api::UnwrapHandle(h_result); |
4474 String& foo = String::Handle(String::New("foo")); | 4474 String& foo = String::Handle(String::New("foo")); |
4475 Integer& expected = Integer::Handle(); | 4475 Integer& expected = Integer::Handle(); |
4476 expected ^= foo.HashCode(); | 4476 expected ^= foo.HashCode(); |
4477 EXPECT(result.IsIdenticalTo(expected)); | 4477 EXPECT(result.IsIdenticalTo(expected)); |
4478 } | 4478 } |
4479 | 4479 |
4480 } // namespace dart | 4480 } // namespace dart |
OLD | NEW |