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

Unified Diff: test/cctest/compiler/function-tester.h

Issue 563123004: Unify use-sites of EnsureDeoptimizationSupport. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Decomplicatification (aka. simplify). Created 6 years, 3 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 | « src/hydrogen.cc ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/function-tester.h
diff --git a/test/cctest/compiler/function-tester.h b/test/cctest/compiler/function-tester.h
index 2ef46eb4cbd778009f1ae087dfcb009e0868392c..c869f00d1931af18a4f07eaff12e38e0d579f835 100644
--- a/test/cctest/compiler/function-tester.h
+++ b/test/cctest/compiler/function-tester.h
@@ -57,11 +57,7 @@ class FunctionTester : public InitializedHandleScope {
}
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);
-
- EnsureDeoptimizationSupport(&info);
+ CHECK(Compiler::EnsureDeoptimizationSupport(&info));
Pipeline pipeline(&info);
Handle<Code> code = pipeline.GenerateCode();
@@ -87,23 +83,6 @@ class FunctionTester : public InitializedHandleScope {
return function;
}
- static void EnsureDeoptimizationSupport(CompilationInfo* info) {
- bool should_recompile = !info->shared_info()->has_deoptimization_support();
- if (should_recompile) {
- CompilationInfoWithZone unoptimized(info->shared_info());
- // Note that we use the same AST that we will use for generating the
- // optimized code.
- unoptimized.SetFunction(info->function());
- unoptimized.PrepareForCompilation(info->scope());
- unoptimized.SetContext(info->context());
- if (should_recompile) unoptimized.EnableDeoptimizationSupport();
- bool succeeded = FullCodeGenerator::MakeCode(&unoptimized);
- CHECK(succeeded);
- Handle<SharedFunctionInfo> shared = info->shared_info();
- shared->EnableDeoptimizationSupport(*unoptimized.code());
- }
- }
-
MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b) {
Handle<Object> args[] = {a, b};
return Execution::Call(isolate, function, undefined(), 2, args, false);
« no previous file with comments | « src/hydrogen.cc ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698