Changeset 178756 in webkit for trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
- Timestamp:
- Jan 20, 2015, 2:43:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r178751 r178756 820 820 RELEASE_ASSERT(baseValue.isObject()); 821 821 JSObject* baseObject = asObject(baseValue); 822 bool isStrictMode = exec->codeBlock()->isStrictMode();823 822 if (LIKELY(subscript.isUInt32())) { 824 uint32_t index = subscript.asUInt32(); 825 ASSERT_WITH_MESSAGE(index != PropertyName::NotAnIndex, "Since JSValue::isUInt32 returns true only when the boxed value is int32_t and positive, it doesn't return true for uint32_t max value that is PropertyName::NotAnIndex."); 826 baseObject->putDirectIndex(exec, index, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 827 LLINT_END(); 828 } 829 830 831 if (subscript.isDouble()) { 832 double subscriptAsDouble = subscript.asDouble(); 833 uint32_t subscriptAsUInt32 = static_cast<uint32_t>(subscriptAsDouble); 834 if (subscriptAsDouble == subscriptAsUInt32 && subscriptAsUInt32 != PropertyName::NotAnIndex) { 835 baseObject->putDirectIndex(exec, subscriptAsUInt32, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 836 LLINT_END(); 823 uint32_t i = subscript.asUInt32(); 824 baseObject->putDirectIndex(exec, i, value); 825 } else if (isName(subscript)) { 826 PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode()); 827 baseObject->putDirect(exec->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot); 828 } else { 829 Identifier property = subscript.toString(exec)->toIdentifier(exec); 830 if (!exec->vm().exception()) { // Don't put to an object if toString threw an exception. 831 PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode()); 832 baseObject->putDirect(exec->vm(), property, value, slot); 837 833 } 838 }839 840 if (isName(subscript)) {841 PutPropertySlot slot(baseObject, isStrictMode);842 baseObject->putDirect(exec->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot);843 LLINT_END();844 }845 846 // Don't put to an object if toString throws an exception.847 Identifier property = subscript.toString(exec)->toIdentifier(exec);848 if (exec->vm().exception())849 LLINT_END();850 851 PropertyName propertyName(property);852 if (Optional<uint32_t> index = propertyName.asIndex())853 baseObject->putDirectIndex(exec, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);854 else {855 PutPropertySlot slot(baseObject, isStrictMode);856 baseObject->putDirect(exec->vm(), propertyName, value, slot);857 834 } 858 835 LLINT_END();
Note:
See TracChangeset
for help on using the changeset viewer.