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

Unified Diff: test/cctest/compiler/test-changes-lowering.cc

Issue 637873002: The empty husk of a JSFunction is useful to us. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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
Index: test/cctest/compiler/test-changes-lowering.cc
diff --git a/test/cctest/compiler/test-changes-lowering.cc b/test/cctest/compiler/test-changes-lowering.cc
index 3d06b90c7ff27190b01a6116e21078569d6b64c5..5f8193f5aee2e0ec25a309de25135418ceb03388 100644
--- a/test/cctest/compiler/test-changes-lowering.cc
+++ b/test/cctest/compiler/test-changes-lowering.cc
@@ -19,6 +19,7 @@
#include "src/scopes.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/codegen-tester.h"
+#include "test/cctest/compiler/function-tester.h"
#include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h"
@@ -45,29 +46,10 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
template <typename T>
T* CallWithPotentialGC() {
- // TODO(titzer): we need to wrap the code in a JSFunction and call it via
- // Execution::Call() so that the GC knows about the frame, can walk it,
- // relocate the code object if necessary, etc.
- // This is pretty ugly and at the least should be moved up to helpers.
+ // TODO(titzer): we wrap the code in a JSFunction here to reuse the
+ // JSEntryStub; that could be done with a special prologue or other stub.
if (function.is_null()) {
- function =
- v8::Utils::OpenHandle(*v8::Handle<v8::Function>::Cast(CompileRun(
- "(function() { 'use strict'; return 2.7123; })")));
- CompilationInfoWithZone info(function);
- CHECK(Parser::Parse(&info));
- info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
- CHECK(Rewriter::Rewrite(&info));
- CHECK(Scope::Analyze(&info));
- CHECK_NE(NULL, info.scope());
- Handle<ScopeInfo> scope_info =
- ScopeInfo::Create(info.scope(), info.zone());
- info.shared_info()->set_scope_info(*scope_info);
- Pipeline pipeline(&info);
- Linkage linkage(&info);
- Handle<Code> code =
- pipeline.GenerateCodeForMachineGraph(&linkage, this->graph());
- CHECK(!code.is_null());
- function->ReplaceCode(*code);
+ function = FunctionTester::ForMachineGraph(this->graph());
}
Handle<Object>* args = NULL;
MaybeHandle<Object> result =
« test/cctest/compiler/function-tester.h ('K') | « test/cctest/compiler/function-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698