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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // To avoid storing to .result all the time, we eliminate some of | 58 // To avoid storing to .result all the time, we eliminate some of |
59 // the stores by keeping track of whether or not we're sure .result | 59 // the stores by keeping track of whether or not we're sure .result |
60 // will be overwritten anyway. This is a bit more tricky than what I | 60 // will be overwritten anyway. This is a bit more tricky than what I |
61 // was hoping for | 61 // was hoping for |
62 bool is_set_; | 62 bool is_set_; |
63 bool in_try_; | 63 bool in_try_; |
64 | 64 |
65 Expression* SetResult(Expression* value) { | 65 Expression* SetResult(Expression* value) { |
66 result_assigned_ = true; | 66 result_assigned_ = true; |
67 return new Assignment(Token::ASSIGN, result_, value, kNoPosition); | 67 return new Assignment(Token::ASSIGN, result_, value, |
| 68 RelocInfo::kNoPosition); |
68 } | 69 } |
69 | 70 |
70 // Node visitors. | 71 // Node visitors. |
71 #define DEF_VISIT(type) \ | 72 #define DEF_VISIT(type) \ |
72 virtual void Visit##type(type* node); | 73 virtual void Visit##type(type* node); |
73 NODE_LIST(DEF_VISIT) | 74 NODE_LIST(DEF_VISIT) |
74 #undef DEF_VISIT | 75 #undef DEF_VISIT |
75 }; | 76 }; |
76 | 77 |
77 | 78 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 Processor processor(result); | 320 Processor processor(result); |
320 processor.Process(body); | 321 processor.Process(body); |
321 if (processor.HasStackOverflow()) return false; | 322 if (processor.HasStackOverflow()) return false; |
322 | 323 |
323 if (processor.result_assigned()) body->Add(new ReturnStatement(result)); | 324 if (processor.result_assigned()) body->Add(new ReturnStatement(result)); |
324 return true; | 325 return true; |
325 } | 326 } |
326 | 327 |
327 | 328 |
328 } } // namespace v8::internal | 329 } } // namespace v8::internal |
OLD | NEW |