Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 2e9badbb2aa073a3eb684b201fab60cec913ec68..3e71fc8ccfb39d1f638dd389f4183b61b2c3b6d8 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -9804,7 +9804,7 @@ void SharedFunctionInfo::EnableDeoptimizationSupport(Code* recompiled) { |
| } |
| -void SharedFunctionInfo::DisableOptimization(const char* reason) { |
| +void SharedFunctionInfo::DisableOptimization(BailoutReason reason) { |
| // Disable optimization for the shared function info and mark the |
| // code as non-optimizable. The marker on the shared function info |
| // is there because we flush non-optimized code thereby loosing the |
| @@ -9822,7 +9822,7 @@ void SharedFunctionInfo::DisableOptimization(const char* reason) { |
| if (FLAG_trace_opt) { |
| PrintF("[disabled optimization for "); |
| ShortPrint(); |
| - PrintF(", reason: %s]\n", reason); |
| + PrintF(", reason: %s]\n", GetBailoutReason(reason)); |
| } |
| } |
| @@ -15964,4 +15964,13 @@ void PropertyCell::AddDependentCode(Handle<Code> code) { |
| } |
| +const char* GetBailoutReason(BailoutReason reason) { |
| + ASSERT(reason >= kLastErrorMessage); |
|
alph
2013/08/01 10:35:50
<
loislo
2013/08/01 13:15:30
Done.
|
| +#define ERROR_MESSAGES_TEXTS(C, T) T, |
| + static const char* error_messages_[] = {ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)}; |
|
Jakob Kummerow
2013/08/01 12:02:13
nit: 80col
loislo
2013/08/01 13:15:30
Done.
|
| +#undef ERROR_MESSAGES_TEXTS |
| + return error_messages_[reason]; |
| +} |
| + |
| + |
| } } // namespace v8::internal |