| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // CodeForStatementPosition | 65 // CodeForStatementPosition |
| 66 // CodeForDoWhileConditionPosition | 66 // CodeForDoWhileConditionPosition |
| 67 // CodeForSourcePosition | 67 // CodeForSourcePosition |
| 68 | 68 |
| 69 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 69 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
| 70 | 70 |
| 71 #if V8_TARGET_ARCH_IA32 | 71 #if V8_TARGET_ARCH_IA32 |
| 72 #include "ia32/codegen-ia32.h" | 72 #include "ia32/codegen-ia32.h" |
| 73 #elif V8_TARGET_ARCH_X64 | 73 #elif V8_TARGET_ARCH_X64 |
| 74 #include "x64/codegen-x64.h" | 74 #include "x64/codegen-x64.h" |
| 75 #elif V8_TARGET_ARCH_A64 |
| 76 #include "a64/codegen-a64.h" |
| 75 #elif V8_TARGET_ARCH_ARM | 77 #elif V8_TARGET_ARCH_ARM |
| 76 #include "arm/codegen-arm.h" | 78 #include "arm/codegen-arm.h" |
| 77 #elif V8_TARGET_ARCH_MIPS | 79 #elif V8_TARGET_ARCH_MIPS |
| 78 #include "mips/codegen-mips.h" | 80 #include "mips/codegen-mips.h" |
| 79 #else | 81 #else |
| 80 #error Unsupported target architecture. | 82 #error Unsupported target architecture. |
| 81 #endif | 83 #endif |
| 82 | 84 |
| 83 namespace v8 { | 85 namespace v8 { |
| 84 namespace internal { | 86 namespace internal { |
| 85 | 87 |
| 88 |
| 89 class CompilationInfo; |
| 90 |
| 91 |
| 92 class CodeGenerator { |
| 93 public: |
| 94 // Printing of AST, etc. as requested by flags. |
| 95 static void MakeCodePrologue(CompilationInfo* info, const char* kind); |
| 96 |
| 97 // Allocate and install the code. |
| 98 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm, |
| 99 Code::Flags flags, |
| 100 CompilationInfo* info); |
| 101 |
| 102 // Print the code after compiling it. |
| 103 static void PrintCode(Handle<Code> code, CompilationInfo* info); |
| 104 |
| 105 static bool ShouldGenerateLog(Isolate* isolate, Expression* type); |
| 106 |
| 107 static bool RecordPositions(MacroAssembler* masm, |
| 108 int pos, |
| 109 bool right_here = false); |
| 110 |
| 111 private: |
| 112 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 113 }; |
| 114 |
| 115 |
| 86 // Results of the library implementation of transcendental functions may differ | 116 // Results of the library implementation of transcendental functions may differ |
| 87 // from the one we use in our generated code. Therefore we use the same | 117 // from the one we use in our generated code. Therefore we use the same |
| 88 // generated code both in runtime and compiled code. | 118 // generated code both in runtime and compiled code. |
| 89 typedef double (*UnaryMathFunction)(double x); | 119 typedef double (*UnaryMathFunction)(double x); |
| 90 | 120 |
| 91 UnaryMathFunction CreateExpFunction(); | 121 UnaryMathFunction CreateExpFunction(); |
| 92 UnaryMathFunction CreateSqrtFunction(); | 122 UnaryMathFunction CreateSqrtFunction(); |
| 93 | 123 |
| 94 | 124 |
| 95 class ElementsTransitionGenerator : public AllStatic { | 125 class ElementsTransitionGenerator : public AllStatic { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 109 private: | 139 private: |
| 110 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); | 140 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionGenerator); |
| 111 }; | 141 }; |
| 112 | 142 |
| 113 static const int kNumberDictionaryProbes = 4; | 143 static const int kNumberDictionaryProbes = 4; |
| 114 | 144 |
| 115 | 145 |
| 116 } } // namespace v8::internal | 146 } } // namespace v8::internal |
| 117 | 147 |
| 118 #endif // V8_CODEGEN_H_ | 148 #endif // V8_CODEGEN_H_ |
| OLD | NEW |