| 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_X64_CODEGEN_X64_H_ | 28 #ifndef V8_X64_CODEGEN_X64_H_ |
| 29 #define V8_X64_CODEGEN_X64_H_ | 29 #define V8_X64_CODEGEN_X64_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(Isolate* isolate) { | |
| 48 InitializeAstVisitor(isolate); | |
| 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 bool RecordPositions(MacroAssembler* masm, | |
| 67 int pos, | |
| 68 bool right_here = false); | |
| 69 | |
| 70 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | |
| 71 | |
| 72 private: | |
| 73 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | |
| 74 }; | |
| 75 | |
| 76 | 40 |
| 77 class StringCharLoadGenerator : public AllStatic { | 41 class StringCharLoadGenerator : public AllStatic { |
| 78 public: | 42 public: |
| 79 // Generates the code for handling different string types and loading the | 43 // Generates the code for handling different string types and loading the |
| 80 // indexed character into |result|. We expect |index| as untagged input and | 44 // indexed character into |result|. We expect |index| as untagged input and |
| 81 // |result| as untagged output. | 45 // |result| as untagged output. |
| 82 static void Generate(MacroAssembler* masm, | 46 static void Generate(MacroAssembler* masm, |
| 83 Register string, | 47 Register string, |
| 84 Register index, | 48 Register index, |
| 85 Register result, | 49 Register result, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 const StackArgumentsAccessorReceiverMode receiver_mode_; | 130 const StackArgumentsAccessorReceiverMode receiver_mode_; |
| 167 const int extra_displacement_to_last_argument_; | 131 const int extra_displacement_to_last_argument_; |
| 168 | 132 |
| 169 DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor); | 133 DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor); |
| 170 }; | 134 }; |
| 171 | 135 |
| 172 | 136 |
| 173 } } // namespace v8::internal | 137 } } // namespace v8::internal |
| 174 | 138 |
| 175 #endif // V8_X64_CODEGEN_X64_H_ | 139 #endif // V8_X64_CODEGEN_X64_H_ |
| OLD | NEW |