Always compile functions in the snapshot with deoptimization support.

This prevents an unnecessary deopt-reopt cycle due to type feedback
having been thrown away as part of recompiling with deopt support.
(For non-snapshotted functions this is not an issue.)

Bonus: Add missing space in --trace-ic output, and provide names for
PropertyDescriptor's methods, because passing anonymous functions to
SetUpLockedPrototype frightens and confuses our FuncNameInferrer.

R=hpayer@chromium.org, yangguo@chromium.org

Review URL: https://codereview.chromium.org/648243002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24592 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
jkummerow@chromium.org 2014-10-14 09:59:24 +00:00
parent 573ca15f48
commit b774d2068b
4 changed files with 31 additions and 22 deletions

View File

@ -165,6 +165,14 @@ void CompilationInfo::Initialize(Isolate* isolate,
if (!script_.is_null() && script_->type()->value() == Script::TYPE_NATIVE) { if (!script_.is_null() && script_->type()->value() == Script::TYPE_NATIVE) {
MarkAsNative(); MarkAsNative();
} }
// Compiling for the snapshot typically results in different code than
// compiling later on. This means that code recompiled with deoptimization
// support won't be "equivalent" (as defined by SharedFunctionInfo::
// EnableDeoptimizationSupport), so it will replace the old code and all
// its type feedback. To avoid this, always compile functions in the snapshot
// with deoptimization support.
if (isolate_->serializer_enabled()) EnableDeoptimizationSupport();
if (isolate_->debug()->is_active()) MarkAsDebug(); if (isolate_->debug()->is_active()) MarkAsDebug();
if (FLAG_context_specialization) MarkAsContextSpecializing(); if (FLAG_context_specialization) MarkAsContextSpecializing();
if (FLAG_turbo_inlining) MarkAsInliningEnabled(); if (FLAG_turbo_inlining) MarkAsInliningEnabled();

View File

@ -1005,7 +1005,7 @@ intptr_t PagedSpace::SizeOfFirstPage() {
int size = 0; int size = 0;
switch (identity()) { switch (identity()) {
case OLD_POINTER_SPACE: case OLD_POINTER_SPACE:
size = (112 + constant_pool_delta) * kPointerSize * KB; size = (128 + constant_pool_delta) * kPointerSize * KB;
break; break;
case OLD_DATA_SPACE: case OLD_DATA_SPACE:
size = 192 * KB; size = 192 * KB;

View File

@ -122,7 +122,7 @@ void IC::TraceIC(const char* type, Handle<Object> name, State old_state,
modifier = GetTransitionMarkModifier( modifier = GetTransitionMarkModifier(
KeyedStoreIC::GetKeyedAccessStoreMode(extra_state)); KeyedStoreIC::GetKeyedAccessStoreMode(extra_state));
} }
PrintF(" (%c->%c%s)", TransitionMarkFromState(old_state), PrintF(" (%c->%c%s) ", TransitionMarkFromState(old_state),
TransitionMarkFromState(new_state), modifier); TransitionMarkFromState(new_state), modifier);
#ifdef OBJECT_PRINT #ifdef OBJECT_PRINT
OFStream os(stdout); OFStream os(stdout);

View File

@ -500,67 +500,68 @@ SetUpLockedPrototype(PropertyDescriptor, $Array(
"set_", "set_",
"hasSetter_" "hasSetter_"
), $Array( ), $Array(
"toString", function() { "toString", function PropertyDescriptor_ToString() {
return "[object PropertyDescriptor]"; return "[object PropertyDescriptor]";
}, },
"setValue", function(value) { "setValue", function PropertyDescriptor_SetValue(value) {
this.value_ = value; this.value_ = value;
this.hasValue_ = true; this.hasValue_ = true;
}, },
"getValue", function() { "getValue", function PropertyDescriptor_GetValue() {
return this.value_; return this.value_;
}, },
"hasValue", function() { "hasValue", function PropertyDescriptor_HasValue() {
return this.hasValue_; return this.hasValue_;
}, },
"setEnumerable", function(enumerable) { "setEnumerable", function PropertyDescriptor_SetEnumerable(enumerable) {
this.enumerable_ = enumerable; this.enumerable_ = enumerable;
this.hasEnumerable_ = true; this.hasEnumerable_ = true;
}, },
"isEnumerable", function () { "isEnumerable", function PropertyDescriptor_IsEnumerable() {
return this.enumerable_; return this.enumerable_;
}, },
"hasEnumerable", function() { "hasEnumerable", function PropertyDescriptor_HasEnumerable() {
return this.hasEnumerable_; return this.hasEnumerable_;
}, },
"setWritable", function(writable) { "setWritable", function PropertyDescriptor_SetWritable(writable) {
this.writable_ = writable; this.writable_ = writable;
this.hasWritable_ = true; this.hasWritable_ = true;
}, },
"isWritable", function() { "isWritable", function PropertyDescriptor_IsWritable() {
return this.writable_; return this.writable_;
}, },
"hasWritable", function() { "hasWritable", function PropertyDescriptor_HasWritable() {
return this.hasWritable_; return this.hasWritable_;
}, },
"setConfigurable", function(configurable) { "setConfigurable",
function PropertyDescriptor_SetConfigurable(configurable) {
this.configurable_ = configurable; this.configurable_ = configurable;
this.hasConfigurable_ = true; this.hasConfigurable_ = true;
}, },
"hasConfigurable", function() { "hasConfigurable", function PropertyDescriptor_HasConfigurable() {
return this.hasConfigurable_; return this.hasConfigurable_;
}, },
"isConfigurable", function() { "isConfigurable", function PropertyDescriptor_IsConfigurable() {
return this.configurable_; return this.configurable_;
}, },
"setGet", function(get) { "setGet", function PropertyDescriptor_SetGetter(get) {
this.get_ = get; this.get_ = get;
this.hasGetter_ = true; this.hasGetter_ = true;
}, },
"getGet", function() { "getGet", function PropertyDescriptor_GetGetter() {
return this.get_; return this.get_;
}, },
"hasGetter", function() { "hasGetter", function PropertyDescriptor_HasGetter() {
return this.hasGetter_; return this.hasGetter_;
}, },
"setSet", function(set) { "setSet", function PropertyDescriptor_SetSetter(set) {
this.set_ = set; this.set_ = set;
this.hasSetter_ = true; this.hasSetter_ = true;
}, },
"getSet", function() { "getSet", function PropertyDescriptor_GetSetter() {
return this.set_; return this.set_;
}, },
"hasSetter", function() { "hasSetter", function PropertyDescriptor_HasSetter() {
return this.hasSetter_; return this.hasSetter_;
})); }));