Changeset 116361 in webkit
- Timestamp:
- May 7, 2012 3:52:52 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116358 r116361 1 2012-05-07 Oliver Hunt <oliver@apple.com> 2 3 LLInt doesn't check for Ropes when performing a character switch 4 https://bugs.webkit.org/show_bug.cgi?id=85837 5 6 Reviewed by Filip Pizlo. 7 8 Add a few tests to force the use of ropes on switch statements. 9 10 * fast/js/script-tests/switch-behaviour.js: 11 * fast/js/switch-behaviour-expected.txt: 12 1 13 2012-05-07 Raymond Toy <rtoy@google.com> 2 14 -
trunk/LayoutTests/fast/js/script-tests/switch-behaviour.js
r98407 r116361 232 232 233 233 // Character switch 234 var emptyString1 = ""; 235 var emptyString2 = ""; 236 shouldBe("characterSwitch('A' + emptyString1)", '"A"'); 237 shouldBe("characterSwitch('A' + emptyString1 + emptyString2)", '"A"'); 238 shouldBe("characterSwitch(emptyString1 + emptyString2)", '"default"'); 239 234 240 shouldBe("characterSwitch('\0')", '"\0"'); 235 241 shouldBe("characterSwitch('A')", '"A"'); -
trunk/LayoutTests/fast/js/switch-behaviour-expected.txt
r64796 r116361 4 4 5 5 6 PASS characterSwitch('A' + emptyString1) is "A" 7 PASS characterSwitch('A' + emptyString1 + emptyString2) is "A" 8 PASS characterSwitch(emptyString1 + emptyString2) is "default" 6 9 PASS characterSwitch('\0') is "\0" 7 10 PASS characterSwitch('A') is "A" -
trunk/Source/JavaScriptCore/ChangeLog
r116356 r116361 1 2012-05-07 Oliver Hunt <oliver@apple.com> 2 3 LLInt doesn't check for Ropes when performing a character switch 4 https://bugs.webkit.org/show_bug.cgi?id=85837 5 6 Reviewed by Filip Pizlo. 7 8 Make LLint check if the scrutinee of a char switch is a rope, and if 9 so fall back to a slow case. 10 11 * llint/LLIntSlowPaths.cpp: 12 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 13 (LLInt): 14 * llint/LowLevelInterpreter32_64.asm: 15 * llint/LowLevelInterpreter64.asm: 16 1 17 2012-05-07 Eric Seidel <eric@webkit.org> 2 18 -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r115861 r116361 1168 1168 } 1169 1169 1170 LLINT_SLOW_PATH_DECL(slow_path_switch_char) 1171 { 1172 LLINT_BEGIN(); 1173 JSValue scrutinee = LLINT_OP_C(3).jsValue(); 1174 ASSERT(scrutinee.isString()); 1175 JSString* value = asString(scrutinee); 1176 ASSERT(value->length() == 1); 1177 int defaultOffset = pc[2].u.operand; 1178 StringImpl* impl = asString(scrutinee)->value(exec).impl(); 1179 CodeBlock* codeBlock = exec->codeBlock(); 1180 pc += codeBlock->characterSwitchJumpTable(pc[1].u.operand).offsetForValue((*impl)[0], defaultOffset); 1181 LLINT_END(); 1182 } 1183 1170 1184 LLINT_SLOW_PATH_DECL(slow_path_switch_string) 1171 1185 { -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r116054 r116361 1447 1447 loadp JSCell::m_structure[t0], t1 1448 1448 bbneq Structure::m_typeInfo + TypeInfo::m_type[t1], StringType, .opSwitchCharFallThrough 1449 bineq JSString::m_length[t0], 1, .opSwitchCharFallThrough 1449 1450 loadp JSString::m_value[t0], t0 1450 b ineq StringImpl::m_length[t0], 1, .opSwitchCharFallThrough1451 btpz t0, .opSwitchOnRope 1451 1452 loadp StringImpl::m_data8[t0], t1 1452 1453 btinz StringImpl::m_hashAndFlags[t0], HashFlags8BitBuffer, .opSwitchChar8Bit … … 1465 1466 .opSwitchCharFallThrough: 1466 1467 dispatchBranch(8[PC]) 1468 1469 .opSwitchOnRope: 1470 callSlowPath(_llint_slow_path_switch_char) 1471 dispatch(0) 1467 1472 1468 1473 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r114702 r116361 1293 1293 loadp JSCell::m_structure[t1], t0 1294 1294 bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], StringType, .opSwitchCharFallThrough 1295 bineq JSString::m_length[t1], 1, .opSwitchCharFallThrough 1295 1296 loadp JSString::m_value[t1], t0 1296 b ineq StringImpl::m_length[t0], 1, .opSwitchCharFallThrough1297 btpz t0, .opSwitchOnRope 1297 1298 loadp StringImpl::m_data8[t0], t1 1298 1299 btinz StringImpl::m_hashAndFlags[t0], HashFlags8BitBuffer, .opSwitchChar8Bit … … 1311 1312 .opSwitchCharFallThrough: 1312 1313 dispatchInt(16[PB, PC, 8]) 1314 1315 .opSwitchOnRope: 1316 callSlowPath(_llint_slow_path_switch_char) 1317 dispatch(0) 1313 1318 1314 1319
Note: See TracChangeset
for help on using the changeset viewer.