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

Unified Diff: src/objects.cc

Issue 917433007: Move SetFunctionInfo() from compiler.cc to objects.cc. Rationale: not related to generating code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 24bd9b873ceccd8009a9b5d14ec7c5f7e21e4248..4f13db6150b050305cbc73bfcef9a16ec702b4bb 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -10378,6 +10378,42 @@ void SharedFunctionInfo::DisableOptimization(BailoutReason reason) {
}
+void SharedFunctionInfo::InitFromFunctionLiteral(
+ Handle<SharedFunctionInfo> shared_info, FunctionLiteral* lit) {
+ shared_info->set_length(lit->parameter_count());
+ if (FLAG_experimental_classes && IsSubclassConstructor(lit->kind())) {
+ shared_info->set_internal_formal_parameter_count(lit->parameter_count() +
+ 1);
+ } else {
+ shared_info->set_internal_formal_parameter_count(lit->parameter_count());
+ }
+ shared_info->set_function_token_position(lit->function_token_position());
+ shared_info->set_start_position(lit->start_position());
+ shared_info->set_end_position(lit->end_position());
+ shared_info->set_is_expression(lit->is_expression());
+ shared_info->set_is_anonymous(lit->is_anonymous());
+ shared_info->set_inferred_name(*lit->inferred_name());
+ shared_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
+ shared_info->set_allows_lazy_compilation_without_context(
+ lit->AllowsLazyCompilationWithoutContext());
+ shared_info->set_language_mode(lit->language_mode());
+ shared_info->set_uses_arguments(lit->scope()->arguments() != NULL);
+ shared_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
+ shared_info->set_ast_node_count(lit->ast_node_count());
+ shared_info->set_is_function(lit->is_function());
+ if (lit->dont_optimize_reason() != kNoReason) {
+ shared_info->DisableOptimization(lit->dont_optimize_reason());
+ }
+ shared_info->set_dont_cache(
+ lit->flags()->Contains(AstPropertiesFlag::kDontCache));
+ shared_info->set_kind(lit->kind());
+ shared_info->set_uses_super_property(lit->uses_super_property());
+ shared_info->set_uses_super_constructor_call(
+ lit->uses_super_constructor_call());
+ shared_info->set_asm_function(lit->scope()->asm_function());
+}
+
+
bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) {
DCHECK(!id.IsNone());
Code* unoptimized = code();
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698