OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2228 | 2228 |
2229 // Set the initial values of stack-allocated locals. | 2229 // Set the initial values of stack-allocated locals. |
2230 for (int i = count; i < environment()->length(); ++i) { | 2230 for (int i = count; i < environment()->length(); ++i) { |
2231 environment()->Bind(i, undefined_constant); | 2231 environment()->Bind(i, undefined_constant); |
2232 } | 2232 } |
2233 | 2233 |
2234 // Handle the arguments and arguments shadow variables specially (they do | 2234 // Handle the arguments and arguments shadow variables specially (they do |
2235 // not have declarations). | 2235 // not have declarations). |
2236 if (scope->arguments() != NULL) { | 2236 if (scope->arguments() != NULL) { |
2237 if (!scope->arguments()->IsStackAllocated() || | 2237 if (!scope->arguments()->IsStackAllocated() || |
2238 scope->arguments_shadow() != NULL && | |
Kevin Millikin (Chromium)
2011/03/07 11:46:48
Parens around the && please.
Martin Maly
2011/03/07 19:09:40
Done.
| |
2238 !scope->arguments_shadow()->IsStackAllocated()) { | 2239 !scope->arguments_shadow()->IsStackAllocated()) { |
2239 BAILOUT("context-allocated arguments"); | 2240 BAILOUT("context-allocated arguments"); |
2240 } | 2241 } |
2241 HArgumentsObject* object = new HArgumentsObject; | 2242 HArgumentsObject* object = new HArgumentsObject; |
2242 AddInstruction(object); | 2243 AddInstruction(object); |
2243 graph()->SetArgumentsObject(object); | 2244 graph()->SetArgumentsObject(object); |
2244 environment()->Bind(scope->arguments(), object); | 2245 environment()->Bind(scope->arguments(), object); |
2245 environment()->Bind(scope->arguments_shadow(), object); | 2246 if (scope->arguments_shadow() != NULL) { |
2247 environment()->Bind(scope->arguments_shadow(), object); | |
2248 } | |
2246 } | 2249 } |
2247 } | 2250 } |
2248 | 2251 |
2249 | 2252 |
2250 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { | 2253 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { |
2251 for (int i = 0; i < statements->length(); i++) { | 2254 for (int i = 0; i < statements->length(); i++) { |
2252 Visit(statements->at(i)); | 2255 Visit(statements->at(i)); |
2253 if (HasStackOverflow() || current_block() == NULL) break; | 2256 if (HasStackOverflow() || current_block() == NULL) break; |
2254 } | 2257 } |
2255 } | 2258 } |
(...skipping 3750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6006 } | 6009 } |
6007 } | 6010 } |
6008 | 6011 |
6009 #ifdef DEBUG | 6012 #ifdef DEBUG |
6010 if (graph_ != NULL) graph_->Verify(); | 6013 if (graph_ != NULL) graph_->Verify(); |
6011 if (allocator_ != NULL) allocator_->Verify(); | 6014 if (allocator_ != NULL) allocator_->Verify(); |
6012 #endif | 6015 #endif |
6013 } | 6016 } |
6014 | 6017 |
6015 } } // namespace v8::internal | 6018 } } // namespace v8::internal |
OLD | NEW |