Changeset 59055 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- May 9, 2010, 4:18:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r58995 r59055 2088 2088 JSValue subscript = stackFrame.args[1].jsValue(); 2089 2089 2090 JSValue result; 2091 2092 if (LIKELY(subscript.isUInt32())) { 2090 if (LIKELY(baseValue.isCell() && subscript.isString())) { 2091 Identifier propertyName(callFrame, asString(subscript)->value(callFrame)); 2092 PropertySlot slot(asCell(baseValue)); 2093 if (asCell(baseValue)->fastGetOwnPropertySlot(callFrame, propertyName, slot)) { 2094 JSValue result = slot.getValue(callFrame, propertyName); 2095 CHECK_FOR_EXCEPTION(); 2096 return JSValue::encode(result); 2097 } 2098 } 2099 2100 if (subscript.isUInt32()) { 2093 2101 uint32_t i = subscript.asUInt32(); 2094 if (isJSArray(globalData, baseValue)) { 2095 JSArray* jsArray = asArray(baseValue); 2096 if (jsArray->canGetIndex(i)) 2097 result = jsArray->getIndex(i); 2098 else 2099 result = jsArray->JSArray::get(callFrame, i); 2100 } else if (isJSString(globalData, baseValue) && asString(baseValue)->canGetIndex(i)) { 2101 // All fast byte array accesses are safe from exceptions so return immediately to avoid exception checks. 2102 if (isJSString(globalData, baseValue) && asString(baseValue)->canGetIndex(i)) { 2102 2103 ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_val_string)); 2103 result = asString(baseValue)->getIndex(callFrame, i); 2104 } else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) { 2104 JSValue result = asString(baseValue)->getIndex(callFrame, i); 2105 CHECK_FOR_EXCEPTION(); 2106 return JSValue::encode(result); 2107 } 2108 if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) { 2105 2109 // All fast byte array accesses are safe from exceptions so return immediately to avoid exception checks. 2106 2110 ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_val_byte_array)); 2107 2111 return JSValue::encode(asByteArray(baseValue)->getIndex(callFrame, i)); 2108 } else 2109 result = baseValue.get(callFrame, i); 2110 } else { 2111 Identifier property(callFrame, subscript.toString(callFrame)); 2112 result = baseValue.get(callFrame, property); 2113 } 2114 2112 } 2113 JSValue result = baseValue.get(callFrame, i); 2114 CHECK_FOR_EXCEPTION(); 2115 return JSValue::encode(result); 2116 } 2117 2118 Identifier property(callFrame, subscript.toString(callFrame)); 2119 JSValue result = baseValue.get(callFrame, property); 2115 2120 CHECK_FOR_EXCEPTION_AT_END(); 2116 2121 return JSValue::encode(result);
Note:
See TracChangeset
for help on using the changeset viewer.