Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: src/fast-codegen.h

Issue 550010: Cleanup the handling of control flow in the toplevel code generator.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/fast-codegen-arm.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/arm/fast-codegen-arm.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698