diff --git a/doc/IR.md b/doc/IR.md index 2b886c59559..46ff56ec31c 100644 --- a/doc/IR.md +++ b/doc/IR.md @@ -527,12 +527,12 @@ Arguments | %value is the value to be stored. %object *must* be of an object typ Semantics | Implements ES15 7.3.8 DefinePropertyOrThrow. The instruction follows the rules of JavaScript *own* property access. The property is created or updated in the instance of the object, regardless of whether the same property already exists earlier in the prototype chain. Effects | May read and write memory. -### StoreNewOwnPropertyInst +### DefineNewOwnPropertyInst -StoreNewOwnPropertyInst | _ +DefineNewOwnPropertyInst | _ --- | --- | Description | Create a new *own property* in what is known to be a JavaScript object. -Example | `%4 = StoreNewOwnPropertyInst %value, %object, %property, %enumerable : boolean` +Example | `%4 = DefineNewOwnPropertyInst %value, %object, %property, %enumerable : boolean` Arguments | *%value* is the value to be stored. *%object*, which must be an object, is where the field with name *%property* will be created. *%property* must be a string or index-like number literal, otherwise it is impossible to guarantee that it is new. *%enumerable* determines whether the new property will be created as enumerable or not. Semantics | The instruction follows the rules of JavaScript *own* property access. The property is created in the instance of the object, regardless of whether the same property already exists earlier in the prototype chain. Effects | May read and write memory. diff --git a/include/hermes/IR/IRBuilder.h b/include/hermes/IR/IRBuilder.h index 59f36dea758..ae6f4e0d7be 100644 --- a/include/hermes/IR/IRBuilder.h +++ b/include/hermes/IR/IRBuilder.h @@ -446,7 +446,7 @@ class IRBuilder { Value *object, Value *property, PropEnumerable isEnumerable); - StoreNewOwnPropertyInst *createStoreNewOwnPropertyInst( + DefineNewOwnPropertyInst *createDefineNewOwnPropertyInst( Value *storedValue, Value *object, Literal *property, diff --git a/include/hermes/IR/Instrs.def b/include/hermes/IR/Instrs.def index d9d60404e3c..c3f919f6cfe 100644 --- a/include/hermes/IR/Instrs.def +++ b/include/hermes/IR/Instrs.def @@ -109,7 +109,7 @@ MARK_LAST(BaseStorePropertyInst) MARK_FIRST(BaseDefineOwnPropertyInst, Instruction) DEF_VALUE(DefineOwnPropertyInst, BaseDefineOwnPropertyInst) -DEF_VALUE(StoreNewOwnPropertyInst, BaseDefineOwnPropertyInst) +DEF_VALUE(DefineNewOwnPropertyInst, BaseDefineOwnPropertyInst) MARK_LAST(BaseDefineOwnPropertyInst) DEF_VALUE(DefineOwnGetterSetterInst, Instruction) diff --git a/include/hermes/IR/Instrs.h b/include/hermes/IR/Instrs.h index a9963519287..ab80ed0837c 100644 --- a/include/hermes/IR/Instrs.h +++ b/include/hermes/IR/Instrs.h @@ -1741,18 +1741,18 @@ class DefineOwnPropertyInst : public BaseDefineOwnPropertyInst { } }; -class StoreNewOwnPropertyInst : public BaseDefineOwnPropertyInst { - StoreNewOwnPropertyInst(const StoreNewOwnPropertyInst &) = delete; - void operator=(const StoreNewOwnPropertyInst &) = delete; +class DefineNewOwnPropertyInst : public BaseDefineOwnPropertyInst { + DefineNewOwnPropertyInst(const DefineNewOwnPropertyInst &) = delete; + void operator=(const DefineNewOwnPropertyInst &) = delete; public: - explicit StoreNewOwnPropertyInst( + explicit DefineNewOwnPropertyInst( Value *storedValue, Value *object, Literal *property, LiteralBool *isEnumerable) : BaseDefineOwnPropertyInst( - ValueKind::StoreNewOwnPropertyInstKind, + ValueKind::DefineNewOwnPropertyInstKind, storedValue, object, property, @@ -1766,14 +1766,14 @@ class StoreNewOwnPropertyInst : public BaseDefineOwnPropertyInst { "object operand must be known to be an object"); } - explicit StoreNewOwnPropertyInst( - const StoreNewOwnPropertyInst *src, + explicit DefineNewOwnPropertyInst( + const DefineNewOwnPropertyInst *src, llvh::ArrayRef operands) : BaseDefineOwnPropertyInst(src, operands) {} static bool classof(const Value *V) { ValueKind kind = V->getKind(); - return kind == ValueKind::StoreNewOwnPropertyInstKind; + return kind == ValueKind::DefineNewOwnPropertyInstKind; } }; diff --git a/include/hermes/Optimizer/PassManager/Passes.def b/include/hermes/Optimizer/PassManager/Passes.def index 1303b2b63d2..3ab34422068 100644 --- a/include/hermes/Optimizer/PassManager/Passes.def +++ b/include/hermes/Optimizer/PassManager/Passes.def @@ -46,7 +46,7 @@ PASS( PASS( ObjectMergeNewStores, "objectmergenewstores", - "Merge StoreNewOwnPropertyInsts into AllocObjectLiteral") + "Merge DefineNewOwnPropertyInsts into AllocObjectLiteral") PASS(SimplifyCFG, "simplifycfg", "Simplify CFG") PASS(TypeInference, "typeinference", "Type inference") PASS(FunctionAnalysis, "functionanalysis", "Function analysis") diff --git a/lib/BCGen/HBC/BytecodeGenerator.cpp b/lib/BCGen/HBC/BytecodeGenerator.cpp index f6d6fa049ce..fd957762a88 100644 --- a/lib/BCGen/HBC/BytecodeGenerator.cpp +++ b/lib/BCGen/HBC/BytecodeGenerator.cpp @@ -281,7 +281,7 @@ static bool isIdOperand(const Instruction *I, unsigned idx) { CASE_WITH_PROP_IDX(DeletePropertyLooseInst); CASE_WITH_PROP_IDX(DeletePropertyStrictInst); CASE_WITH_PROP_IDX(LoadPropertyInst); - CASE_WITH_PROP_IDX(StoreNewOwnPropertyInst); + CASE_WITH_PROP_IDX(DefineNewOwnPropertyInst); CASE_WITH_PROP_IDX(StorePropertyLooseInst); CASE_WITH_PROP_IDX(StorePropertyStrictInst); CASE_WITH_PROP_IDX(TryLoadGlobalPropertyInst); diff --git a/lib/BCGen/HBC/ISel.cpp b/lib/BCGen/HBC/ISel.cpp index 17ddac48374..c331c0f631a 100644 --- a/lib/BCGen/HBC/ISel.cpp +++ b/lib/BCGen/HBC/ISel.cpp @@ -931,8 +931,8 @@ void HBCISel::generateDefineOwnPropertyInst( BCFGen_->emitPutOwnByVal(objReg, valueReg, propReg, Inst->getIsEnumerable()); } -void HBCISel::generateStoreNewOwnPropertyInst( - StoreNewOwnPropertyInst *Inst, +void HBCISel::generateDefineNewOwnPropertyInst( + DefineNewOwnPropertyInst *Inst, BasicBlock *next) { auto valueReg = encodeValue(Inst->getStoredValue()); auto objReg = encodeValue(Inst->getObject()); @@ -942,7 +942,7 @@ void HBCISel::generateStoreNewOwnPropertyInst( if (auto *numProp = llvh::dyn_cast(prop)) { assert( isEnumerable && - "No way to generate non-enumerable indexed StoreNewOwnPropertyInst."); + "No way to generate non-enumerable indexed DefineNewOwnPropertyInst."); uint32_t index = *numProp->convertToArrayIndex(); if (index <= UINT8_MAX) { BCFGen_->emitPutOwnByIndex(objReg, valueReg, index); diff --git a/lib/BCGen/HBC/LoweringPipelines.cpp b/lib/BCGen/HBC/LoweringPipelines.cpp index 7b4872ab7a1..49af72ce051 100644 --- a/lib/BCGen/HBC/LoweringPipelines.cpp +++ b/lib/BCGen/HBC/LoweringPipelines.cpp @@ -44,7 +44,7 @@ void lowerModuleIR(Module *M, const BytecodeGenerationOptions &options) { // as LowerNumericProperties could generate new constants. PM.addPass(new LowerNumericProperties()); // Lower AllocObjectLiteral into a mixture of HBCAllocObjectFromBufferInst, - // AllocObjectInst, StoreNewOwnPropertyInst and StorePropertyInst. + // AllocObjectInst, DefineNewOwnPropertyInst and StorePropertyInst. PM.addPass(new LowerAllocObjectLiteral()); PM.addPass(new LowerArgumentsArray()); PM.addPass(new LimitAllocArray(UINT16_MAX)); diff --git a/lib/BCGen/HBC/Passes.cpp b/lib/BCGen/HBC/Passes.cpp index ff9c3000585..aa4038a0ef2 100644 --- a/lib/BCGen/HBC/Passes.cpp +++ b/lib/BCGen/HBC/Passes.cpp @@ -84,11 +84,11 @@ bool LoadConstants::operandMustBeLiteral(Instruction *Inst, unsigned opIndex) { if (llvh::isa(Inst) && opIndex > 0) return true; - // DefineOwnPropertyInst and StoreNewOwnPropertyInst. + // DefineOwnPropertyInst and DefineNewOwnPropertyInst. if (auto *SOP = llvh::dyn_cast(Inst)) { if (opIndex == DefineOwnPropertyInst::PropertyIdx) { - if (llvh::isa(Inst)) { - // In StoreNewOwnPropertyInst the property name must be a literal. + if (llvh::isa(Inst)) { + // In DefineNewOwnPropertyInst the property name must be a literal. return true; } diff --git a/lib/BCGen/SH/LoadConstants.cpp b/lib/BCGen/SH/LoadConstants.cpp index 21a7bcfcd3f..d011226a78d 100644 --- a/lib/BCGen/SH/LoadConstants.cpp +++ b/lib/BCGen/SH/LoadConstants.cpp @@ -41,11 +41,11 @@ bool operandMustBeLiteral(Instruction *Inst, unsigned opIndex) { if (llvh::isa(Inst) && opIndex > 0) return true; - // DefineOwnPropertyInst and StoreNewOwnPropertyInst. + // DefineOwnPropertyInst and DefineNewOwnPropertyInst. if (auto *SOP = llvh::dyn_cast(Inst)) { if (opIndex == DefineOwnPropertyInst::PropertyIdx) { - if (llvh::isa(Inst)) { - // In StoreNewOwnPropertyInst the property name must be a literal. + if (llvh::isa(Inst)) { + // In DefineNewOwnPropertyInst the property name must be a literal. return true; } diff --git a/lib/BCGen/SH/SH.cpp b/lib/BCGen/SH/SH.cpp index 22ff6677119..506bdc2292d 100644 --- a/lib/BCGen/SH/SH.cpp +++ b/lib/BCGen/SH/SH.cpp @@ -1238,7 +1238,7 @@ class InstrGen { generateRegisterPtr(*inst.getStoredValue()); os_ << ");\n"; } - void generateStoreNewOwnPropertyInst(StoreNewOwnPropertyInst &inst) { + void generateDefineNewOwnPropertyInst(DefineNewOwnPropertyInst &inst) { os_.indent(2); auto prop = inst.getProperty(); bool isEnumerable = inst.getIsEnumerable(); @@ -1246,7 +1246,7 @@ class InstrGen { if (auto *numProp = llvh::dyn_cast(prop)) { assert( isEnumerable && - "No way to generate non-enumerable indexed StoreNewOwnPropertyInst."); + "No way to generate non-enumerable indexed DefineNewOwnPropertyInst."); uint32_t index = *numProp->convertToArrayIndex(); os_ << "_sh_ljs_put_own_by_index("; os_ << "shr, "; diff --git a/lib/IR/IRBuilder.cpp b/lib/IR/IRBuilder.cpp index ae7b67ea058..fad6df06796 100644 --- a/lib/IR/IRBuilder.cpp +++ b/lib/IR/IRBuilder.cpp @@ -622,12 +622,12 @@ DefineOwnPropertyInst *IRBuilder::createDefineOwnPropertyInst( insert(SPI); return SPI; } -StoreNewOwnPropertyInst *IRBuilder::createStoreNewOwnPropertyInst( +DefineNewOwnPropertyInst *IRBuilder::createDefineNewOwnPropertyInst( Value *storedValue, Value *object, Literal *property, PropEnumerable isEnumerable) { - auto *inst = new StoreNewOwnPropertyInst( + auto *inst = new DefineNewOwnPropertyInst( storedValue, object, property, diff --git a/lib/IR/IRVerifier.cpp b/lib/IR/IRVerifier.cpp index f8433c4d596..5ed018ae109 100644 --- a/lib/IR/IRVerifier.cpp +++ b/lib/IR/IRVerifier.cpp @@ -974,23 +974,23 @@ bool Verifier::visitBaseDefineOwnPropertyInst( bool Verifier::visitDefineOwnPropertyInst(const DefineOwnPropertyInst &Inst) { return visitBaseDefineOwnPropertyInst(Inst); } -bool Verifier::visitStoreNewOwnPropertyInst( - const StoreNewOwnPropertyInst &Inst) { +bool Verifier::visitDefineNewOwnPropertyInst( + const DefineNewOwnPropertyInst &Inst) { ReturnIfNot(visitBaseDefineOwnPropertyInst(Inst)); AssertIWithMsg( Inst, Inst.getObject()->getType().isObjectType(), - "StoreNewOwnPropertyInst::Object must be known to be an object"); + "DefineNewOwnPropertyInst::Object must be known to be an object"); if (auto *LN = llvh::dyn_cast(Inst.getProperty())) { AssertIWithMsg( Inst, LN->convertToArrayIndex().hasValue(), - "StoreNewOwnPropertyInst::Property can only be an index-like number"); + "DefineNewOwnPropertyInst::Property can only be an index-like number"); } else { AssertIWithMsg( Inst, llvh::isa(Inst.getProperty()), - "StoreNewOwnPropertyInst::Property must be a string or number literal"); + "DefineNewOwnPropertyInst::Property must be a string or number literal"); } return true; } diff --git a/lib/IRGen/ESTreeIRGen-expr.cpp b/lib/IRGen/ESTreeIRGen-expr.cpp index 64cd91ea725..8663c44a4f8 100644 --- a/lib/IRGen/ESTreeIRGen-expr.cpp +++ b/lib/IRGen/ESTreeIRGen-expr.cpp @@ -1464,7 +1464,7 @@ Value *ESTreeIRGen::genObjectExpr(ESTree::ObjectExpressionNode *Expr) { // haveSeenComputedProp tracks whether we have processed a computed property. // Once we do, for all future properties, we can no longer generate - // StoreNewOwnPropertyInst because the computed property could have already + // DefineNewOwnPropertyInst because the computed property could have already // defined any property. bool haveSeenComputedProp = false; @@ -1564,7 +1564,7 @@ Value *ESTreeIRGen::genObjectExpr(ESTree::ObjectExpressionNode *Expr) { Key, IRBuilder::PropEnumerable::Yes); } else { - Builder.createStoreNewOwnPropertyInst( + Builder.createDefineNewOwnPropertyInst( Builder.getLiteralNull(), Obj, Key, @@ -1629,7 +1629,7 @@ Value *ESTreeIRGen::genObjectExpr(ESTree::ObjectExpressionNode *Expr) { Builder.createDefineOwnPropertyInst( value, Obj, Key, IRBuilder::PropEnumerable::Yes); } else { - Builder.createStoreNewOwnPropertyInst( + Builder.createDefineNewOwnPropertyInst( value, Obj, Key, IRBuilder::PropEnumerable::Yes); } propValue->state = PropertyValue::IRGenerated; @@ -1690,7 +1690,7 @@ Value *ESTreeIRGen::genTypedObjectExpr( "Missing stored value in typechecked object literal"); // Use a literal if possible, otherwise use the default init value. // Avoid putting non-literals here because we want to emit PrStore - // instead of StoreNewOwnPropertyInst. + // instead of DefineNewOwnPropertyInst. Value *initValue = nullptr; if (llvh::isa(it->second.first)) { initValue = it->second.first; diff --git a/lib/IRGen/ESTreeIRGen.cpp b/lib/IRGen/ESTreeIRGen.cpp index adcaf1d6947..03020df4158 100644 --- a/lib/IRGen/ESTreeIRGen.cpp +++ b/lib/IRGen/ESTreeIRGen.cpp @@ -1066,7 +1066,7 @@ void ESTreeIRGen::emitRestProperty( Builder.createAllocObjectLiteralInst({}, Builder.getLiteralNull()); for (Literal *key : literalExcludedItems) - Builder.createStoreNewOwnPropertyInst( + Builder.createDefineNewOwnPropertyInst( zeroValue, excludedObj, key, IRBuilder::PropEnumerable::Yes); for (Value *key : computedExcludedItems) { diff --git a/lib/Optimizer/Scalar/ObjectMergeNewStores.cpp b/lib/Optimizer/Scalar/ObjectMergeNewStores.cpp index 5d48e81847e..1d4fed2cf70 100644 --- a/lib/Optimizer/Scalar/ObjectMergeNewStores.cpp +++ b/lib/Optimizer/Scalar/ObjectMergeNewStores.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// \file /// -/// This optimization collects StoreNewOwnPropertyInsts and merges them into a +/// This optimization collects DefineNewOwnPropertyInsts and merges them into a /// single AllocObjectLiteral. //===----------------------------------------------------------------------===// @@ -25,8 +25,8 @@ namespace hermes { namespace { -/// Define a type for managing lists of StoreNewOwnPropertyInsts. -using StoreList = llvh::SmallVector; +/// Define a type for managing lists of DefineNewOwnPropertyInsts. +using StoreList = llvh::SmallVector; /// Define a type for mapping a given basic block to the stores to a given /// AllocObjectLiteralInst in that basic block. using BlockUserMap = llvh::DenseMap; @@ -42,11 +42,11 @@ StoreList collectStores( DI, allocInst->getParent(), [&userBasicBlockMap](BasicBlock *BB) { return userBasicBlockMap.find(BB) != userBasicBlockMap.end(); }); - // Iterate over the sorted blocks to collect StoreNewOwnPropertyInst users + // Iterate over the sorted blocks to collect DefineNewOwnPropertyInst users // until we encounter a nullptr indicating we should stop. StoreList instrs; for (BasicBlock *BB : sortedBlocks) { - for (StoreNewOwnPropertyInst *I : userBasicBlockMap.find(BB)->second) { + for (DefineNewOwnPropertyInst *I : userBasicBlockMap.find(BB)->second) { // If I is null, we cannot consider additional stores. if (!I) return instrs; @@ -56,7 +56,7 @@ StoreList collectStores( return instrs; } -/// Merge StoreNewOwnPropertyInsts into a single AllocObjectLiteralInst. +/// Merge DefineNewOwnPropertyInsts into a single AllocObjectLiteralInst. /// Non-literal values are set with placeholders and later patched with the /// correct value. /// \p allocInst the instruction to transform @@ -78,7 +78,7 @@ bool mergeStoresToObjectLiteral( // Keep track of if we have encountered a numeric key yet. bool hasSeenNumericKey = false; for (uint32_t i = 0; i < size; ++i) { - StoreNewOwnPropertyInst *I = users[i]; + DefineNewOwnPropertyInst *I = users[i]; Literal *propKey = llvh::cast(I->getProperty()); auto *propVal = I->getStoredValue(); hasSeenNumericKey |= llvh::isa(propKey); @@ -124,24 +124,26 @@ bool mergeNewStores(Function *F) { auto tryAdd = [](AllocObjectLiteralInst *A, Instruction *U, StoreList &stores) { // If the store list has been terminated by a nullptr, we have already - // encountered a non-SNOP user of A in this block. Ignore this user. + // encountered a non-define new user of A in this block. Ignore this + // user. if (!stores.empty() && !stores.back()) return; - auto *SI = llvh::dyn_cast(U); - if (!SI || SI->getStoredValue() == A || !SI->getIsEnumerable()) { - // A user that's not a StoreNewOwnPropertyInst storing into the object - // created by allocInst. We have to stop processing here. Note that we - // check the stored value instead of the target object so that we omit - // the case where an object is stored into itself. While it should - // technically be safe, this maintains the invariant that stop as soon - // the allocated object is used as something other than the target of - // a StoreNewOwnPropertyInst. + auto *newDef = llvh::dyn_cast(U); + if (!newDef || newDef->getStoredValue() == A || + !newDef->getIsEnumerable()) { + // A user that's not a DefineNewOwnPropertyInst storing into the + // object created by allocInst. We have to stop processing here. Note + // that we check the stored value instead of the target object so that + // we omit the case where an object is stored into itself. While it + // should technically be safe, this maintains the invariant that stop + // as soon the allocated object is used as something other than the + // target of a DefineNewOwnPropertyInst. stores.push_back(nullptr); } else { assert( - SI->getObject() == A && - "SNOP using allocInst must use it as object or value"); - stores.push_back(SI); + newDef->getObject() == A && + "DefineNew using allocInst must use it as object or value"); + stores.push_back(newDef); } }; @@ -152,8 +154,8 @@ bool mergeNewStores(Function *F) { for (Instruction &I : BB) { for (size_t i = 0; i < I.getNumOperands(); ++i) { if (auto *A = llvh::dyn_cast(I.getOperand(i))) { - // For now, we only consider merging StoreNewOwnPropertyInsts that are - // writing into an empty object to start. + // For now, we only consider merging DefineNewOwnPropertyInsts that + // are writing into an empty object to start. if (A->getKeyValuePairCount() == 0) tryAdd(A, &I, allocUsers[A][&BB]); } diff --git a/lib/Optimizer/Scalar/TypeInference.cpp b/lib/Optimizer/Scalar/TypeInference.cpp index be95753f980..e5aac644cc6 100644 --- a/lib/Optimizer/Scalar/TypeInference.cpp +++ b/lib/Optimizer/Scalar/TypeInference.cpp @@ -565,7 +565,7 @@ class TypeInferenceImpl { Type inferDefineOwnPropertyInst(DefineOwnPropertyInst *inst) { return Type::createNoType(); } - Type inferStoreNewOwnPropertyInst(StoreNewOwnPropertyInst *inst) { + Type inferDefineNewOwnPropertyInst(DefineNewOwnPropertyInst *inst) { return Type::createNoType(); } diff --git a/test/BCGen/HBC/hbc_object_literals-lowering.js b/test/BCGen/HBC/hbc_object_literals-lowering.js index 7f0db2fda28..ca0cf4a73dc 100644 --- a/test/BCGen/HBC/hbc_object_literals-lowering.js +++ b/test/BCGen/HBC/hbc_object_literals-lowering.js @@ -117,7 +117,7 @@ function accessorObjectLiteral(func) { // IRGEN-NEXT: %4 = HBCLoadConstInst (:string) "c": string // IRGEN-NEXT: DefineOwnGetterSetterInst %2: object, %3: undefined, %0: object, %4: string, true: boolean // IRGEN-NEXT: %6 = HBCLoadConstInst (:null) null: null -// IRGEN-NEXT: StoreNewOwnPropertyInst %6: null, %0: object, "d": string, true: boolean +// IRGEN-NEXT: DefineNewOwnPropertyInst %6: null, %0: object, "d": string, true: boolean // IRGEN-NEXT: ReturnInst %0: object // IRGEN-NEXT:function_end diff --git a/test/BCGen/HBC/own_properties.js b/test/BCGen/HBC/own_properties.js index 52d73726344..53eb9a43f2f 100644 --- a/test/BCGen/HBC/own_properties.js +++ b/test/BCGen/HBC/own_properties.js @@ -7,7 +7,7 @@ // RUN: %hermes -O0 -target=HBC -dump-lir %s | %FileCheckOrRegen --match-full-lines %s -// Test that StoreNewOwnPropertyInst is lowered to DefineOwnPropertyInst when +// Test that DefineNewOwnPropertyInst is lowered to DefineOwnPropertyInst when // the property name is a valid array index. // We use a computed key to avoid emitting AllocObjectLiteral. @@ -41,13 +41,13 @@ function foo() { // CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS1: any, %0: environment // CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %3 = HBCLoadConstInst (:number) 1: number -// CHECK-NEXT: StoreNewOwnPropertyInst %3: number, %2: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %3: number, %2: object, "a": string, true: boolean // CHECK-NEXT: %5 = HBCLoadConstInst (:number) 2: number -// CHECK-NEXT: StoreNewOwnPropertyInst %5: number, %2: object, 10: number, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %5: number, %2: object, 10: number, true: boolean // CHECK-NEXT: %7 = HBCLoadConstInst (:number) 3: number -// CHECK-NEXT: StoreNewOwnPropertyInst %7: number, %2: object, 11: number, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %7: number, %2: object, 11: number, true: boolean // CHECK-NEXT: %9 = HBCLoadConstInst (:number) 4: number -// CHECK-NEXT: StoreNewOwnPropertyInst %9: number, %2: object, "999999999999999999999999": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %9: number, %2: object, "999999999999999999999999": string, true: boolean // CHECK-NEXT: %11 = HBCLoadConstInst (:number) 5: number // CHECK-NEXT: DefineOwnPropertyInst %11: number, %2: object, 42: number, true: boolean // CHECK-NEXT: ReturnInst %2: object diff --git a/test/IRGen/__proto__-permitted-dup.js b/test/IRGen/__proto__-permitted-dup.js index e6e64b12218..c0ec7c3559a 100644 --- a/test/IRGen/__proto__-permitted-dup.js +++ b/test/IRGen/__proto__-permitted-dup.js @@ -99,8 +99,8 @@ function protoDupAccessor3(func) { // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) %5: any // CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS2.?obj]: object // CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %__proto__(): functionCode -// CHECK-NEXT: StoreNewOwnPropertyInst %8: object, %6: object, "__proto__": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 42: number, %6: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %8: object, %6: object, "__proto__": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 42: number, %6: object, "a": string, true: boolean // CHECK-NEXT: ReturnInst %6: object // CHECK-NEXT:function_end @@ -115,11 +115,11 @@ function protoDupAccessor3(func) { // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: StoreFrameInst %1: environment, %4: object, [%VS3.?obj]: object // CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %"__proto__ 1#"(): functionCode -// CHECK-NEXT: StoreNewOwnPropertyInst %6: object, %4: object, "__proto__": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %6: object, %4: object, "__proto__": string, true: boolean // CHECK-NEXT: %8 = LoadFrameInst (:any) %1: environment, [%VS3.func]: any // CHECK-NEXT: %9 = CallInst (:any) %8: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined // CHECK-NEXT: %10 = CallBuiltinInst (:any) [HermesBuiltin.silentSetPrototypeOf]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %4: object, %9: any -// CHECK-NEXT: StoreNewOwnPropertyInst 42: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 42: number, %4: object, "a": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end diff --git a/test/IRGen/__proto__-shorthand.js b/test/IRGen/__proto__-shorthand.js index 8d53c400570..224f2fac7bf 100644 --- a/test/IRGen/__proto__-shorthand.js +++ b/test/IRGen/__proto__-shorthand.js @@ -73,9 +73,9 @@ function protoShorthandMix2(func) { // CHECK-NEXT: StoreFrameInst %1: environment, 42: number, [%VS1.__proto__]: any // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %7 = LoadFrameInst (:any) %1: environment, [%VS1.__proto__]: any -// CHECK-NEXT: StoreNewOwnPropertyInst %7: any, %6: object, "__proto__": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %6: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %6: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %7: any, %6: object, "__proto__": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %6: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %6: object, "b": string, true: boolean // CHECK-NEXT: ReturnInst %6: object // CHECK-NEXT:function_end @@ -91,7 +91,7 @@ function protoShorthandMix2(func) { // CHECK-NEXT: StoreFrameInst %1: environment, 42: number, [%VS2.__proto__]: any // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %7 = LoadFrameInst (:any) %1: environment, [%VS2.__proto__]: any -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %6: object, "__proto__": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %6: object, "__proto__": string, true: boolean // CHECK-NEXT: %9 = LoadFrameInst (:any) %1: environment, [%VS2.__proto__]: any // CHECK-NEXT: DefineOwnPropertyInst %9: any, %6: object, "__proto__": string, true: boolean // CHECK-NEXT: ReturnInst %6: object @@ -109,7 +109,7 @@ function protoShorthandMix2(func) { // CHECK-NEXT: StoreFrameInst %1: environment, 42: number, [%VS3.__proto__]: any // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %7 = LoadFrameInst (:any) %1: environment, [%VS3.__proto__]: any -// CHECK-NEXT: StoreNewOwnPropertyInst %7: any, %6: object, "__proto__": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %7: any, %6: object, "__proto__": string, true: boolean // CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %10 = CallBuiltinInst (:any) [HermesBuiltin.silentSetPrototypeOf]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %6: object, %9: object // CHECK-NEXT: ReturnInst %6: object @@ -128,6 +128,6 @@ function protoShorthandMix2(func) { // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %7 = AllocObjectLiteralInst (:object) %6: object // CHECK-NEXT: %8 = LoadFrameInst (:any) %1: environment, [%VS4.__proto__]: any -// CHECK-NEXT: StoreNewOwnPropertyInst %8: any, %7: object, "__proto__": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %8: any, %7: object, "__proto__": string, true: boolean // CHECK-NEXT: ReturnInst %7: object // CHECK-NEXT:function_end diff --git a/test/IRGen/__proto__.js b/test/IRGen/__proto__.js index 23b0628d51e..c3a0bca2d7b 100644 --- a/test/IRGen/__proto__.js +++ b/test/IRGen/__proto__.js @@ -71,8 +71,8 @@ function protoIsDynamic(func, getParent) { // CHECK-NEXT: %4 = LoadFrameInst (:any) %1: environment, [%VS1.func]: any // CHECK-NEXT: %5 = CallInst (:any) %4: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) %5: any -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %6: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %6: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %6: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %6: object, "b": string, true: boolean // CHECK-NEXT: ReturnInst %6: object // CHECK-NEXT:function_end @@ -83,7 +83,7 @@ function protoIsDynamic(func, getParent) { // CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS0: any, %parentScope: environment // CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS2: any, %0: environment // CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %2: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %2: object, "a": string, true: boolean // CHECK-NEXT: ReturnInst %2: object // CHECK-NEXT:function_end @@ -94,7 +94,7 @@ function protoIsDynamic(func, getParent) { // CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS0: any, %parentScope: environment // CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS3: any, %0: environment // CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) 10: number -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %2: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %2: object, "b": string, true: boolean // CHECK-NEXT: ReturnInst %2: object // CHECK-NEXT:function_end @@ -105,7 +105,7 @@ function protoIsDynamic(func, getParent) { // CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS0: any, %parentScope: environment // CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS4: any, %0: environment // CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 4: number, %2: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 4: number, %2: object, "c": string, true: boolean // CHECK-NEXT: ReturnInst %2: object // CHECK-NEXT:function_end @@ -122,8 +122,8 @@ function protoIsDynamic(func, getParent) { // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %7 = LoadFrameInst (:any) %1: environment, [%VS5.func]: any // CHECK-NEXT: %8 = CallInst (:any) %7: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined -// CHECK-NEXT: StoreNewOwnPropertyInst %8: any, %6: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %6: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %8: any, %6: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %6: object, "b": string, true: boolean // CHECK-NEXT: %11 = LoadFrameInst (:any) %1: environment, [%VS5.getParent]: any // CHECK-NEXT: %12 = CallInst (:any) %11: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined // CHECK-NEXT: %13 = CallBuiltinInst (:any) [HermesBuiltin.silentSetPrototypeOf]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %6: object, %12: any diff --git a/test/IRGen/accessors.js b/test/IRGen/accessors.js index eae7fbcce3f..ed5d698ffd6 100644 --- a/test/IRGen/accessors.js +++ b/test/IRGen/accessors.js @@ -29,13 +29,13 @@ var x = { // CHECK-NEXT: %2 = AllocStackInst (:any) $?anon_0_ret: any // CHECK-NEXT: StoreStackInst undefined: undefined, %2: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "1": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "1": string, true: boolean // CHECK-NEXT: %6 = CreateFunctionInst (:object) %0: environment, %"get a"(): functionCode // CHECK-NEXT: DefineOwnGetterSetterInst %6: object, undefined: undefined, %4: object, "a": string, true: boolean // CHECK-NEXT: %8 = CreateFunctionInst (:object) %0: environment, %"get 1"(): functionCode // CHECK-NEXT: %9 = CreateFunctionInst (:object) %0: environment, %"set 1"(): functionCode // CHECK-NEXT: DefineOwnGetterSetterInst %8: object, %9: object, %4: object, "1": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "b": string, true: boolean // CHECK-NEXT: DefineOwnPropertyInst 12: number, %4: object, "b": string, true: boolean // CHECK-NEXT: StorePropertyLooseInst %4: object, globalObject: object, "x": string // CHECK-NEXT: %14 = LoadStackInst (:any) %2: any diff --git a/test/IRGen/array_object.js b/test/IRGen/array_object.js index fc7438ae87d..b1178d34327 100644 --- a/test/IRGen/array_object.js +++ b/test/IRGen/array_object.js @@ -45,9 +45,9 @@ function foo(param) { // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.obj]: any // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.foo]: any // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %6: object, "1": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %6: object, "1": string, true: boolean // CHECK-NEXT: %8 = LoadFrameInst (:any) %1: environment, [%VS1.param]: any -// CHECK-NEXT: StoreNewOwnPropertyInst %8: any, %6: object, "key": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %8: any, %6: object, "key": string, true: boolean // CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.obj]: any // CHECK-NEXT: %11 = AllocArrayInst (:object) 4: number, 1: number, 2: number, 3: number, 4: number // CHECK-NEXT: StoreFrameInst %1: environment, %11: object, [%VS1.foo]: any diff --git a/test/IRGen/es6/object-computed-destructuring.js b/test/IRGen/es6/object-computed-destructuring.js index 7c894d278c8..7366ccfce94 100644 --- a/test/IRGen/es6/object-computed-destructuring.js +++ b/test/IRGen/es6/object-computed-destructuring.js @@ -34,7 +34,7 @@ var {} = x; // CHECK-NEXT: %10 = LoadPropertyInst (:any) %9: any, "a": string // CHECK-NEXT: StorePropertyLooseInst %10: any, globalObject: object, "b": string // CHECK-NEXT: %12 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %12: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %12: object, "a": string, true: boolean // CHECK-NEXT: %14 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %15 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %14: object, %9: any, %12: object // CHECK-NEXT: StorePropertyLooseInst %15: any, globalObject: object, "rest": string @@ -46,7 +46,7 @@ var {} = x; // CHECK-NEXT: %22 = LoadPropertyInst (:any) %17: any, "c": string // CHECK-NEXT: StorePropertyLooseInst %22: any, globalObject: object, "d": string // CHECK-NEXT: %24 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %24: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %24: object, "c": string, true: boolean // CHECK-NEXT: StorePropertyLooseInst 0: number, %24: object, %19: any // CHECK-NEXT: %27 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %28 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %27: object, %17: any, %24: object diff --git a/test/IRGen/es6/rest-property.js b/test/IRGen/es6/rest-property.js index 00e814ac687..7f4de9c1524 100644 --- a/test/IRGen/es6/rest-property.js +++ b/test/IRGen/es6/rest-property.js @@ -99,8 +99,8 @@ function f5(o) { // CHECK-NEXT: %10 = LoadPropertyInst (:any) %7: any, "b": string // CHECK-NEXT: StoreFrameInst %1: environment, %10: any, [%VS2.b]: any // CHECK-NEXT: %12 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %12: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %12: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %12: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %12: object, "b": string, true: boolean // CHECK-NEXT: %15 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %16 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %15: object, %7: any, %12: object // CHECK-NEXT: StoreFrameInst %1: environment, %16: any, [%VS2.rest]: any @@ -122,7 +122,7 @@ function f5(o) { // CHECK-NEXT: %7 = LoadPropertyInst (:any) %6: any, "a": string // CHECK-NEXT: StoreFrameInst %1: environment, %7: any, [%VS3.a]: any // CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %9: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %9: object, "a": string, true: boolean // CHECK-NEXT: %11 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %12 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %11: object, %6: any, %9: object // CHECK-NEXT: StoreFrameInst %1: environment, %12: any, [%VS3.rest]: any @@ -145,7 +145,7 @@ function f5(o) { // CHECK-NEXT: StoreFrameInst %1: environment, %8: any, [%VS4.a]: any // CHECK-NEXT: %10 = LoadFrameInst (:any) %1: environment, [%VS4.o]: any // CHECK-NEXT: %11 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %11: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %11: object, "a": string, true: boolean // CHECK-NEXT: %13 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %14 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %13: object, %7: any, %11: object // CHECK-NEXT: StorePropertyLooseInst %14: any, %10: any, "rest": string @@ -168,7 +168,7 @@ function f5(o) { // CHECK-NEXT: %9 = LoadPropertyInst (:any) %6: any, "a": string // CHECK-NEXT: StoreFrameInst %1: environment, %9: any, [%VS5.a]: any // CHECK-NEXT: %11 = AllocObjectLiteralInst (:object) null: null -// CHECK-NEXT: StoreNewOwnPropertyInst 0: number, %11: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 0: number, %11: object, "a": string, true: boolean // CHECK-NEXT: %13 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %14 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %13: object, %6: any, %11: object // CHECK-NEXT: StoreFrameInst %1: environment, %14: any, [%VS5.rest]: any diff --git a/test/IRGen/es6/spread-operator.js b/test/IRGen/es6/spread-operator.js index 8e28a4a950a..3601f0bee4b 100644 --- a/test/IRGen/es6/spread-operator.js +++ b/test/IRGen/es6/spread-operator.js @@ -41,7 +41,7 @@ function foo(a, b, c) { // CHECK-NEXT: StoreFrameInst %1: environment, %6: any, [%VS1.c]: any // CHECK-NEXT: %8 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %9 = LoadFrameInst (:any) %1: environment, [%VS1.a]: any -// CHECK-NEXT: StoreNewOwnPropertyInst %9: any, %8: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %9: any, %8: object, "a": string, true: boolean // CHECK-NEXT: %11 = LoadFrameInst (:any) %1: environment, [%VS1.b]: any // CHECK-NEXT: %12 = CallBuiltinInst (:any) [HermesBuiltin.copyDataProperties]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %8: object, %11: any // CHECK-NEXT: %13 = LoadFrameInst (:any) %1: environment, [%VS1.c]: any diff --git a/test/IRGen/es6/tagged-template.js b/test/IRGen/es6/tagged-template.js index fd6da76585a..6209cebbe6d 100644 --- a/test/IRGen/es6/tagged-template.js +++ b/test/IRGen/es6/tagged-template.js @@ -190,7 +190,7 @@ function helloWorld() { // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS7.obj]: any // CHECK-NEXT: %3 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %4 = LoadPropertyInst (:any) globalObject: object, "dummy": string -// CHECK-NEXT: StoreNewOwnPropertyInst %4: any, %3: object, "func": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %4: any, %3: object, "func": string, true: boolean // CHECK-NEXT: StoreFrameInst %1: environment, %3: object, [%VS7.obj]: any // CHECK-NEXT: %7 = GetTemplateObjectInst (:any) 5: number, true: boolean, "hello world!": string // CHECK-NEXT: %8 = LoadFrameInst (:any) %1: environment, [%VS7.obj]: any diff --git a/test/IRGen/json.js b/test/IRGen/json.js index b5479b97e67..8fb691dd2b7 100644 --- a/test/IRGen/json.js +++ b/test/IRGen/json.js @@ -45,26 +45,26 @@ var json = { // CHECK-NEXT: StoreStackInst undefined: undefined, %2: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %5 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst "example glossary": string, %5: object, "title": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "example glossary": string, %5: object, "title": string, true: boolean // CHECK-NEXT: %7 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst "S": string, %7: object, "title": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "S": string, %7: object, "title": string, true: boolean // CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %10 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst "SGML": string, %10: object, "ID": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "SGML": string, %10: object, "SortAs": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "Standard Generalized Markup Language": string, %10: object, "GlossTerm": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "SGML": string, %10: object, "Acronym": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "ISO 8879:1986": string, %10: object, "Abbrev": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "SGML": string, %10: object, "ID": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "SGML": string, %10: object, "SortAs": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "Standard Generalized Markup Language": string, %10: object, "GlossTerm": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "SGML": string, %10: object, "Acronym": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "ISO 8879:1986": string, %10: object, "Abbrev": string, true: boolean // CHECK-NEXT: %16 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst "A meta-markup language, used to create markup languages such as DocBook.": string, %16: object, "para": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "A meta-markup language, used to create markup languages such as DocBook.": string, %16: object, "para": string, true: boolean // CHECK-NEXT: %18 = AllocArrayInst (:object) 2: number, "GML": string, "XML": string -// CHECK-NEXT: StoreNewOwnPropertyInst %18: object, %16: object, "GlossSeeAlso": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst %16: object, %10: object, "GlossDef": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "markup": string, %10: object, "GlossSee": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst %10: object, %9: object, "GlossEntry": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst %9: object, %7: object, "GlossList": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst %7: object, %5: object, "GlossDiv": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst %5: object, %4: object, "glossary": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %18: object, %16: object, "GlossSeeAlso": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %16: object, %10: object, "GlossDef": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "markup": string, %10: object, "GlossSee": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %10: object, %9: object, "GlossEntry": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %9: object, %7: object, "GlossList": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %7: object, %5: object, "GlossDiv": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %5: object, %4: object, "glossary": string, true: boolean // CHECK-NEXT: StorePropertyLooseInst %4: object, globalObject: object, "json": string // CHECK-NEXT: %27 = LoadStackInst (:any) %2: any // CHECK-NEXT: ReturnInst %27: any diff --git a/test/IRGen/object_literals.js b/test/IRGen/object_literals.js index 2099c713fb7..15ed352527c 100644 --- a/test/IRGen/object_literals.js +++ b/test/IRGen/object_literals.js @@ -118,9 +118,9 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS1.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %4: object, "prop1": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %4: object, "prop1": string, true: boolean // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %6: object, "prop1": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %6: object, "prop1": string, true: boolean // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end @@ -133,12 +133,12 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS2.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 4: number, %4: object, "d": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 5: number, %4: object, "5": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 6: number, %4: object, "6": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 4: number, %4: object, "d": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 5: number, %4: object, "5": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 6: number, %4: object, "6": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end @@ -151,13 +151,13 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS3.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %4: object, "a": string, true: boolean // CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 100: number, %6: object, "1": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 200: number, %6: object, "2": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst %6: object, %4: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "hello": string, %4: object, "c": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 100: number, %6: object, "1": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 200: number, %6: object, "2": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst %6: object, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "hello": string, %4: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end @@ -170,10 +170,10 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS4.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean // CHECK-NEXT: DefineOwnPropertyInst 4: number, %4: object, "d": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end @@ -199,9 +199,9 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS6.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean // CHECK-NEXT: %8 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %9 = CallBuiltinInst (:any) [HermesBuiltin.silentSetPrototypeOf]: number, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %4: object, %8: object // CHECK-NEXT: ReturnInst %4: object @@ -217,9 +217,9 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS7.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %5 = AllocObjectLiteralInst (:object) %4: object -// CHECK-NEXT: StoreNewOwnPropertyInst 1: number, %5: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %5: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %5: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 1: number, %5: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %5: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %5: object, "c": string, true: boolean // CHECK-NEXT: ReturnInst %5: object // CHECK-NEXT:function_end @@ -232,9 +232,9 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS8.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 1: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 3: number, %4: object, "c": string, true: boolean // CHECK-NEXT: DefineOwnPropertyInst 4: number, %4: object, "test": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end @@ -249,8 +249,8 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS9.func]: any // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS9.obj]: any // CHECK-NEXT: %5 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %5: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 20: number, %5: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %5: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 20: number, %5: object, "b": string, true: boolean // CHECK-NEXT: StoreFrameInst %1: environment, %5: object, [%VS9.obj]: any // CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: %10 = LoadFrameInst (:any) %1: environment, [%VS9.obj]: any @@ -268,10 +268,10 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS10.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %4: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "test-str": string, %4: object, "b": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "c": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "test-str": string, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "c": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean // CHECK-NEXT: DefineOwnPropertyInst 10086: number, %4: object, "c": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end @@ -285,11 +285,11 @@ function accessorObjectLiteral2(func) { // CHECK-NEXT: %2 = LoadParamInst (:any) %func: any // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS11.func]: any // CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst 10: number, %4: object, "a": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst "test-str": string, %4: object, "b": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 10: number, %4: object, "a": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst "test-str": string, %4: object, "b": string, true: boolean // CHECK-NEXT: %7 = CreateFunctionInst (:object) %1: environment, %"get c"(): functionCode // CHECK-NEXT: DefineOwnGetterSetterInst %7: object, undefined: undefined, %4: object, "c": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %4: object, "d": string, true: boolean // CHECK-NEXT: ReturnInst %4: object // CHECK-NEXT:function_end diff --git a/test/IRGen/own_props.js b/test/IRGen/own_props.js index e0a1f0368c8..a13815dbc1a 100644 --- a/test/IRGen/own_props.js +++ b/test/IRGen/own_props.js @@ -19,8 +19,8 @@ // CHECK-NEXT: %1 = AllocStackInst (:any) $?anon_0_ret: any // CHECK-NEXT: StoreStackInst undefined: undefined, %1: any // CHECK-NEXT: %3 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreNewOwnPropertyInst null: null, %3: object, "10": string, true: boolean -// CHECK-NEXT: StoreNewOwnPropertyInst 2: number, %3: object, "11": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst null: null, %3: object, "10": string, true: boolean +// CHECK-NEXT: DefineNewOwnPropertyInst 2: number, %3: object, "11": string, true: boolean // CHECK-NEXT: DefineOwnPropertyInst 3: number, %3: object, "10": string, true: boolean // CHECK-NEXT: StoreStackInst %3: object, %1: any // CHECK-NEXT: %8 = LoadStackInst (:any) %1: any