Changeset 178928 in webkit for trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
- Timestamp:
- Jan 22, 2015, 11:34:34 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r178894 r178928 98 98 99 99 if (LIKELY(property.isUInt32())) { 100 uint32_t index = property.asUInt32(); 101 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."); 102 putByVal<strict, direct>(exec, baseValue, index, value); 100 putByVal<strict, direct>(exec, baseValue, property.asUInt32(), value); 103 101 return; 104 102 } … … 107 105 double propertyAsDouble = property.asDouble(); 108 106 uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble); 109 if (propertyAsDouble == propertyAsUInt32 && propertyAsUInt32 != PropertyName::NotAnIndex) {107 if (propertyAsDouble == propertyAsUInt32) { 110 108 putByVal<strict, direct>(exec, baseValue, propertyAsUInt32, value); 111 109 return; … … 125 123 // Don't put to an object if toString throws an exception. 126 124 Identifier ident = property.toString(exec)->toIdentifier(exec); 127 if (vm->exception()) 128 return; 129 130 PutPropertySlot slot(baseValue, strict); 131 if (direct) { 132 PropertyName propertyName(ident); 133 RELEASE_ASSERT(baseValue.isObject()); 134 if (Optional<uint32_t> index = propertyName.asIndex()) 135 asObject(baseValue)->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow); 136 else 137 asObject(baseValue)->putDirect(*vm, propertyName, value, slot); 138 } else 139 baseValue.put(exec, ident, value, slot); 125 if (!vm->exception()) { 126 PutPropertySlot slot(baseValue, strict); 127 if (direct) { 128 RELEASE_ASSERT(baseValue.isObject()); 129 asObject(baseValue)->putDirect(*vm, ident, value, slot); 130 } else 131 baseValue.put(exec, ident, value, slot); 132 } 140 133 } 141 134
Note:
See TracChangeset
for help on using the changeset viewer.