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

Unified Diff: runtime/vm/runtime_entry_test.cc

Issue 8818001: Add 64-bit stubs to call into the runtime and to call native functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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/constants_x64.h ('k') | runtime/vm/runtime_entry_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/runtime_entry_test.cc
===================================================================
--- runtime/vm/runtime_entry_test.cc (revision 2205)
+++ runtime/vm/runtime_entry_test.cc (working copy)
@@ -4,11 +4,34 @@
#include "vm/runtime_entry.h"
+#include "vm/code_index_table.h"
#include "vm/object.h"
#include "vm/verifier.h"
namespace dart {
+// Add function to a class and that class to the class dictionary so that
+// frame walking can be used.
+const Function& RegisterFakeFunction(const char* name, const Code& code) {
+ const String& function_name = String::ZoneHandle(String::NewSymbol(name));
+ const Function& function = Function::ZoneHandle(
+ Function::New(function_name, RawFunction::kFunction, true, false, 0));
+ Class& cls = Class::ZoneHandle();
+ const Script& script = Script::Handle();
+ cls = Class::New(function_name, script);
+ const Array& functions = Array::Handle(Array::New(1));
+ functions.SetAt(0, function);
+ cls.SetFunctions(functions);
+ Library& lib = Library::Handle(Library::CoreLibrary());
+ lib.AddClass(cls);
+ function.SetCode(code);
+ CodeIndexTable* code_index_table = Isolate::Current()->code_index_table();
+ ASSERT(code_index_table != NULL);
+ code_index_table->AddFunction(function);
+ return function;
+}
+
+
// A runtime call for test purposes.
// Arg0: a smi.
// Arg1: a smi.
« no previous file with comments | « runtime/vm/constants_x64.h ('k') | runtime/vm/runtime_entry_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698