Changeset 230376 in webkit for trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
- Timestamp:
- Apr 8, 2018, 9:21:38 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
r229815 r230376 30 30 #include "ComplexGetStatus.h" 31 31 #include "GetterSetterAccessCase.h" 32 #include "InterpreterInlines.h" 32 33 #include "IntrinsicGetterAccessCase.h" 33 34 #include "JSCInlines.h" … … 77 78 GetByIdStatus GetByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned bytecodeIndex, UniquedStringImpl* uid) 78 79 { 79 UNUSED_PARAM(profiledBlock);80 UNUSED_PARAM(bytecodeIndex);81 UNUSED_PARAM(uid);82 83 80 VM& vm = *profiledBlock->vm(); 84 81 85 82 Instruction* instruction = &profiledBlock->instructions()[bytecodeIndex]; 86 83 87 Opcode opcode = instruction[0].u.opcode; 88 89 ASSERT(opcode == LLInt::getOpcode(op_get_array_length) || opcode == LLInt::getOpcode(op_try_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_proto_load) || opcode == LLInt::getOpcode(op_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_unset)); 90 91 // FIXME: We should not just bail if we see a try_get_by_id or a get_by_id_proto_load. 92 // https://bugs.webkit.org/show_bug.cgi?id=158039 93 if (opcode != LLInt::getOpcode(op_get_by_id)) 84 switch (Interpreter::getOpcodeID(instruction[0].u.opcode)) { 85 case op_get_by_id: 86 case op_get_by_id_direct: { 87 StructureID structureID = instruction[4].u.structureID; 88 if (!structureID) 89 return GetByIdStatus(NoInformation, false); 90 91 Structure* structure = vm.heap.structureIDTable().get(structureID); 92 93 if (structure->takesSlowPathInDFGForImpureProperty()) 94 return GetByIdStatus(NoInformation, false); 95 96 unsigned attributes; 97 PropertyOffset offset = structure->getConcurrently(uid, attributes); 98 if (!isValidOffset(offset)) 99 return GetByIdStatus(NoInformation, false); 100 if (attributes & PropertyAttribute::CustomAccessor) 101 return GetByIdStatus(NoInformation, false); 102 103 return GetByIdStatus(Simple, false, GetByIdVariant(StructureSet(structure), offset)); 104 } 105 106 case op_get_array_length: 107 case op_try_get_by_id: 108 case op_get_by_id_proto_load: 109 case op_get_by_id_unset: { 110 // FIXME: We should not just bail if we see a try_get_by_id or a get_by_id_proto_load. 111 // https://bugs.webkit.org/show_bug.cgi?id=158039 94 112 return GetByIdStatus(NoInformation, false); 95 96 StructureID structureID = instruction[4].u.structureID; 97 if (!structureID) 113 } 114 115 default: { 116 ASSERT_NOT_REACHED(); 98 117 return GetByIdStatus(NoInformation, false); 99 100 Structure* structure = vm.heap.structureIDTable().get(structureID); 101 102 if (structure->takesSlowPathInDFGForImpureProperty()) 103 return GetByIdStatus(NoInformation, false); 104 105 unsigned attributes; 106 PropertyOffset offset = structure->getConcurrently(uid, attributes); 107 if (!isValidOffset(offset)) 108 return GetByIdStatus(NoInformation, false); 109 if (attributes & PropertyAttribute::CustomAccessor) 110 return GetByIdStatus(NoInformation, false); 111 112 return GetByIdStatus(Simple, false, GetByIdVariant(StructureSet(structure), offset)); 118 } 119 } 113 120 } 114 121 … … 362 369 // For now we only handle the super simple self access case. We could handle the 363 370 // prototype case in the future. 371 // 372 // Note that this code is also used for GetByIdDirect since this function only looks 373 // into direct properties. When supporting prototype chains, we should split this for 374 // GetById and GetByIdDirect. 364 375 365 376 if (set.isEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.