Reviewers: Yang,
Message:
As discussed.
Description:
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.
Please review this at https://codereview.chromium.org/648243002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+30, -21 lines):
M src/compiler.cc
M src/ic/ic.cc
M src/v8natives.js
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index
ce3badb0f380727a0eef5c5f57412e2bce9c0097..244ed8b7e34d8c0997a4fff4b634e56725ffeba5
100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -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();
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index
1c621fe4822afd89b284ba6b8a2cf2dc41731eb1..ca9e00a596a8cc814566c697a1cd18b041f7b42e
100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -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);
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index
1d2e03000763062f3777e1a565e1792227f3e634..9bb4b8367e5213a901eb19d34fff40deb7478a2a
100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -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;
+ 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_;
}));
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.