Changeset 39796 in webkit for trunk/JavaScriptCore/interpreter
- Timestamp:
- Jan 11, 2009, 8:48:39 AM (16 years ago)
- Location:
- trunk/JavaScriptCore/interpreter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r39752 r39796 5118 5118 } else if (interpreter->isJSString(baseValue) && asString(baseValue)->canGetIndex(i)) 5119 5119 return JSValuePtr::encode(asString(baseValue)->getIndex(ARG_globalData, i)); 5120 else if (interpreter->isJSByteArray(baseValue) && asByteArray(baseValue)->canAccessIndex(i)) 5120 else if (interpreter->isJSByteArray(baseValue) && asByteArray(baseValue)->canAccessIndex(i)) { 5121 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_val_byte_array)); 5121 5122 return JSValuePtr::encode(asByteArray(baseValue)->getIndex(i)); 5122 else5123 } else 5123 5124 result = baseValue->get(callFrame, i); 5124 5125 } else { … … 5127 5128 } 5128 5129 5130 CHECK_FOR_EXCEPTION_AT_END(); 5131 return JSValuePtr::encode(result); 5132 } 5133 5134 JSValueEncodedAsPointer* Interpreter::cti_op_get_by_val_byte_array(STUB_ARGS) 5135 { 5136 BEGIN_STUB_FUNCTION(); 5137 5138 CallFrame* callFrame = ARG_callFrame; 5139 Interpreter* interpreter = ARG_globalData->interpreter; 5140 5141 JSValuePtr baseValue = ARG_src1; 5142 JSValuePtr subscript = ARG_src2; 5143 5144 JSValuePtr result; 5145 unsigned i; 5146 5147 bool isUInt32 = JSImmediate::getUInt32(subscript, i); 5148 if (LIKELY(isUInt32)) { 5149 if (interpreter->isJSByteArray(baseValue) && asByteArray(baseValue)->canAccessIndex(i)) 5150 return JSValuePtr::encode(asByteArray(baseValue)->getIndex(i)); 5151 else { 5152 result = baseValue->get(callFrame, i); 5153 if (!interpreter->isJSByteArray(baseValue)) 5154 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_val)); 5155 } 5156 } else { 5157 Identifier property(callFrame, subscript->toString(callFrame)); 5158 result = baseValue->get(callFrame, property); 5159 } 5160 5129 5161 CHECK_FOR_EXCEPTION_AT_END(); 5130 5162 return JSValuePtr::encode(result); … … 5215 5247 JSByteArray* jsByteArray = asByteArray(baseValue); 5216 5248 double dValue = 0; 5249 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_put_by_val_byte_array)); 5217 5250 if (JSImmediate::isNumber(value)) { 5218 5251 jsByteArray->setIndex(i, JSImmediate::getTruncatedInt32(value)); … … 5262 5295 } 5263 5296 5297 void Interpreter::cti_op_put_by_val_byte_array(STUB_ARGS) 5298 { 5299 BEGIN_STUB_FUNCTION(); 5300 5301 CallFrame* callFrame = ARG_callFrame; 5302 Interpreter* interpreter = ARG_globalData->interpreter; 5303 5304 JSValuePtr baseValue = ARG_src1; 5305 JSValuePtr subscript = ARG_src2; 5306 JSValuePtr value = ARG_src3; 5307 5308 unsigned i; 5309 5310 bool isUInt32 = JSImmediate::getUInt32(subscript, i); 5311 if (LIKELY(isUInt32)) { 5312 if (interpreter->isJSByteArray(baseValue) && asByteArray(baseValue)->canAccessIndex(i)) { 5313 JSByteArray* jsByteArray = asByteArray(baseValue); 5314 double dValue = 0; 5315 if (JSImmediate::isNumber(value)) { 5316 jsByteArray->setIndex(i, JSImmediate::getTruncatedInt32(value)); 5317 return; 5318 } else if (fastIsNumber(value, dValue)) { 5319 jsByteArray->setIndex(i, dValue); 5320 return; 5321 } else 5322 baseValue->put(callFrame, i, value); 5323 } else { 5324 if (!interpreter->isJSByteArray(baseValue)) 5325 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_put_by_val)); 5326 baseValue->put(callFrame, i, value); 5327 } 5328 } else { 5329 Identifier property(callFrame, subscript->toString(callFrame)); 5330 if (!ARG_globalData->exception) { // Don't put to an object if toString threw an exception. 5331 PutPropertySlot slot; 5332 baseValue->put(callFrame, property, value, slot); 5333 } 5334 } 5335 5336 CHECK_FOR_EXCEPTION_AT_END(); 5337 } 5338 5264 5339 JSValueEncodedAsPointer* Interpreter::cti_op_lesseq(STUB_ARGS) 5265 5340 { -
trunk/JavaScriptCore/interpreter/Interpreter.h
r39670 r39796 222 222 static JSValueEncodedAsPointer* JIT_STUB cti_op_construct_NotJSConstruct(STUB_ARGS); 223 223 static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_val(STUB_ARGS); 224 static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_val_byte_array(STUB_ARGS); 224 225 static VoidPtrPair JIT_STUB cti_op_resolve_func(STUB_ARGS); 225 226 static JSValueEncodedAsPointer* JIT_STUB cti_op_sub(STUB_ARGS); 226 227 static void JIT_STUB cti_op_put_by_val(STUB_ARGS); 227 228 static void JIT_STUB cti_op_put_by_val_array(STUB_ARGS); 229 static void JIT_STUB cti_op_put_by_val_byte_array(STUB_ARGS); 228 230 static JSValueEncodedAsPointer* JIT_STUB cti_op_lesseq(STUB_ARGS); 229 231 static int JIT_STUB cti_op_loop_if_true(STUB_ARGS);
Note:
See TracChangeset
for help on using the changeset viewer.