OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 14 matching lines...) Expand all Loading... |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "accessors.h" | 30 #include "accessors.h" |
31 #include "api.h" | 31 #include "api.h" |
32 #include "arguments.h" | 32 #include "arguments.h" |
33 #include "bootstrapper.h" | 33 #include "bootstrapper.h" |
34 #include "codegen.h" | 34 #include "codegen.h" |
| 35 #include "cpu-profiler.h" |
35 #include "debug.h" | 36 #include "debug.h" |
36 #include "deoptimizer.h" | 37 #include "deoptimizer.h" |
37 #include "date.h" | 38 #include "date.h" |
38 #include "elements.h" | 39 #include "elements.h" |
39 #include "execution.h" | 40 #include "execution.h" |
40 #include "full-codegen.h" | 41 #include "full-codegen.h" |
41 #include "hydrogen.h" | 42 #include "hydrogen.h" |
42 #include "isolate-inl.h" | 43 #include "isolate-inl.h" |
| 44 #include "log.h" |
43 #include "objects-inl.h" | 45 #include "objects-inl.h" |
44 #include "objects-visiting.h" | 46 #include "objects-visiting.h" |
45 #include "objects-visiting-inl.h" | 47 #include "objects-visiting-inl.h" |
46 #include "macro-assembler.h" | 48 #include "macro-assembler.h" |
47 #include "mark-compact.h" | 49 #include "mark-compact.h" |
48 #include "safepoint-table.h" | 50 #include "safepoint-table.h" |
49 #include "string-stream.h" | 51 #include "string-stream.h" |
50 #include "utils.h" | 52 #include "utils.h" |
51 | 53 |
52 #ifdef ENABLE_DISASSEMBLER | 54 #ifdef ENABLE_DISASSEMBLER |
(...skipping 9738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9791 | 9793 |
9792 void SharedFunctionInfo::DisableOptimization(BailoutReason reason) { | 9794 void SharedFunctionInfo::DisableOptimization(BailoutReason reason) { |
9793 // Disable optimization for the shared function info and mark the | 9795 // Disable optimization for the shared function info and mark the |
9794 // code as non-optimizable. The marker on the shared function info | 9796 // code as non-optimizable. The marker on the shared function info |
9795 // is there because we flush non-optimized code thereby loosing the | 9797 // is there because we flush non-optimized code thereby loosing the |
9796 // non-optimizable information for the code. When the code is | 9798 // non-optimizable information for the code. When the code is |
9797 // regenerated and set on the shared function info it is marked as | 9799 // regenerated and set on the shared function info it is marked as |
9798 // non-optimizable if optimization is disabled for the shared | 9800 // non-optimizable if optimization is disabled for the shared |
9799 // function info. | 9801 // function info. |
9800 set_optimization_disabled(true); | 9802 set_optimization_disabled(true); |
| 9803 set_bailout_reason(reason); |
9801 // Code should be the lazy compilation stub or else unoptimized. If the | 9804 // Code should be the lazy compilation stub or else unoptimized. If the |
9802 // latter, disable optimization for the code too. | 9805 // latter, disable optimization for the code too. |
9803 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 9806 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
9804 if (code()->kind() == Code::FUNCTION) { | 9807 if (code()->kind() == Code::FUNCTION) { |
9805 code()->set_optimizable(false); | 9808 code()->set_optimizable(false); |
9806 } | 9809 } |
| 9810 PROFILE(Isolate::Current(), |
| 9811 LogExistingFunction(Handle<SharedFunctionInfo>(this), |
| 9812 Handle<Code>(code()))); |
9807 if (FLAG_trace_opt) { | 9813 if (FLAG_trace_opt) { |
9808 PrintF("[disabled optimization for "); | 9814 PrintF("[disabled optimization for "); |
9809 ShortPrint(); | 9815 ShortPrint(); |
9810 PrintF(", reason: %s]\n", GetBailoutReason(reason)); | 9816 PrintF(", reason: %s]\n", GetBailoutReason(reason)); |
9811 } | 9817 } |
9812 } | 9818 } |
9813 | 9819 |
9814 | 9820 |
9815 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 9821 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
9816 ASSERT(!id.IsNone()); | 9822 ASSERT(!id.IsNone()); |
(...skipping 6151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15968 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15974 #define ERROR_MESSAGES_TEXTS(C, T) T, |
15969 static const char* error_messages_[] = { | 15975 static const char* error_messages_[] = { |
15970 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15976 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
15971 }; | 15977 }; |
15972 #undef ERROR_MESSAGES_TEXTS | 15978 #undef ERROR_MESSAGES_TEXTS |
15973 return error_messages_[reason]; | 15979 return error_messages_[reason]; |
15974 } | 15980 } |
15975 | 15981 |
15976 | 15982 |
15977 } } // namespace v8::internal | 15983 } } // namespace v8::internal |
OLD | NEW |