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

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

Issue 397010: A start on allowing non-local control flow, for exceptions, try-finally, and ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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/compiler.cc ('k') | src/jump-target.h » ('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 25 matching lines...) Expand all
36 namespace internal { 36 namespace internal {
37 37
38 38
39 class FastCodeGenerator: public AstVisitor { 39 class FastCodeGenerator: public AstVisitor {
40 public: 40 public:
41 FastCodeGenerator(MacroAssembler* masm, Handle<Script> script, bool is_eval) 41 FastCodeGenerator(MacroAssembler* masm, Handle<Script> script, bool is_eval)
42 : masm_(masm), 42 : masm_(masm),
43 function_(NULL), 43 function_(NULL),
44 script_(script), 44 script_(script),
45 is_eval_(is_eval), 45 is_eval_(is_eval),
46 function_return_(),
47 return_label_(NULL),
46 loop_depth_(0), 48 loop_depth_(0),
47 true_label_(NULL), 49 true_label_(NULL),
48 false_label_(NULL) { 50 false_label_(NULL) {
49 } 51 }
50 52
51 static Handle<Code> MakeCode(FunctionLiteral* fun, 53 static Handle<Code> MakeCode(FunctionLiteral* fun,
52 Handle<Script> script, 54 Handle<Script> script,
53 bool is_eval); 55 bool is_eval);
54 56
55 void Generate(FunctionLiteral* fun); 57 void Generate(FunctionLiteral* fun);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 AST_NODE_LIST(DECLARE_VISIT) 112 AST_NODE_LIST(DECLARE_VISIT)
111 #undef DECLARE_VISIT 113 #undef DECLARE_VISIT
112 114
113 // Handles the shortcutted logical binary operations in VisitBinaryOperation. 115 // Handles the shortcutted logical binary operations in VisitBinaryOperation.
114 void EmitLogicalOperation(BinaryOperation* expr); 116 void EmitLogicalOperation(BinaryOperation* expr);
115 117
116 MacroAssembler* masm_; 118 MacroAssembler* masm_;
117 FunctionLiteral* function_; 119 FunctionLiteral* function_;
118 Handle<Script> script_; 120 Handle<Script> script_;
119 bool is_eval_; 121 bool is_eval_;
120 Label return_label_; 122 Label function_return_;// Label of the actual return sequence.
123 Label* return_label_; // Label to jump to from a return statement.
124 // If there are finally blocks from try..finally that must be executed,
125 // this is the entry point of a finally block, shadowing the real return.
126 int return_stack_height_; // The height of the stack at return_label_.
127 int scope_stack_height_; // The number of elements above the frame pointer
128 // that are on the stack due to enclosing scopes. Does not include the
129 // expression stack, but does include elements pushed by with and for..in.
121 int loop_depth_; 130 int loop_depth_;
122 131
123 Label* true_label_; 132 Label* true_label_;
124 Label* false_label_; 133 Label* false_label_;
125 134
126 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); 135 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator);
127 }; 136 };
128 137
129 138
130 } } // namespace v8::internal 139 } } // namespace v8::internal
131 140
132 #endif // V8_FAST_CODEGEN_H_ 141 #endif // V8_FAST_CODEGEN_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/jump-target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698