| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 12 matching lines...) Expand all Loading... |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 #ifndef V8_CODEGEN_H_ | 28 #ifndef V8_CODEGEN_H_ |
| 29 #define V8_CODEGEN_H_ | 29 #define V8_CODEGEN_H_ |
| 30 | 30 |
| 31 #include "code-stubs.h" | 31 #include "code-stubs.h" |
| 32 #include "runtime.h" | 32 #include "runtime.h" |
| 33 #include "type-info.h" | |
| 34 | 33 |
| 35 // Include the declaration of the architecture defined class CodeGenerator. | 34 // Include the declaration of the architecture defined class CodeGenerator. |
| 36 // The contract to the shared code is that the the CodeGenerator is a subclass | 35 // The contract to the shared code is that the the CodeGenerator is a subclass |
| 37 // of Visitor and that the following methods are available publicly: | 36 // of Visitor and that the following methods are available publicly: |
| 38 // MakeCode | 37 // MakeCode |
| 39 // MakeCodePrologue | 38 // MakeCodePrologue |
| 40 // MakeCodeEpilogue | 39 // MakeCodeEpilogue |
| 41 // masm | 40 // masm |
| 42 // frame | 41 // frame |
| 43 // script | 42 // script |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #endif | 83 #endif |
| 85 | 84 |
| 86 namespace v8 { | 85 namespace v8 { |
| 87 namespace internal { | 86 namespace internal { |
| 88 | 87 |
| 89 // Results of the library implementation of transcendental functions may differ | 88 // Results of the library implementation of transcendental functions may differ |
| 90 // from the one we use in our generated code. Therefore we use the same | 89 // from the one we use in our generated code. Therefore we use the same |
| 91 // generated code both in runtime and compiled code. | 90 // generated code both in runtime and compiled code. |
| 92 typedef double (*UnaryMathFunction)(double x); | 91 typedef double (*UnaryMathFunction)(double x); |
| 93 | 92 |
| 94 UnaryMathFunction CreateTranscendentalFunction(TranscendentalCache::Type type); | |
| 95 UnaryMathFunction CreateExpFunction(); | 93 UnaryMathFunction CreateExpFunction(); |
| 96 UnaryMathFunction CreateSqrtFunction(); | 94 UnaryMathFunction CreateSqrtFunction(); |
| 97 | 95 |
| 98 | 96 |
| 99 class ElementsTransitionGenerator : public AllStatic { | 97 class ElementsTransitionGenerator : public AllStatic { |
| 100 public: | 98 public: |
| 101 // If |mode| is set to DONT_TRACK_ALLOCATION_SITE, | 99 // If |mode| is set to DONT_TRACK_ALLOCATION_SITE, |
| 102 // |allocation_memento_found| may be NULL. | 100 // |allocation_memento_found| may be NULL. |
| 103 static void GenerateMapChangeElementsTransition(MacroAssembler* masm, | 101 static void GenerateMapChangeElementsTransition(MacroAssembler* masm, |
| 104 AllocationSiteMode mode, | 102 AllocationSiteMode mode, |
| 105 Label* allocation_memento_found); | 103 Label* allocation_memento_found); |
| 106 static void GenerateSmiToDouble(MacroAssembler* masm, | 104 static void GenerateSmiToDouble(MacroAssembler* masm, |
| 107 AllocationSiteMode mode, | 105 AllocationSiteMode mode, |
| 108 Label* fail); | 106 Label* fail); |
| 109 static void GenerateDoubleToObject(MacroAssembler* masm, | 107 static void GenerateDoubleToObject(MacroAssembler* masm, |
| 110 AllocationSiteMode mode, | 108 AllocationSiteMode mode, |
| 111 Label* fail); | 109 Label* fail); |
| 112 | 110 |
| 113 private: | 111 private: |
| 114 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); | 112 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); |
| 115 }; | 113 }; |
| 116 | 114 |
| 117 static const int kNumberDictionaryProbes = 4; | 115 static const int kNumberDictionaryProbes = 4; |
| 118 | 116 |
| 119 | 117 |
| 120 } } // namespace v8::internal | 118 } } // namespace v8::internal |
| 121 | 119 |
| 122 #endif // V8_CODEGEN_H_ | 120 #endif // V8_CODEGEN_H_ |
| OLD | NEW |