| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void Generate(CompilationInfo* compilation_info); | 72 void Generate(CompilationInfo* compilation_info); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 MacroAssembler* masm() { return masm_; } | 75 MacroAssembler* masm() { return masm_; } |
| 76 CompilationInfo* info() { return info_; } | 76 CompilationInfo* info() { return info_; } |
| 77 Label* bailout() { return &bailout_; } | 77 Label* bailout() { return &bailout_; } |
| 78 | 78 |
| 79 FunctionLiteral* function() { return info_->function(); } | 79 FunctionLiteral* function() { return info_->function(); } |
| 80 Scope* scope() { return info_->scope(); } | 80 Scope* scope() { return info_->scope(); } |
| 81 | 81 |
| 82 // Platform-specific fixed registers, all guaranteed distinct. |
| 83 Register accumulator0(); |
| 84 Register accumulator1(); |
| 85 Register scratch0(); |
| 86 Register scratch1(); |
| 87 Register receiver_reg(); |
| 88 Register context_reg(); |
| 89 |
| 82 // AST node visit functions. | 90 // AST node visit functions. |
| 83 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 91 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
| 84 AST_NODE_LIST(DECLARE_VISIT) | 92 AST_NODE_LIST(DECLARE_VISIT) |
| 85 #undef DECLARE_VISIT | 93 #undef DECLARE_VISIT |
| 86 | 94 |
| 87 // Emit code to load the receiver from the stack into a given register. | 95 // Emit code to load the receiver from the stack into the fixed receiver |
| 88 void EmitLoadReceiver(Register reg); | 96 // register. |
| 97 void EmitLoadReceiver(); |
| 89 | 98 |
| 90 // Emit code to check that the receiver has the same map as the | 99 // Emit code to check that the receiver has the same map as the |
| 91 // compile-time receiver. Receiver is expected in {ia32-edx, x64-rdx, | 100 // compile-time receiver. Receiver is expected in {ia32-edx, x64-rdx, |
| 92 // arm-r1}. Emit a branch to the (single) bailout label if check fails. | 101 // arm-r1}. Emit a branch to the (single) bailout label if check fails. |
| 93 void EmitReceiverMapCheck(); | 102 void EmitReceiverMapCheck(); |
| 94 | 103 |
| 95 // Emit code to check that the global object has the same map as the | 104 // Emit code to check that the global object has the same map as the |
| 96 // global object seen at compile time. | 105 // global object seen at compile time. |
| 97 void EmitGlobalMapCheck(); | 106 void EmitGlobalMapCheck(); |
| 98 | 107 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 | 120 |
| 112 Label bailout_; | 121 Label bailout_; |
| 113 | 122 |
| 114 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); | 123 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); |
| 115 }; | 124 }; |
| 116 | 125 |
| 117 | 126 |
| 118 } } // namespace v8::internal | 127 } } // namespace v8::internal |
| 119 | 128 |
| 120 #endif // V8_FAST_CODEGEN_H_ | 129 #endif // V8_FAST_CODEGEN_H_ |
| OLD | NEW |