OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 26 matching lines...) Expand all Loading... |
37 // Forward declarations | 37 // Forward declarations |
38 class CompilationInfo; | 38 class CompilationInfo; |
39 | 39 |
40 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 40 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
41 | 41 |
42 // ------------------------------------------------------------------------- | 42 // ------------------------------------------------------------------------- |
43 // CodeGenerator | 43 // CodeGenerator |
44 | 44 |
45 class CodeGenerator: public AstVisitor { | 45 class CodeGenerator: public AstVisitor { |
46 public: | 46 public: |
47 CodeGenerator() { | |
48 InitializeAstVisitor(); | |
49 } | |
50 | |
51 static bool MakeCode(CompilationInfo* info); | 47 static bool MakeCode(CompilationInfo* info); |
52 | 48 |
53 // Printing of AST, etc. as requested by flags. | 49 // Printing of AST, etc. as requested by flags. |
54 static void MakeCodePrologue(CompilationInfo* info); | 50 static void MakeCodePrologue(CompilationInfo* info); |
55 | 51 |
56 // Allocate and install the code. | 52 // Allocate and install the code. |
57 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm, | 53 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm, |
58 Code::Flags flags, | 54 Code::Flags flags, |
59 CompilationInfo* info); | 55 CompilationInfo* info); |
60 | 56 |
61 // Print the code after compiling it. | 57 // Print the code after compiling it. |
62 static void PrintCode(Handle<Code> code, CompilationInfo* info); | 58 static void PrintCode(Handle<Code> code, CompilationInfo* info); |
63 | 59 |
64 static bool ShouldGenerateLog(Expression* type); | 60 static bool ShouldGenerateLog(Expression* type); |
65 | 61 |
66 static bool RecordPositions(MacroAssembler* masm, | 62 static bool RecordPositions(MacroAssembler* masm, |
67 int pos, | 63 int pos, |
68 bool right_here = false); | 64 bool right_here = false); |
69 | 65 |
70 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | |
71 | |
72 private: | 66 private: |
73 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 67 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
74 }; | 68 }; |
75 | 69 |
76 | 70 |
77 class StringCharLoadGenerator : public AllStatic { | 71 class StringCharLoadGenerator : public AllStatic { |
78 public: | 72 public: |
79 // Generates the code for handling different string types and loading the | 73 // Generates the code for handling different string types and loading the |
80 // indexed character into |result|. We expect |index| as untagged input and | 74 // indexed character into |result|. We expect |index| as untagged input and |
81 // |result| as untagged output. | 75 // |result| as untagged output. |
(...skipping 17 matching lines...) Expand all Loading... |
99 Register temp1, | 93 Register temp1, |
100 Register temp2); | 94 Register temp2); |
101 | 95 |
102 private: | 96 private: |
103 DISALLOW_COPY_AND_ASSIGN(MathExpGenerator); | 97 DISALLOW_COPY_AND_ASSIGN(MathExpGenerator); |
104 }; | 98 }; |
105 | 99 |
106 } } // namespace v8::internal | 100 } } // namespace v8::internal |
107 | 101 |
108 #endif // V8_X64_CODEGEN_X64_H_ | 102 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |