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

Unified Diff: src/compiler.cc

Issue 11316218: Simplify and fix code aging. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed comment and rebased. Created 8 years, 1 month 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/compiler.h ('k') | src/heap.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 3dfc4e3ddb70577ed5181b06e9b9ca5345a4a4b4..ff6e05d6070cc14b620f2ce3868edf94360214b7 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -52,57 +52,53 @@ namespace internal {
CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone)
- : isolate_(script->GetIsolate()),
- flags_(LanguageModeField::encode(CLASSIC_MODE)),
- function_(NULL),
- scope_(NULL),
- global_scope_(NULL),
+ : flags_(LanguageModeField::encode(CLASSIC_MODE)),
script_(script),
- extension_(NULL),
- pre_parse_data_(NULL),
- osr_ast_id_(BailoutId::None()),
- zone_(zone),
- deferred_handles_(NULL) {
- Initialize(BASE);
+ osr_ast_id_(BailoutId::None()) {
+ Initialize(zone);
}
CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info,
Zone* zone)
- : isolate_(shared_info->GetIsolate()),
- flags_(LanguageModeField::encode(CLASSIC_MODE) |
- IsLazy::encode(true)),
- function_(NULL),
- scope_(NULL),
- global_scope_(NULL),
+ : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)),
shared_info_(shared_info),
script_(Handle<Script>(Script::cast(shared_info->script()))),
- extension_(NULL),
- pre_parse_data_(NULL),
- osr_ast_id_(BailoutId::None()),
- zone_(zone),
- deferred_handles_(NULL) {
- Initialize(BASE);
+ osr_ast_id_(BailoutId::None()) {
+ Initialize(zone);
}
CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone)
- : isolate_(closure->GetIsolate()),
- flags_(LanguageModeField::encode(CLASSIC_MODE) |
- IsLazy::encode(true)),
- function_(NULL),
- scope_(NULL),
- global_scope_(NULL),
+ : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)),
closure_(closure),
shared_info_(Handle<SharedFunctionInfo>(closure->shared())),
script_(Handle<Script>(Script::cast(shared_info_->script()))),
- extension_(NULL),
- pre_parse_data_(NULL),
context_(closure->context()),
- osr_ast_id_(BailoutId::None()),
- zone_(zone),
- deferred_handles_(NULL) {
- Initialize(BASE);
+ osr_ast_id_(BailoutId::None()) {
+ Initialize(zone);
+}
+
+
+void CompilationInfo::Initialize(Zone* zone) {
+ isolate_ = script_->GetIsolate();
+ function_ = NULL;
+ scope_ = NULL;
+ global_scope_ = NULL;
+ extension_ = NULL;
+ pre_parse_data_ = NULL;
+ zone_ = zone;
+ deferred_handles_ = NULL;
+ prologue_offset_ = kPrologueOffsetNotSet;
+ mode_ = V8::UseCrankshaft() ? BASE : NONOPT;
+ if (script_->type()->value() == Script::TYPE_NATIVE) {
+ MarkAsNative();
+ }
+ if (!shared_info_.is_null()) {
+ ASSERT(language_mode() == CLASSIC_MODE);
+ SetLanguageMode(shared_info_->language_mode());
+ }
+ set_bailout_reason("unknown");
}
« no previous file with comments | « src/compiler.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698