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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 Reference(CodeGenerator* cgen, Expression* expression); | 114 Reference(CodeGenerator* cgen, Expression* expression); |
115 ~Reference(); | 115 ~Reference(); |
116 | 116 |
117 Expression* expression() const { return expression_; } | 117 Expression* expression() const { return expression_; } |
118 Type type() const { return type_; } | 118 Type type() const { return type_; } |
119 void set_type(Type value) { | 119 void set_type(Type value) { |
120 ASSERT(type_ == ILLEGAL); | 120 ASSERT(type_ == ILLEGAL); |
121 type_ = value; | 121 type_ = value; |
122 } | 122 } |
123 | 123 |
124 // The size of the reference or -1 if the reference is illegal. | 124 // The size the reference takes up on the stack. |
125 int size() const { return type_; } | 125 int size() const { return (type_ == ILLEGAL) ? 0 : type_; } |
126 | 126 |
127 bool is_illegal() const { return type_ == ILLEGAL; } | 127 bool is_illegal() const { return type_ == ILLEGAL; } |
128 bool is_slot() const { return type_ == SLOT; } | 128 bool is_slot() const { return type_ == SLOT; } |
129 bool is_property() const { return type_ == NAMED || type_ == KEYED; } | 129 bool is_property() const { return type_ == NAMED || type_ == KEYED; } |
130 | 130 |
131 // Return the name. Only valid for named property references. | 131 // Return the name. Only valid for named property references. |
132 Handle<String> GetName(); | 132 Handle<String> GetName(); |
133 | 133 |
134 // Generate code to push the value of the reference on top of the | 134 // Generate code to push the value of the reference on top of the |
135 // expression stack. The reference is expected to be already on top of | 135 // expression stack. The reference is expected to be already on top of |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 friend class VirtualFrame; | 427 friend class VirtualFrame; |
428 friend class Reference; | 428 friend class Reference; |
429 | 429 |
430 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 430 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
431 }; | 431 }; |
432 | 432 |
433 | 433 |
434 } } // namespace v8::internal | 434 } } // namespace v8::internal |
435 | 435 |
436 #endif // V8_CODEGEN_IA32_H_ | 436 #endif // V8_CODEGEN_IA32_H_ |
OLD | NEW |