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) {
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 (FLAG_context_specialization) MarkAsContextSpecializing();
if (FLAG_turbo_inlining) MarkAsInliningEnabled();

View File

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

View File

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

View File

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