[Turbofan] Make GenericLowering operate concurrently.

R=epertoso@chromium.org
BUG=5428

Review-Url: https://codereview.chromium.org/2607243002
Cr-Commit-Position: refs/heads/master@{#42003}
This commit is contained in:
mvstanton 2016-12-30 06:03:54 -08:00 committed by Commit bot
parent b211993740
commit a93aab375a
4 changed files with 41 additions and 10 deletions

View File

@ -31,11 +31,26 @@ Node* JSGraph::ToNumberBuiltinConstant() {
Node* JSGraph::CEntryStubConstant(int result_size, SaveFPRegsMode save_doubles,
ArgvMode argv_mode, bool builtin_exit_frame) {
if (save_doubles == kDontSaveFPRegs && argv_mode == kArgvOnStack &&
result_size == 1) {
if (save_doubles == kDontSaveFPRegs && argv_mode == kArgvOnStack) {
DCHECK(result_size >= 1 && result_size <= 3);
if (!builtin_exit_frame) {
CachedNode key;
if (result_size == 1) {
key = kCEntryStub1Constant;
} else if (result_size == 2) {
key = kCEntryStub2Constant;
} else {
DCHECK(result_size == 3);
key = kCEntryStub3Constant;
}
return CACHED(
key, HeapConstant(CEntryStub(isolate(), result_size, save_doubles,
argv_mode, builtin_exit_frame)
.GetCode()));
}
CachedNode key = builtin_exit_frame
? kCEntryStubWithBuiltinExitFrameConstant
: kCEntryStubConstant;
? kCEntryStub1WithBuiltinExitFrameConstant
: kCEntryStub1Constant;
return CACHED(key,
HeapConstant(CEntryStub(isolate(), result_size, save_doubles,
argv_mode, builtin_exit_frame)

View File

@ -162,8 +162,10 @@ class V8_EXPORT_PRIVATE JSGraph : public NON_EXPORTED_BASE(ZoneObject) {
kAllocateInNewSpaceStubConstant,
kAllocateInOldSpaceStubConstant,
kToNumberBuiltinConstant,
kCEntryStubConstant,
kCEntryStubWithBuiltinExitFrameConstant,
kCEntryStub1Constant,
kCEntryStub2Constant,
kCEntryStub3Constant,
kCEntryStub1WithBuiltinExitFrameConstant,
kEmptyFixedArrayConstant,
kEmptyLiteralsArrayConstant,
kEmptyStringConstant,

View File

@ -20,7 +20,7 @@ VectorSlotPair::VectorSlotPair() {}
int VectorSlotPair::index() const {
return vector_.is_null() ? -1 : vector_->GetIndex(slot_);
return vector_.is_null() ? -1 : TypeFeedbackVector::GetIndex(slot_);
}

View File

@ -979,6 +979,17 @@ struct LoopExitEliminationPhase {
}
};
struct GenericLoweringPrepPhase {
static const char* phase_name() { return "generic lowering prep"; }
void Run(PipelineData* data, Zone* temp_zone) {
// Make sure we cache these code stubs.
data->jsgraph()->CEntryStubConstant(1);
data->jsgraph()->CEntryStubConstant(2);
data->jsgraph()->CEntryStubConstant(3);
}
};
struct GenericLoweringPhase {
static const char* phase_name() { return "generic lowering"; }
@ -1565,9 +1576,8 @@ bool PipelineImpl::CreateGraph() {
RunPrintAndVerify("Untyped", true);
#endif
// Run generic lowering pass.
Run<GenericLoweringPhase>();
RunPrintAndVerify("Generic lowering", true);
// Do some hacky things to prepare generic lowering.
Run<GenericLoweringPrepPhase>();
data->EndPhaseKind();
@ -1577,6 +1587,10 @@ bool PipelineImpl::CreateGraph() {
bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
PipelineData* data = this->data_;
// Run generic lowering pass.
Run<GenericLoweringPhase>();
RunPrintAndVerify("Generic lowering", true);
data->BeginPhaseKind("block building");
// Run early optimization pass.