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

Unified Diff: src/compiler.cc

Issue 1309883002: Get rid of CompilationInfo::GenerateCodeStub method. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« src/compiler.h ('K') | « src/compiler.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9ce666c911a3edb95498371c81fee474ed993121..483852ee118c6097f6700550c918aae874ff8cc7 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -302,14 +302,6 @@ void CompilationInfo::LogDeoptCallPosition(int pc_offset, int inlining_id) {
}
-Handle<Code> CompilationInfo::GenerateCodeStub() {
- // Run a "mini pipeline", extracted from compiler.cc.
- CHECK(Parser::ParseStatic(parse_info()));
- CHECK(Compiler::Analyze(parse_info()));
- return compiler::Pipeline(this).GenerateCode();
-}
-
-
class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder {
public:
explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info)
@@ -940,8 +932,24 @@ MaybeHandle<Code> Compiler::GetLazyCode(Handle<JSFunction> function) {
}
-bool Compiler::EnsureCompiled(Handle<JSFunction> function,
- ClearExceptionFlag flag) {
+MaybeHandle<Code> Compiler::GetStubCode(Handle<JSFunction> function,
+ CodeStub* stub) {
+ // Build a "hybrid" CompilationInfo for a JSFunction/CodeStub pair.
+ Zone zone;
+ ParseInfo parse_info(&zone, function);
+ CompilationInfo info(&parse_info);
+ info.SetFunctionType(stub->GetCallInterfaceDescriptor().GetFunctionType());
+ info.MarkAsContextSpecializing();
+ info.MarkAsDeoptimizationEnabled();
+ info.SetStub(stub);
+
+ // Run a "mini pipeline", extracted from compiler.cc.
+ if (!ParseAndAnalyze(&parse_info)) return MaybeHandle<Code>();
+ return compiler::Pipeline(&info).GenerateCode();
+}
+
+
+bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) {
if (function->is_compiled()) return true;
MaybeHandle<Code> maybe_code = Compiler::GetLazyCode(function);
Handle<Code> code;
« src/compiler.h ('K') | « src/compiler.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698