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

Unified Diff: runtime/vm/unit_test.h

Issue 12260026: Add support for object pool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.h
===================================================================
--- runtime/vm/unit_test.h (revision 18603)
+++ runtime/vm/unit_test.h (working copy)
@@ -51,15 +51,16 @@
// The ASSEMBLER_TEST_RUN macro is used to execute the assembler unit
// test generated using the ASSEMBLER_TEST_GENERATE macro.
// C++ callee-saved registers are not preserved. Arguments may be passed in.
-#define ASSEMBLER_TEST_RUN(name, entry) \
- static void AssemblerTestRun##name(uword entry); \
+#define ASSEMBLER_TEST_RUN(name, test) \
+ static void AssemblerTestRun##name(AssemblerTest* test); \
TEST_CASE(name) { \
Assembler __assembler__; \
- AssemblerTest __test__(""#name, &__assembler__); \
- AssemblerTestGenerate##name(__test__.assembler()); \
- AssemblerTestRun##name(__test__.Assemble()); \
+ AssemblerTest test(""#name, &__assembler__); \
+ AssemblerTestGenerate##name(test.assembler()); \
+ test.Assemble(); \
+ AssemblerTestRun##name(&test); \
} \
- static void AssemblerTestRun##name(uword entry)
+ static void AssemblerTestRun##name(AssemblerTest* test)
// Populate node list with AST nodes.
#define CODEGEN_TEST_GENERATE(name, test) \
@@ -271,7 +272,8 @@
public:
AssemblerTest(const char* name, Assembler* assembler)
: name_(name),
- assembler_(assembler) {
+ assembler_(assembler),
+ code_(Code::ZoneHandle()) {
ASSERT(name != NULL);
ASSERT(assembler != NULL);
}
@@ -279,12 +281,18 @@
Assembler* assembler() const { return assembler_; }
- // Assemble test and return entry.
- uword Assemble();
+ const Code& code() const { return code_; }
+ uword entry() const { return entry_; }
+
+ // Assemble test and set code_ and entry_.
+ void Assemble();
+
private:
const char* name_;
Assembler* assembler_;
+ Code& code_;
+ uword entry_;
DISALLOW_COPY_AND_ASSIGN(AssemblerTest);
};
« no previous file with comments | « runtime/vm/stub_code.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698