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

Unified Diff: src/compiler.cc

Issue 1801023002: [Interpreter]: Move builtin-id from function_data to function_identifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't compile generator builtins in ignition either Created 4 years, 9 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 | « no previous file | src/factory.cc » ('j') | src/objects-inl.h » ('J')
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 47b555c27706a8d9c65f53f856a9c4b3afaac916..0be4727e615bd263a3356901c5a6b6d6a47547a2 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -785,16 +785,23 @@ static bool CompileUnoptimizedCode(CompilationInfo* info) {
return true;
}
-
-static bool UseIgnition(CompilationInfo* info) {
- // Cannot use Ignition when the {function_data} is already used.
- if (info->has_shared_info() && info->shared_info()->HasBuiltinFunctionId()) {
- return false;
+static bool IsGeneratorFunctionOrBuiltin(CompilationInfo* info) {
+ if (info->has_shared_info()) {
+ Handle<SharedFunctionInfo> shared = info->shared_info();
+ if (shared->is_generator()) {
+ return true;
+ } else if (shared->HasBuiltinFunctionId()) {
+ BuiltinFunctionId id = shared->builtin_function_id();
+ return id == kGeneratorObjectNext || id == kGeneratorObjectReturn ||
+ id == kGeneratorObjectThrow;
+ }
}
+ return info->has_literal() && IsGeneratorFunction(info->literal()->kind());
+}
+static bool UseIgnition(CompilationInfo* info) {
// TODO(4681): Generators are not yet supported.
- if ((info->has_shared_info() && info->shared_info()->is_generator()) ||
- (info->has_literal() && IsGeneratorFunction(info->literal()->kind()))) {
+ if (IsGeneratorFunctionOrBuiltin(info)) {
Michael Starzinger 2016/03/15 17:39:41 nit: I am not sure combining these two flags into
rmcilroy 2016/03/16 13:24:24 Sure thing - I was trying to reuse the SharedFunct
return false;
}
« no previous file with comments | « no previous file | src/factory.cc » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698