| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 5 #include "vm/assert.h" |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1739 Function& parent = Function::Handle(); | 1739 Function& parent = Function::Handle(); |
| 1740 const String& parent_name = String::Handle(String::NewSymbol("foo_papa")); | 1740 const String& parent_name = String::Handle(String::NewSymbol("foo_papa")); |
| 1741 parent = Function::New(parent_name, RawFunction::kFunction, false, false, 0); | 1741 parent = Function::New(parent_name, RawFunction::kFunction, false, false, 0); |
| 1742 functions.SetAt(0, parent); | 1742 functions.SetAt(0, parent); |
| 1743 cls.SetFunctions(functions); | 1743 cls.SetFunctions(functions); |
| 1744 | 1744 |
| 1745 Function& function = Function::Handle(); | 1745 Function& function = Function::Handle(); |
| 1746 const String& function_name = String::Handle(String::NewSymbol("foo")); | 1746 const String& function_name = String::Handle(String::NewSymbol("foo")); |
| 1747 function = Function::NewClosureFunction(function_name, parent, 0); | 1747 function = Function::NewClosureFunction(function_name, parent, 0); |
| 1748 const Class& signature_class = Class::Handle( | 1748 const Class& signature_class = Class::Handle( |
| 1749 Class::NewSignatureClass(function_name, function, script, 0)); | 1749 Class::NewSignatureClass(function_name, function, script)); |
| 1750 function.set_signature_class(signature_class); | |
| 1751 const Closure& closure = Closure::Handle(Closure::New(function, context)); | 1750 const Closure& closure = Closure::Handle(Closure::New(function, context)); |
| 1752 const Class& closure_class = Class::Handle(closure.clazz()); | 1751 const Class& closure_class = Class::Handle(closure.clazz()); |
| 1753 EXPECT(closure_class.IsSignatureClass()); | 1752 EXPECT(closure_class.IsSignatureClass()); |
| 1753 EXPECT(closure_class.IsCanonicalSignatureClass()); |
| 1754 EXPECT_EQ(closure_class.raw(), signature_class.raw()); | 1754 EXPECT_EQ(closure_class.raw(), signature_class.raw()); |
| 1755 const Function& signature_function = | 1755 const Function& signature_function = |
| 1756 Function::Handle(signature_class.signature_function()); | 1756 Function::Handle(signature_class.signature_function()); |
| 1757 EXPECT_EQ(signature_function.raw(), function.raw()); | 1757 EXPECT_EQ(signature_function.raw(), function.raw()); |
| 1758 const Context& closure_context = Context::Handle(closure.context()); | 1758 const Context& closure_context = Context::Handle(closure.context()); |
| 1759 EXPECT_EQ(closure_context.raw(), closure_context.raw()); | 1759 EXPECT_EQ(closure_context.raw(), closure_context.raw()); |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 | 1762 |
| 1763 TEST_CASE(ObjectPrinting) { | 1763 TEST_CASE(ObjectPrinting) { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 cls = iterator.GetNextClass(); | 1950 cls = iterator.GetNextClass(); |
| 1951 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); | 1951 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); |
| 1952 count++; | 1952 count++; |
| 1953 } | 1953 } |
| 1954 ASSERT(count == 2); | 1954 ASSERT(count == 2); |
| 1955 } | 1955 } |
| 1956 | 1956 |
| 1957 #endif // TARGET_ARCH_IA32. | 1957 #endif // TARGET_ARCH_IA32. |
| 1958 | 1958 |
| 1959 } // namespace dart | 1959 } // namespace dart |
| OLD | NEW |