Commit 7446a74f authored by ishell's avatar ishell Committed by Commit bot

[stubs] Ensure that StoreTransitionStub does not bailout after the properties...

[stubs] Ensure that StoreTransitionStub does not bailout after the properties backing store is enlarged.

In addition, this CL fixes --trace-hydrogen-stubs mode.

BUG=chromium:601420
LOG=Y

Review-Url: https://codereview.chromium.org/2068693003
Cr-Commit-Position: refs/heads/master@{#36971}
parent 3fe12ef8
...@@ -1363,8 +1363,21 @@ Handle<Code> StoreFieldStub::GenerateCode() { return DoGenerateCode(this); } ...@@ -1363,8 +1363,21 @@ Handle<Code> StoreFieldStub::GenerateCode() { return DoGenerateCode(this); }
template <> template <>
HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() { HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() {
HValue* object = GetParameter(StoreTransitionHelper::ReceiverIndex()); HValue* object = GetParameter(StoreTransitionHelper::ReceiverIndex());
HValue* value = GetParameter(StoreTransitionHelper::ValueIndex());
StoreTransitionStub::StoreMode store_mode = casted_stub()->store_mode();
if (store_mode != StoreTransitionStub::StoreMapOnly) {
value = GetParameter(StoreTransitionHelper::ValueIndex());
Representation representation = casted_stub()->representation();
if (representation.IsDouble()) {
// In case we are storing a double, assure that the value is a double
// before manipulating the properties backing store. Otherwise the actual
// store may deopt, leaving the backing store in an overallocated state.
value = AddUncasted<HForceRepresentation>(value, representation);
}
}
switch (casted_stub()->store_mode()) { switch (store_mode) {
case StoreTransitionStub::ExtendStorageAndStoreMapAndValue: { case StoreTransitionStub::ExtendStorageAndStoreMapAndValue: {
HValue* properties = Add<HLoadNamedField>( HValue* properties = Add<HLoadNamedField>(
object, nullptr, HObjectAccess::ForPropertiesPointer()); object, nullptr, HObjectAccess::ForPropertiesPointer());
...@@ -1392,9 +1405,8 @@ HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() { ...@@ -1392,9 +1405,8 @@ HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() {
// Fall through. // Fall through.
case StoreTransitionStub::StoreMapAndValue: case StoreTransitionStub::StoreMapAndValue:
// Store the new value into the "extended" object. // Store the new value into the "extended" object.
BuildStoreNamedField( BuildStoreNamedField(object, value, casted_stub()->index(),
object, GetParameter(StoreTransitionHelper::ValueIndex()), casted_stub()->representation(), true);
casted_stub()->index(), casted_stub()->representation(), true);
// Fall through. // Fall through.
case StoreTransitionStub::StoreMapOnly: case StoreTransitionStub::StoreMapOnly:
...@@ -1403,7 +1415,7 @@ HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() { ...@@ -1403,7 +1415,7 @@ HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() {
GetParameter(StoreTransitionHelper::MapIndex())); GetParameter(StoreTransitionHelper::MapIndex()));
break; break;
} }
return GetParameter(StoreTransitionHelper::ValueIndex()); return value;
} }
......
...@@ -13366,6 +13366,7 @@ std::ostream& operator<<(std::ostream& os, const HEnvironment& env) { ...@@ -13366,6 +13366,7 @@ std::ostream& operator<<(std::ostream& os, const HEnvironment& env) {
void HTracer::TraceCompilation(CompilationInfo* info) { void HTracer::TraceCompilation(CompilationInfo* info) {
Tag tag(this, "compilation"); Tag tag(this, "compilation");
std::string name; std::string name;
if (info->parse_info()) {
Object* source_name = info->script()->name(); Object* source_name = info->script()->name();
if (source_name->IsString()) { if (source_name->IsString()) {
String* str = String::cast(source_name); String* str = String::cast(source_name);
...@@ -13374,6 +13375,7 @@ void HTracer::TraceCompilation(CompilationInfo* info) { ...@@ -13374,6 +13375,7 @@ void HTracer::TraceCompilation(CompilationInfo* info) {
name.append(":"); name.append(":");
} }
} }
}
base::SmartArrayPointer<char> method_name = info->GetDebugName(); base::SmartArrayPointer<char> method_name = info->GetDebugName();
name.append(method_name.get()); name.append(method_name.get());
if (info->IsOptimizing()) { if (info->IsOptimizing()) {
......
...@@ -568,7 +568,7 @@ Code* Deoptimizer::FindOptimizedCode(JSFunction* function, ...@@ -568,7 +568,7 @@ Code* Deoptimizer::FindOptimizedCode(JSFunction* function,
void Deoptimizer::PrintFunctionName() { void Deoptimizer::PrintFunctionName() {
if (function_->IsJSFunction()) { if (function_ != nullptr && function_->IsJSFunction()) {
function_->ShortPrint(trace_scope_->file()); function_->ShortPrint(trace_scope_->file());
} else { } else {
PrintF(trace_scope_->file(), PrintF(trace_scope_->file(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment