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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 RegisterAllocator* allocator() const { return allocator_; } | 179 RegisterAllocator* allocator() const { return allocator_; } |
180 | 180 |
181 CodeGenState* state() { return state_; } | 181 CodeGenState* state() { return state_; } |
182 void set_state(CodeGenState* state) { state_ = state; } | 182 void set_state(CodeGenState* state) { state_ = state; } |
183 | 183 |
184 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } | 184 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } |
185 | 185 |
186 bool in_spilled_code() const { return in_spilled_code_; } | 186 bool in_spilled_code() const { return in_spilled_code_; } |
187 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } | 187 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } |
188 | 188 |
| 189 static const int kUnknownIntValue = -1; |
| 190 |
189 private: | 191 private: |
190 // Construction/Destruction | 192 // Construction/Destruction |
191 CodeGenerator(int buffer_size, Handle<Script> script, bool is_eval); | 193 CodeGenerator(int buffer_size, Handle<Script> script, bool is_eval); |
192 virtual ~CodeGenerator() { delete masm_; } | 194 virtual ~CodeGenerator() { delete masm_; } |
193 | 195 |
194 // Accessors | 196 // Accessors |
195 Scope* scope() const { return scope_; } | 197 Scope* scope() const { return scope_; } |
196 | 198 |
197 // Generating deferred code. | 199 // Generating deferred code. |
198 void ProcessDeferred(); | 200 void ProcessDeferred(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // Special code for typeof expressions: Unfortunately, we must | 286 // Special code for typeof expressions: Unfortunately, we must |
285 // be careful when loading the expression in 'typeof' | 287 // be careful when loading the expression in 'typeof' |
286 // expressions. We are not allowed to throw reference errors for | 288 // expressions. We are not allowed to throw reference errors for |
287 // non-existing properties of the global object, so we must make it | 289 // non-existing properties of the global object, so we must make it |
288 // look like an explicit property access, instead of an access | 290 // look like an explicit property access, instead of an access |
289 // through the context chain. | 291 // through the context chain. |
290 void LoadTypeofExpression(Expression* x); | 292 void LoadTypeofExpression(Expression* x); |
291 | 293 |
292 void ToBoolean(JumpTarget* true_target, JumpTarget* false_target); | 294 void ToBoolean(JumpTarget* true_target, JumpTarget* false_target); |
293 | 295 |
294 void GenericBinaryOperation(Token::Value op, OverwriteMode overwrite_mode); | 296 void GenericBinaryOperation(Token::Value op, |
| 297 OverwriteMode overwrite_mode, |
| 298 int known_rhs = kUnknownIntValue); |
295 void Comparison(Condition cc, | 299 void Comparison(Condition cc, |
296 Expression* left, | 300 Expression* left, |
297 Expression* right, | 301 Expression* right, |
298 bool strict = false); | 302 bool strict = false); |
299 | 303 |
300 void SmiOperation(Token::Value op, | 304 void SmiOperation(Token::Value op, |
301 Handle<Object> value, | 305 Handle<Object> value, |
302 bool reversed, | 306 bool reversed, |
303 OverwriteMode mode); | 307 OverwriteMode mode); |
304 | 308 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 friend class JumpTarget; | 417 friend class JumpTarget; |
414 friend class Reference; | 418 friend class Reference; |
415 | 419 |
416 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 420 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
417 }; | 421 }; |
418 | 422 |
419 | 423 |
420 } } // namespace v8::internal | 424 } } // namespace v8::internal |
421 | 425 |
422 #endif // V8_ARM_CODEGEN_ARM_H_ | 426 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |