OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 // Return an operand used to read/write to a known (ie, non-LOOKUP) slot. | 235 // Return an operand used to read/write to a known (ie, non-LOOKUP) slot. |
236 // May emit code to traverse the context chain, destroying the scratch | 236 // May emit code to traverse the context chain, destroying the scratch |
237 // register. | 237 // register. |
238 MemOperand EmitSlotSearch(Slot* slot, Register scratch); | 238 MemOperand EmitSlotSearch(Slot* slot, Register scratch); |
239 | 239 |
240 // Test the JavaScript value in source as if in a test context, compile | 240 // Test the JavaScript value in source as if in a test context, compile |
241 // control flow to a pair of labels. | 241 // control flow to a pair of labels. |
242 void TestAndBranch(Register source, Label* true_label, Label* false_label); | 242 void TestAndBranch(Register source, Label* true_label, Label* false_label); |
243 | 243 |
| 244 void VisitForControl(Expression* expr, Label* if_true, Label* if_false) { |
| 245 ASSERT(expr->context() == Expression::kTest || |
| 246 expr->context() == Expression::kValueTest || |
| 247 expr->context() == Expression::kTestValue); |
| 248 Label* saved_true = true_label_; |
| 249 Label* saved_false = false_label_; |
| 250 true_label_ = if_true; |
| 251 false_label_ = if_false; |
| 252 Visit(expr); |
| 253 true_label_ = saved_true; |
| 254 false_label_ = saved_false; |
| 255 } |
| 256 |
244 void VisitDeclarations(ZoneList<Declaration*>* declarations); | 257 void VisitDeclarations(ZoneList<Declaration*>* declarations); |
245 void DeclareGlobals(Handle<FixedArray> pairs); | 258 void DeclareGlobals(Handle<FixedArray> pairs); |
246 | 259 |
247 // Platform-specific return sequence | 260 // Platform-specific return sequence |
248 void EmitReturnSequence(int position); | 261 void EmitReturnSequence(int position); |
249 | 262 |
250 // Platform-specific code sequences for calls | 263 // Platform-specific code sequences for calls |
251 void EmitCallWithStub(Call* expr); | 264 void EmitCallWithStub(Call* expr); |
252 void EmitCallWithIC(Call* expr, Handle<Object> name, RelocInfo::Mode mode); | 265 void EmitCallWithIC(Call* expr, Handle<Object> name, RelocInfo::Mode mode); |
253 | 266 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 342 |
330 friend class NestedStatement; | 343 friend class NestedStatement; |
331 | 344 |
332 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); | 345 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); |
333 }; | 346 }; |
334 | 347 |
335 | 348 |
336 } } // namespace v8::internal | 349 } } // namespace v8::internal |
337 | 350 |
338 #endif // V8_FAST_CODEGEN_H_ | 351 #endif // V8_FAST_CODEGEN_H_ |
OLD | NEW |