Skip to content

Commit

Permalink
Clean up unused createStoreOwnPropertyInst
Browse files Browse the repository at this point in the history
Summary:
We have 4 diferent versions of createStoreOwnPropertyInst, defined in different places in IRBuilder.h.
Only 2 are used and one of them only has one occurance. Those definitions seem unnecessary to me and only increase the complexity of the API.
Clean them up

Reviewed By: dulinriley

Differential Revision: D16496423

fbshipit-source-id: 0eba772aac774921d4fcd4463cdfa5f96db4ea83
  • Loading branch information
lxfind authored and facebook-github-bot committed Jul 26, 2019
1 parent 6a230ce commit 40e9383
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 43 deletions.
16 changes: 0 additions & 16 deletions include/hermes/IR/IRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,6 @@ class IRBuilder {
LiteralString *property,
PropEnumerable isEnumerable);

StoreOwnPropertyInst *createStoreOwnPropertyInst(
Value *storedValue,
Value *object,
int index,
PropEnumerable isEnumerable);

StoreGetterSetterInst *createStoreGetterSetterInst(
Value *storedGetter,
Value *storedSetter,
Expand All @@ -341,11 +335,6 @@ class IRBuilder {
Value *storedValue,
Value *object,
StringRef property);
StoreOwnPropertyInst *createStoreOwnPropertyInst(
Value *storedValue,
Value *object,
StringRef property,
PropEnumerable isEnumerable);

DeletePropertyInst *createDeletePropertyInst(
Value *object,
Expand All @@ -362,11 +351,6 @@ class IRBuilder {
TryStoreGlobalPropertyInst *createTryStoreGlobalPropertyInst(
Value *storedValue,
Identifier property);
StoreOwnPropertyInst *createStoreOwnPropertyInst(
Value *storedValue,
Value *object,
Identifier property,
PropEnumerable isEnumerable);

AllocObjectInst *createAllocObjectInst(
uint32_t size,
Expand Down
26 changes: 0 additions & 26 deletions lib/IR/IRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,6 @@ StoreNewOwnPropertyInst *IRBuilder::createStoreNewOwnPropertyInst(
return inst;
}

StoreOwnPropertyInst *IRBuilder::createStoreOwnPropertyInst(
Value *storedValue,
Value *object,
int index,
PropEnumerable isEnumerable) {
return createStoreOwnPropertyInst(
storedValue, object, this->getLiteralNumber(index), isEnumerable);
}

StoreGetterSetterInst *IRBuilder::createStoreGetterSetterInst(
Value *storedGetter,
Value *storedSetter,
Expand Down Expand Up @@ -482,14 +473,6 @@ StorePropertyInst *IRBuilder::createStorePropertyInst(
Identifier Iden = createIdentifier(property);
return createStorePropertyInst(storedValue, object, Iden);
}
StoreOwnPropertyInst *IRBuilder::createStoreOwnPropertyInst(
Value *storedValue,
Value *object,
StringRef property,
PropEnumerable isEnumerable) {
Identifier Iden = createIdentifier(property);
return createStoreOwnPropertyInst(storedValue, object, Iden, isEnumerable);
}

LoadPropertyInst *IRBuilder::createLoadPropertyInst(
Value *object,
Expand Down Expand Up @@ -530,15 +513,6 @@ TryStoreGlobalPropertyInst *IRBuilder::createTryStoreGlobalPropertyInst(
return inst;
}

StoreOwnPropertyInst *IRBuilder::createStoreOwnPropertyInst(
Value *storedValue,
Value *object,
Identifier property,
PropEnumerable isEnumerable) {
auto L = getLiteralString(property);
return createStoreOwnPropertyInst(storedValue, object, L, isEnumerable);
}

AllocObjectInst *IRBuilder::createAllocObjectInst(
uint32_t size,
Value *parent) {
Expand Down
5 changes: 4 additions & 1 deletion lib/IRGen/ESTreeIRGen-expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ Value *ESTreeIRGen::genArrayExpr(ESTree::ArrayExpressionNode *Expr) {
elements.push_back(value);
} else {
Builder.createStoreOwnPropertyInst(
value, allocArrayInst, count, IRBuilder::PropEnumerable::Yes);
value,
allocArrayInst,
Builder.getLiteralNumber(count),
IRBuilder::PropEnumerable::Yes);
}
}
count++;
Expand Down

0 comments on commit 40e9383

Please sign in to comment.