Revert "Revert "Upgrade to 5.0.71.48"" DO NOT MERGE
This reverts commit f2e3994fa5148cc3d9946666f0b0596290192b0e,
and updates the x64 makefile properly so it doesn't break that
build.
FPIIM-449
Change-Id: Ib83e35bfbae6af627451c926a9650ec57c045605
(cherry picked from commit 109988c7ccb6f3fd1a58574fa3dfb88beaef6632)
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 2fab578..461baaa 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -34,11 +34,12 @@
class CodeStubGraphBuilderBase : public HGraphBuilder {
public:
- explicit CodeStubGraphBuilderBase(CompilationInfo* info)
- : HGraphBuilder(info),
+ explicit CodeStubGraphBuilderBase(CompilationInfo* info, CodeStub* code_stub)
+ : HGraphBuilder(info, code_stub->GetCallInterfaceDescriptor()),
arguments_length_(NULL),
info_(info),
- descriptor_(info->code_stub()),
+ code_stub_(code_stub),
+ descriptor_(code_stub),
context_(NULL) {
int parameter_count = GetParameterCount();
parameters_.Reset(new HParameter*[parameter_count]);
@@ -68,7 +69,7 @@
return arguments_length_;
}
CompilationInfo* info() { return info_; }
- CodeStub* stub() { return info_->code_stub(); }
+ CodeStub* stub() { return code_stub_; }
HContext* context() { return context_; }
Isolate* isolate() { return info_->isolate(); }
@@ -124,6 +125,7 @@
base::SmartArrayPointer<HParameter*> parameters_;
HValue* arguments_length_;
CompilationInfo* info_;
+ CodeStub* code_stub_;
CodeStubDescriptor descriptor_;
HContext* context_;
};
@@ -178,6 +180,7 @@
context_ = Add<HContext>();
start_environment->BindContext(context_);
+ start_environment->Bind(param_count, context_);
Add<HSimulate>(BailoutId::StubEntry());
@@ -214,8 +217,8 @@
template <class Stub>
class CodeStubGraphBuilder: public CodeStubGraphBuilderBase {
public:
- explicit CodeStubGraphBuilder(CompilationInfo* info)
- : CodeStubGraphBuilderBase(info) {}
+ explicit CodeStubGraphBuilder(CompilationInfo* info, CodeStub* stub)
+ : CodeStubGraphBuilderBase(info, stub) {}
protected:
virtual HValue* BuildCodeStub() {
@@ -269,13 +272,8 @@
masm.GetCode(&desc);
// Copy the generated code into a heap object.
- Code::Flags flags = Code::ComputeFlags(
- GetCodeKind(),
- GetICState(),
- GetExtraICState(),
- GetStubType());
Handle<Code> new_object = factory->NewCode(
- desc, flags, masm.CodeObject(), NeedsImmovableCode());
+ desc, GetCodeFlags(), masm.CodeObject(), NeedsImmovableCode());
return new_object;
}
@@ -297,8 +295,15 @@
timer.Start();
}
Zone zone;
- CompilationInfo info(stub, isolate, &zone);
- CodeStubGraphBuilder<Stub> builder(&info);
+ CompilationInfo info(CodeStub::MajorName(stub->MajorKey()), isolate, &zone,
+ stub->GetCodeFlags());
+ // Parameter count is number of stack parameters.
+ int parameter_count = descriptor.GetStackParameterCount();
+ if (descriptor.function_mode() == NOT_JS_FUNCTION_STUB_MODE) {
+ parameter_count--;
+ }
+ info.set_parameter_count(parameter_count);
+ CodeStubGraphBuilder<Stub> builder(&info, stub);
LChunk* chunk = OptimizeGraph(builder.CreateGraph());
Handle<Code> code = chunk->Codegen();
if (FLAG_profile_hydrogen_code_stub_compilation) {
@@ -314,7 +319,7 @@
HValue* CodeStubGraphBuilder<NumberToStringStub>::BuildCodeStub() {
info()->MarkAsSavesCallerDoubles();
HValue* number = GetParameter(NumberToStringStub::kNumber);
- return BuildNumberToString(number, Type::Number(zone()));
+ return BuildNumberToString(number, Type::Number());
}
@@ -1464,16 +1469,15 @@
if_leftisstring.If<HIsStringAndBranch>(left);
if_leftisstring.Then();
{
- Push(BuildBinaryOperation(state.op(), left, right, Type::String(zone()),
+ Push(BuildBinaryOperation(state.op(), left, right, Type::String(),
right_type, result_type,
- state.fixed_right_arg(), allocation_mode,
- state.strength()));
+ state.fixed_right_arg(), allocation_mode));
}
if_leftisstring.Else();
{
- Push(BuildBinaryOperation(
- state.op(), left, right, left_type, right_type, result_type,
- state.fixed_right_arg(), allocation_mode, state.strength()));
+ Push(BuildBinaryOperation(state.op(), left, right, left_type,
+ right_type, result_type,
+ state.fixed_right_arg(), allocation_mode));
}
if_leftisstring.End();
result = Pop();
@@ -1483,23 +1487,22 @@
if_rightisstring.Then();
{
Push(BuildBinaryOperation(state.op(), left, right, left_type,
- Type::String(zone()), result_type,
- state.fixed_right_arg(), allocation_mode,
- state.strength()));
+ Type::String(), result_type,
+ state.fixed_right_arg(), allocation_mode));
}
if_rightisstring.Else();
{
- Push(BuildBinaryOperation(
- state.op(), left, right, left_type, right_type, result_type,
- state.fixed_right_arg(), allocation_mode, state.strength()));
+ Push(BuildBinaryOperation(state.op(), left, right, left_type,
+ right_type, result_type,
+ state.fixed_right_arg(), allocation_mode));
}
if_rightisstring.End();
result = Pop();
}
} else {
- result = BuildBinaryOperation(
- state.op(), left, right, left_type, right_type, result_type,
- state.fixed_right_arg(), allocation_mode, state.strength());
+ result = BuildBinaryOperation(state.op(), left, right, left_type,
+ right_type, result_type,
+ state.fixed_right_arg(), allocation_mode);
}
// If we encounter a generic argument, the number conversion is
@@ -1533,7 +1536,7 @@
return BuildBinaryOperation(state.op(), left, right, left_type, right_type,
result_type, state.fixed_right_arg(),
- allocation_mode, state.strength());
+ allocation_mode);
}
@@ -2154,8 +2157,7 @@
HValue* hash = BuildElementIndexHash(key);
- return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash,
- casted_stub()->language_mode());
+ return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash);
}
@@ -2186,8 +2188,8 @@
class CodeStubGraphBuilder<KeyedLoadGenericStub>
: public CodeStubGraphBuilderBase {
public:
- explicit CodeStubGraphBuilder(CompilationInfo* info)
- : CodeStubGraphBuilderBase(info) {}
+ explicit CodeStubGraphBuilder(CompilationInfo* info, CodeStub* stub)
+ : CodeStubGraphBuilderBase(info, stub) {}
protected:
virtual HValue* BuildCodeStub();
@@ -2289,8 +2291,7 @@
HValue* hash = BuildElementIndexHash(key);
- Push(BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash,
- casted_stub()->language_mode()));
+ Push(BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash));
}
kind_if.Else();
@@ -2334,8 +2335,8 @@
hash = AddUncasted<HShr>(hash, Add<HConstant>(Name::kHashShift));
- HValue* value = BuildUncheckedDictionaryElementLoad(
- receiver, properties, key, hash, casted_stub()->language_mode());
+ HValue* value =
+ BuildUncheckedDictionaryElementLoad(receiver, properties, key, hash);
Push(value);
}
if_dict_properties.Else();
@@ -2412,10 +2413,7 @@
// KeyedLookupCache miss; call runtime.
Add<HPushArguments>(receiver, key);
Push(Add<HCallRuntime>(
- Runtime::FunctionForId(is_strong(casted_stub()->language_mode())
- ? Runtime::kKeyedGetPropertyStrong
- : Runtime::kKeyedGetProperty),
- 2));
+ Runtime::FunctionForId(Runtime::kKeyedGetProperty), 2));
}
inline_or_runtime.End();
}