I'm not sure this is the correct place to put the safeguard. If nothing else, it should be earlier in the function, not after doing other tests that expect a string.
http://codereview.chromium.org/8554004/diff/1/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): http://codereview.chromium.org/8554004/diff/1/src/arm/code-stubs-arm.cc#newcode4568 src/arm/code-stubs-arm.cc:4568: // regexp_data: RegExp data (FixedArray) If r1 contains the instance type, then make a comment about it here with the other register invariants. http://codereview.chromium.org/8554004/diff/1/src/arm/code-stubs-arm.cc#newcode4584 src/arm/code-stubs-arm.cc:4584: __ tst(ebx, Immediate(kIsNotStringMask)); If it should have been guarded against, then make this an Assert check guarded by FLAG_debug_code. And if it there is actually a way to get here with a non-string, it should be found and eliminated. We control the arguments to stubs completely, and are expected to handle them safely. If it's called from %_RegExpExec, then the test should be performed there (all %-functions must check their arguments thoroughly). http://codereview.chromium.org/8554004/ -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev