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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Reference(CodeGenerator* cgen, Expression* expression); | 110 Reference(CodeGenerator* cgen, Expression* expression); |
111 ~Reference(); | 111 ~Reference(); |
112 | 112 |
113 Expression* expression() const { return expression_; } | 113 Expression* expression() const { return expression_; } |
114 Type type() const { return type_; } | 114 Type type() const { return type_; } |
115 void set_type(Type value) { | 115 void set_type(Type value) { |
116 ASSERT(type_ == ILLEGAL); | 116 ASSERT(type_ == ILLEGAL); |
117 type_ = value; | 117 type_ = value; |
118 } | 118 } |
119 | 119 |
120 // The size of the reference or -1 if the reference is illegal. | 120 // The size the reference takes up on the stack. |
121 int size() const { return type_; } | 121 int size() const { return (type_ == ILLEGAL) ? 0 : type_; } |
122 | 122 |
123 bool is_illegal() const { return type_ == ILLEGAL; } | 123 bool is_illegal() const { return type_ == ILLEGAL; } |
124 bool is_slot() const { return type_ == SLOT; } | 124 bool is_slot() const { return type_ == SLOT; } |
125 bool is_property() const { return type_ == NAMED || type_ == KEYED; } | 125 bool is_property() const { return type_ == NAMED || type_ == KEYED; } |
126 | 126 |
127 // Return the name. Only valid for named property references. | 127 // Return the name. Only valid for named property references. |
128 Handle<String> GetName(); | 128 Handle<String> GetName(); |
129 | 129 |
130 // Generate code to push the value of the reference on top of the | 130 // Generate code to push the value of the reference on top of the |
131 // expression stack. The reference is expected to be already on top of | 131 // expression stack. The reference is expected to be already on top of |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 friend class VirtualFrame; | 401 friend class VirtualFrame; |
402 friend class Reference; | 402 friend class Reference; |
403 | 403 |
404 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 404 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
405 }; | 405 }; |
406 | 406 |
407 } } // namespace v8::internal | 407 } } // namespace v8::internal |
408 | 408 |
409 #endif // V8_CODEGEN_ARM_H_ | 409 #endif // V8_CODEGEN_ARM_H_ |
OLD | NEW |