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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifndef V8_ARM_CODEGEN_ARM_H_ | 28 #ifndef V8_ARM_CODEGEN_ARM_H_ |
29 #define V8_ARM_CODEGEN_ARM_H_ | 29 #define V8_ARM_CODEGEN_ARM_H_ |
30 | 30 |
31 #include "ast.h" | 31 #include "ast.h" |
32 #include "ic-inl.h" | 32 #include "ic-inl.h" |
33 | 33 |
34 namespace v8 { | 34 namespace v8 { |
35 namespace internal { | 35 namespace internal { |
36 | 36 |
37 // Forward declarations | |
38 class CompilationInfo; | |
39 | 37 |
40 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 38 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
41 | 39 |
42 // ------------------------------------------------------------------------- | |
43 // CodeGenerator | |
44 | |
45 class CodeGenerator: public AstVisitor { | |
46 public: | |
47 explicit CodeGenerator(Zone* zone) { | |
48 InitializeAstVisitor(zone); | |
49 } | |
50 | |
51 static bool MakeCode(CompilationInfo* info); | |
52 | |
53 // Printing of AST, etc. as requested by flags. | |
54 static void MakeCodePrologue(CompilationInfo* info, const char* kind); | |
55 | |
56 // Allocate and install the code. | |
57 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm, | |
58 Code::Flags flags, | |
59 CompilationInfo* info); | |
60 | |
61 // Print the code after compiling it. | |
62 static void PrintCode(Handle<Code> code, CompilationInfo* info); | |
63 | |
64 static bool ShouldGenerateLog(Isolate* isolate, Expression* type); | |
65 | |
66 static void SetFunctionInfo(Handle<JSFunction> fun, | |
67 FunctionLiteral* lit, | |
68 bool is_toplevel, | |
69 Handle<Script> script); | |
70 | |
71 static bool RecordPositions(MacroAssembler* masm, | |
72 int pos, | |
73 bool right_here = false); | |
74 | |
75 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | |
76 | |
77 private: | |
78 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | |
79 }; | |
80 | |
81 | 40 |
82 class StringCharLoadGenerator : public AllStatic { | 41 class StringCharLoadGenerator : public AllStatic { |
83 public: | 42 public: |
84 // Generates the code for handling different string types and loading the | 43 // Generates the code for handling different string types and loading the |
85 // indexed character into |result|. We expect |index| as untagged input and | 44 // indexed character into |result|. We expect |index| as untagged input and |
86 // |result| as untagged output. | 45 // |result| as untagged output. |
87 static void Generate(MacroAssembler* masm, | 46 static void Generate(MacroAssembler* masm, |
88 Register string, | 47 Register string, |
89 Register index, | 48 Register index, |
90 Register result, | 49 Register result, |
(...skipping 16 matching lines...) Expand all Loading... |
107 Register temp2, | 66 Register temp2, |
108 Register temp3); | 67 Register temp3); |
109 | 68 |
110 private: | 69 private: |
111 DISALLOW_COPY_AND_ASSIGN(MathExpGenerator); | 70 DISALLOW_COPY_AND_ASSIGN(MathExpGenerator); |
112 }; | 71 }; |
113 | 72 |
114 } } // namespace v8::internal | 73 } } // namespace v8::internal |
115 | 74 |
116 #endif // V8_ARM_CODEGEN_ARM_H_ | 75 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |