Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index bcb02ed7970558b298971f092ae012cd10c20c79..23ea7116da7e76b24c0ff178fbade812d7dfe215 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -1361,12 +1361,13 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell, |
} |
-MaybeObject* CallStubCompiler::GenerateMissBranch() { |
+MaybeObject* CallStubCompiler::GenerateBranchHelper( |
+ Code::ExtraICState extra_ic_state) { |
+ MaybeObject* maybe_obj = StubCache::ComputeCallMiss(arguments().immediate(), |
+ kind_, |
+ extra_ic_state); |
Object* obj; |
- { MaybeObject* maybe_obj = |
- StubCache::ComputeCallMiss(arguments().immediate(), kind_); |
- if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
- } |
+ if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
__ jmp(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET); |
return obj; |
} |
@@ -1724,8 +1725,18 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( |
char_code_at_generator.GenerateSlow(masm(), call_helper); |
__ bind(&index_out_of_range); |
- __ Set(eax, Immediate(Factory::nan_value())); |
- __ ret((argc + 1) * kPointerSize); |
+ // Restore function name in ecx. |
+ __ Set(ecx, Immediate(Handle<String>(name))); |
+ if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { |
+ // Change the extra state to record the fact that we've seen an |
+ // out of bounds index. |
+ MaybeObject* maybe_obj = |
+ GenerateExtraStateChangeBranch(STRING_INDEX_OUT_OF_BOUNDS); |
+ if (maybe_obj->IsFailure()) return maybe_obj; |
+ } else { |
+ __ Set(eax, Immediate(Factory::nan_value())); |
+ __ ret((argc + 1) * kPointerSize); |
+ } |
__ bind(&miss); |
Object* obj; |
@@ -1799,8 +1810,18 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( |
char_at_generator.GenerateSlow(masm(), call_helper); |
__ bind(&index_out_of_range); |
- __ Set(eax, Immediate(Factory::empty_string())); |
- __ ret((argc + 1) * kPointerSize); |
+ // Restore function name in ecx. |
+ __ Set(ecx, Immediate(Handle<String>(name))); |
+ if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { |
+ // Change the extra state to record the fact that we've seen an |
+ // out of bounds index. |
+ MaybeObject* maybe_obj = |
+ GenerateExtraStateChangeBranch(STRING_INDEX_OUT_OF_BOUNDS); |
+ if (maybe_obj->IsFailure()) return maybe_obj; |
+ } else { |
+ __ Set(eax, Immediate(Factory::empty_string())); |
+ __ ret((argc + 1) * kPointerSize); |
+ } |
__ bind(&miss); |
Object* obj; |