Skip to content

Commit

Permalink
Revert of VectorICs: megamorphic keyed loads in crankshaft don't need…
Browse files Browse the repository at this point in the history
… a vector. (patchset v8#3 id:40001 of https://codereview.chromium.org/1067573003/)

Reason for revert:
[Sheriff] Speculative revert for windows failure... will reland if it doesn't help:
http://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20debug%20-%202/builds/2891

Original issue's description:
> VectorICs: megamorphic keyed loads in crankshaft don't need a vector.
>
> They are content with a dummy vector, as MISSES won't result in
> changing the real vector/slot at all.
>
> BUG=
>
> Committed: https://crrev.com/c8e4d57d3b3036a05902f5b916cb5d853a57393c
> Cr-Commit-Position: refs/heads/master@{#27788}

TBR=dcarney@chromium.org,mvstanton@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1060263003

Cr-Commit-Position: refs/heads/master@{#27790}
  • Loading branch information
mi-ac authored and Commit bot committed Apr 13, 2015
1 parent 8e3fa7a commit dc65e62
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/arm/lithium-codegen-arm.cc
Expand Up @@ -3399,7 +3399,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));

if (instr->hydrogen()->HasVectorAndSlot()) {
if (FLAG_vector_ics) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}

Expand Down
3 changes: 1 addition & 2 deletions src/arm64/lithium-codegen-arm64.cc
Expand Up @@ -3635,8 +3635,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->context()).is(cp));
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));

if (instr->hydrogen()->HasVectorAndSlot()) {
if (FLAG_vector_ics) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}

Expand Down
2 changes: 1 addition & 1 deletion src/code-factory.cc
Expand Up @@ -53,7 +53,7 @@ Callable CodeFactory::KeyedLoadICInOptimizedCode(
Isolate* isolate, InlineCacheState initialization_state) {
auto code = KeyedLoadIC::initialize_stub_in_optimized_code(
isolate, initialization_state);
if (FLAG_vector_ics && initialization_state != MEGAMORPHIC) {
if (FLAG_vector_ics) {
return Callable(code, VectorLoadICDescriptor(isolate));
}
return Callable(code, LoadDescriptor(isolate));
Expand Down
6 changes: 1 addition & 5 deletions src/hydrogen-instructions.h
Expand Up @@ -6716,11 +6716,7 @@ class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> {
Handle<TypeFeedbackVector> feedback_vector() const {
return feedback_vector_;
}
bool HasVectorAndSlot() const {
DCHECK(!FLAG_vector_ics || initialization_state_ == MEGAMORPHIC ||
feedback_vector_.is_null());
return !feedback_vector_.is_null();
}
bool HasVectorAndSlot() const { return FLAG_vector_ics; }
void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
FeedbackVectorICSlot slot) {
DCHECK(FLAG_vector_ics);
Expand Down
29 changes: 21 additions & 8 deletions src/hydrogen.cc
Expand Up @@ -5406,8 +5406,11 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
variable->name(),
ast_context()->is_for_typeof());
if (FLAG_vector_ics) {
instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()),
expr->VariableFeedbackSlot());
Handle<SharedFunctionInfo> current_shared =
function_state()->compilation_info()->shared_info();
instr->SetVectorAndSlot(
handle(current_shared->feedback_vector(), isolate()),
expr->VariableFeedbackSlot());
}
return ast_context()->ReturnInstruction(instr, expr->id());
}
Expand Down Expand Up @@ -6898,8 +6901,10 @@ HInstruction* HOptimizedGraphBuilder::BuildNamedGeneric(
HLoadNamedGeneric* result =
New<HLoadNamedGeneric>(object, name, PREMONOMORPHIC);
if (FLAG_vector_ics) {
Handle<SharedFunctionInfo> current_shared =
function_state()->compilation_info()->shared_info();
Handle<TypeFeedbackVector> vector =
handle(current_feedback_vector(), isolate());
handle(current_shared->feedback_vector(), isolate());
FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot();
result->SetVectorAndSlot(vector, slot);
}
Expand All @@ -6919,10 +6924,16 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric(
HValue* key,
HValue* value) {
if (access_type == LOAD) {
// HLoadKeyedGeneric with vector ics benefits from being encoded as
// MEGAMORPHIC because the vector/slot combo becomes unnecessary.
HLoadKeyedGeneric* result = New<HLoadKeyedGeneric>(
object, key, FLAG_vector_ics ? MEGAMORPHIC : PREMONOMORPHIC);
HLoadKeyedGeneric* result =
New<HLoadKeyedGeneric>(object, key, PREMONOMORPHIC);
if (FLAG_vector_ics) {
Handle<SharedFunctionInfo> current_shared =
function_state()->compilation_info()->shared_info();
Handle<TypeFeedbackVector> vector =
handle(current_shared->feedback_vector(), isolate());
FeedbackVectorICSlot slot = expr->AsProperty()->PropertyFeedbackSlot();
result->SetVectorAndSlot(vector, slot);
}
return result;
} else {
return New<HStoreKeyedGeneric>(object, key, value, function_language_mode(),
Expand Down Expand Up @@ -9314,8 +9325,10 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) {
expr->IsUsingCallFeedbackICSlot(isolate())) {
// We've never seen this call before, so let's have Crankshaft learn
// through the type vector.
Handle<SharedFunctionInfo> current_shared =
function_state()->compilation_info()->shared_info();
Handle<TypeFeedbackVector> vector =
handle(current_feedback_vector(), isolate());
handle(current_shared->feedback_vector(), isolate());
FeedbackVectorICSlot slot = expr->CallFeedbackICSlot();
call_function->SetVectorAndSlot(vector, slot);
}
Expand Down
6 changes: 0 additions & 6 deletions src/hydrogen.h
Expand Up @@ -2157,12 +2157,6 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
TestContext* inlined_test_context() const {
return function_state()->test_context();
}
Handle<SharedFunctionInfo> current_shared_info() const {
return current_info()->shared_info();
}
TypeFeedbackVector* current_feedback_vector() const {
return current_shared_info()->feedback_vector();
}
void ClearInlinedTestContext() {
function_state()->ClearInlinedTestContext();
}
Expand Down
2 changes: 1 addition & 1 deletion src/ia32/lithium-codegen-ia32.cc
Expand Up @@ -3235,7 +3235,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));

if (instr->hydrogen()->HasVectorAndSlot()) {
if (FLAG_vector_ics) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ic/ic.cc
Expand Up @@ -1005,7 +1005,7 @@ Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) {

Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(
Isolate* isolate, State initialization_state) {
if (FLAG_vector_ics && initialization_state != MEGAMORPHIC) {
if (FLAG_vector_ics) {
return VectorRawKeyedLoadStub(isolate).GetCode();
}
switch (initialization_state) {
Expand Down
2 changes: 1 addition & 1 deletion src/mips/lithium-codegen-mips.cc
Expand Up @@ -3342,7 +3342,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));

if (instr->hydrogen()->HasVectorAndSlot()) {
if (FLAG_vector_ics) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}

Expand Down
2 changes: 1 addition & 1 deletion src/mips64/lithium-codegen-mips64.cc
Expand Up @@ -3397,7 +3397,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));

if (instr->hydrogen()->HasVectorAndSlot()) {
if (FLAG_vector_ics) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}

Expand Down
2 changes: 1 addition & 1 deletion src/x64/lithium-codegen-x64.cc
Expand Up @@ -3310,7 +3310,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));

if (instr->hydrogen()->HasVectorAndSlot()) {
if (FLAG_vector_ics) {
EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
}

Expand Down

0 comments on commit dc65e62

Please sign in to comment.