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); }
template <>
HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() {
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: {
HValue* properties = Add<HLoadNamedField>(
object, nullptr, HObjectAccess::ForPropertiesPointer());
......@@ -1392,9 +1405,8 @@ HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() {
// Fall through.
case StoreTransitionStub::StoreMapAndValue:
// Store the new value into the "extended" object.
BuildStoreNamedField(
object, GetParameter(StoreTransitionHelper::ValueIndex()),
casted_stub()->index(), casted_stub()->representation(), true);
BuildStoreNamedField(object, value, casted_stub()->index(),
casted_stub()->representation(), true);
// Fall through.
case StoreTransitionStub::StoreMapOnly:
......@@ -1403,7 +1415,7 @@ HValue* CodeStubGraphBuilder<StoreTransitionStub>::BuildCodeStub() {
GetParameter(StoreTransitionHelper::MapIndex()));
break;
}
return GetParameter(StoreTransitionHelper::ValueIndex());
return value;
}
......
......@@ -13366,12 +13366,14 @@ std::ostream& operator<<(std::ostream& os, const HEnvironment& env) {
void HTracer::TraceCompilation(CompilationInfo* info) {
Tag tag(this, "compilation");
std::string name;
Object* source_name = info->script()->name();
if (source_name->IsString()) {
String* str = String::cast(source_name);
if (str->length() > 0) {
name.append(str->ToCString().get());
name.append(":");
if (info->parse_info()) {
Object* source_name = info->script()->name();
if (source_name->IsString()) {
String* str = String::cast(source_name);
if (str->length() > 0) {
name.append(str->ToCString().get());
name.append(":");
}
}
}
base::SmartArrayPointer<char> method_name = info->GetDebugName();
......
......@@ -568,7 +568,7 @@ Code* Deoptimizer::FindOptimizedCode(JSFunction* function,
void Deoptimizer::PrintFunctionName() {
if (function_->IsJSFunction()) {
if (function_ != nullptr && function_->IsJSFunction()) {
function_->ShortPrint(trace_scope_->file());
} else {
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