Chromium Code Reviews| Index: src/code-stubs-hydrogen.cc |
| diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
| index dfa5ecd8cf840a75086eb5b0d5bac86b839aceb3..2022cac6404030fdce0af08a91ffb253df1b5b1a 100644 |
| --- a/src/code-stubs-hydrogen.cc |
| +++ b/src/code-stubs-hydrogen.cc |
| @@ -1191,6 +1191,23 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap( |
| loop_builder.Break(); |
| } |
| done_check.Else(); |
| + { |
| + // The optimization count should be tied to the context, e.g. as |
| + // entry in optimized code map. But for simplicity's sake we just |
| + // reset the opt count if the optimized code map lookup fails, |
| + // because no optimized code exists for the current context. |
| + HValue* opt_count_and_bailout_reason = Add<HLoadNamedField>( |
| + shared_info, HObjectAccess::ForOptCountAndBailoutReason()); |
| + int32_t opt_count_mask = |
|
Jakob Kummerow
2013/11/05 14:35:05
BitField has a kMask which you can use. Note that
|
| + (1 << SharedFunctionInfo::OptCountBits::kSize - 1) |
| + << SharedFunctionInfo::OptCountBits::kShift; |
| + HValue* mask = Add<HConstant>(opt_count_mask); |
| + HValue* result = Add<HBitwise>( |
| + Token::BIT_AND, opt_count_and_bailout_reason, mask); |
| + Add<HStoreNamedField>(shared_info, |
| + HObjectAccess::ForOptCountAndBailoutReason(), |
| + result); |
| + } |
| done_check.End(); |
| } |
| restore_check.End(); |
| @@ -1241,8 +1258,6 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() { |
| HObjectAccess::ForSharedFunctionInfoPointer(), |
| shared_info); |
| Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(), |
| - shared_info); |
| - Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(), |
| context()); |
| // Initialize the code pointer in the function to be the one |