Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: runtime/vm/object_test.cc

Issue 8509031: Revert r1380 that is breaking frog. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/class_finalizer.h"
9 #include "vm/isolate.h" 8 #include "vm/isolate.h"
10 #include "vm/object.h" 9 #include "vm/object.h"
11 #include "vm/object_store.h" 10 #include "vm/object_store.h"
12 #include "vm/unit_test.h" 11 #include "vm/unit_test.h"
13 12
14 namespace dart { 13 namespace dart {
15 14
16 TEST_CASE(Class) { 15 TEST_CASE(Class) {
17 // Allocate the class first. 16 // Allocate the class first.
18 const String& class_name = String::Handle(String::NewSymbol("MyClass")); 17 const String& class_name = String::Handle(String::NewSymbol("MyClass"));
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 const Context& context = Context::Handle(Context::New(0)); 1737 const Context& context = Context::Handle(Context::New(0));
1739 Function& parent = Function::Handle(); 1738 Function& parent = Function::Handle();
1740 const String& parent_name = String::Handle(String::NewSymbol("foo_papa")); 1739 const String& parent_name = String::Handle(String::NewSymbol("foo_papa"));
1741 parent = Function::New(parent_name, RawFunction::kFunction, false, false, 0); 1740 parent = Function::New(parent_name, RawFunction::kFunction, false, false, 0);
1742 functions.SetAt(0, parent); 1741 functions.SetAt(0, parent);
1743 cls.SetFunctions(functions); 1742 cls.SetFunctions(functions);
1744 1743
1745 Function& function = Function::Handle(); 1744 Function& function = Function::Handle();
1746 const String& function_name = String::Handle(String::NewSymbol("foo")); 1745 const String& function_name = String::Handle(String::NewSymbol("foo"));
1747 function = Function::NewClosureFunction(function_name, parent, 0); 1746 function = Function::NewClosureFunction(function_name, parent, 0);
1748 // Postpone signature class finalization.
1749 ClassFinalizer::ExpectClassesToFinalize();
1750 const Class& signature_class = Class::Handle( 1747 const Class& signature_class = Class::Handle(
1751 Class::NewSignatureClass(function_name, function, script)); 1748 Class::NewSignatureClass(function_name, function, script));
1752 const Closure& closure = Closure::Handle(Closure::New(function, context)); 1749 const Closure& closure = Closure::Handle(Closure::New(function, context));
1753 const Class& closure_class = Class::Handle(closure.clazz()); 1750 const Class& closure_class = Class::Handle(closure.clazz());
1754 EXPECT(closure_class.IsSignatureClass()); 1751 EXPECT(closure_class.IsSignatureClass());
1755 EXPECT(closure_class.IsCanonicalSignatureClass()); 1752 EXPECT(closure_class.IsCanonicalSignatureClass());
1756 EXPECT_EQ(closure_class.raw(), signature_class.raw()); 1753 EXPECT_EQ(closure_class.raw(), signature_class.raw());
1757 const Function& signature_function = 1754 const Function& signature_function =
1758 Function::Handle(signature_class.signature_function()); 1755 Function::Handle(signature_class.signature_function());
1759 EXPECT_EQ(signature_function.raw(), function.raw()); 1756 EXPECT_EQ(signature_function.raw(), function.raw());
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 cls = iterator.GetNextClass(); 1949 cls = iterator.GetNextClass();
1953 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); 1950 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw()));
1954 count++; 1951 count++;
1955 } 1952 }
1956 ASSERT(count == 2); 1953 ASSERT(count == 2);
1957 } 1954 }
1958 1955
1959 #endif // TARGET_ARCH_IA32. 1956 #endif // TARGET_ARCH_IA32.
1960 1957
1961 } // namespace dart 1958 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698