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

Unified Diff: runtime/vm/stub_code_x64_test.cc

Issue 10389023: Fixed compilation time measurement, restructure some code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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_ia32_test.cc ('k') | runtime/vm/timer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64_test.cc
===================================================================
--- runtime/vm/stub_code_x64_test.cc (revision 7417)
+++ runtime/vm/stub_code_x64_test.cc (working copy)
@@ -44,6 +44,14 @@
}
+static Function* CreateFunction(const char* name) {
+ const String& function_name = String::ZoneHandle(String::NewSymbol(name));
+ Function& function = Function::ZoneHandle(
+ Function::New(function_name, RawFunction::kFunction, true, false, 0));
+ return &function;
+}
+
+
TEST_CASE(CallRuntimeStubCode) {
extern const Function& RegisterFakeFunction(const char* name,
const Code& code);
@@ -52,8 +60,8 @@
const char* kName = "Test_CallRuntimeStubCode";
Assembler _assembler_;
GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
- const Code& code = Code::Handle(
- Code::FinalizeCode("Test_CallRuntimeStubCode", &_assembler_));
+ const Code& code = Code::Handle(Code::FinalizeCode(
+ *CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
const Function& function = RegisterFakeFunction(kName, code);
GrowableArray<const Object*> arguments;
const Array& kNoArgumentNames = Array::Handle();
@@ -100,8 +108,8 @@
const char* kName = "Test_CallNativeCFunctionStubCode";
Assembler _assembler_;
GenerateCallToCallNativeCFunctionStub(&_assembler_, value1, value2);
- const Code& code = Code::Handle(
- Code::FinalizeCode(kName, &_assembler_));
+ const Code& code = Code::Handle(Code::FinalizeCode(
+ *CreateFunction(kName), &_assembler_));
const Function& function = RegisterFakeFunction(kName, code);
GrowableArray<const Object*> arguments;
const Array& kNoArgumentNames = Array::Handle();
« no previous file with comments | « runtime/vm/stub_code_ia32_test.cc ('k') | runtime/vm/timer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698