OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #elif V8_TARGET_ARCH_MIPS | 42 #elif V8_TARGET_ARCH_MIPS |
43 #include "mips/codegen-mips-inl.h" | 43 #include "mips/codegen-mips-inl.h" |
44 #else | 44 #else |
45 #error Unsupported target architecture. | 45 #error Unsupported target architecture. |
46 #endif | 46 #endif |
47 | 47 |
48 | 48 |
49 namespace v8 { | 49 namespace v8 { |
50 namespace internal { | 50 namespace internal { |
51 | 51 |
52 #define __ ACCESS_MASM(masm_) | |
53 | |
54 Handle<Script> CodeGenerator::script() { return info_->script(); } | 52 Handle<Script> CodeGenerator::script() { return info_->script(); } |
55 bool CodeGenerator::is_eval() { return info_->is_eval(); } | 53 bool CodeGenerator::is_eval() { return info_->is_eval(); } |
56 | 54 |
57 | |
58 // ----------------------------------------------------------------------------- | |
59 // Support for "structured" code comments. | |
60 // | |
61 // By selecting matching brackets in disassembler output, | |
62 // code segments can be identified more easily. | |
63 | |
64 #ifdef DEBUG | |
65 | |
66 class Comment BASE_EMBEDDED { | |
67 public: | |
68 Comment(MacroAssembler* masm, const char* msg) : masm_(masm), msg_(msg) { | |
69 __ RecordComment(msg); | |
70 } | |
71 | |
72 ~Comment() { | |
73 if (msg_[0] == '[') __ RecordComment("]"); | |
74 } | |
75 | |
76 private: | |
77 MacroAssembler* masm_; | |
78 const char* msg_; | |
79 }; | |
80 | |
81 #else | |
82 | |
83 class Comment BASE_EMBEDDED { | |
84 public: | |
85 Comment(MacroAssembler*, const char*) {} | |
86 }; | |
87 | |
88 #endif // DEBUG | |
89 | |
90 #undef __ | |
91 | |
92 | |
93 } } // namespace v8::internal | 55 } } // namespace v8::internal |
94 | 56 |
95 #endif // V8_CODEGEN_INL_H_ | 57 #endif // V8_CODEGEN_INL_H_ |
OLD | NEW |