| 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 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2287 } | 2287 } |
| 2288 | 2288 |
| 2289 // Set the initial values of stack-allocated locals. | 2289 // Set the initial values of stack-allocated locals. |
| 2290 for (int i = count; i < environment()->length(); ++i) { | 2290 for (int i = count; i < environment()->length(); ++i) { |
| 2291 environment()->Bind(i, undefined_constant); | 2291 environment()->Bind(i, undefined_constant); |
| 2292 } | 2292 } |
| 2293 | 2293 |
| 2294 // Handle the arguments and arguments shadow variables specially (they do | 2294 // Handle the arguments and arguments shadow variables specially (they do |
| 2295 // not have declarations). | 2295 // not have declarations). |
| 2296 if (scope->arguments() != NULL) { | 2296 if (scope->arguments() != NULL) { |
| 2297 if (!scope->arguments()->IsStackAllocated() || | 2297 if (!scope->arguments()->IsStackAllocated()) { |
| 2298 (scope->arguments_shadow() != NULL && | |
| 2299 !scope->arguments_shadow()->IsStackAllocated())) { | |
| 2300 BAILOUT("context-allocated arguments"); | 2298 BAILOUT("context-allocated arguments"); |
| 2301 } | 2299 } |
| 2302 HArgumentsObject* object = new HArgumentsObject; | 2300 HArgumentsObject* object = new HArgumentsObject; |
| 2303 AddInstruction(object); | 2301 AddInstruction(object); |
| 2304 graph()->SetArgumentsObject(object); | 2302 graph()->SetArgumentsObject(object); |
| 2305 environment()->Bind(scope->arguments(), object); | 2303 environment()->Bind(scope->arguments(), object); |
| 2306 if (scope->arguments_shadow() != NULL) { | |
| 2307 environment()->Bind(scope->arguments_shadow(), object); | |
| 2308 } | |
| 2309 } | 2304 } |
| 2310 } | 2305 } |
| 2311 | 2306 |
| 2312 | 2307 |
| 2313 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { | 2308 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { |
| 2314 for (int i = 0; i < statements->length(); i++) { | 2309 for (int i = 0; i < statements->length(); i++) { |
| 2315 Visit(statements->at(i)); | 2310 Visit(statements->at(i)); |
| 2316 if (HasStackOverflow() || current_block() == NULL) break; | 2311 if (HasStackOverflow() || current_block() == NULL) break; |
| 2317 } | 2312 } |
| 2318 } | 2313 } |
| (...skipping 3627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5946 } | 5941 } |
| 5947 } | 5942 } |
| 5948 | 5943 |
| 5949 #ifdef DEBUG | 5944 #ifdef DEBUG |
| 5950 if (graph_ != NULL) graph_->Verify(); | 5945 if (graph_ != NULL) graph_->Verify(); |
| 5951 if (allocator_ != NULL) allocator_->Verify(); | 5946 if (allocator_ != NULL) allocator_->Verify(); |
| 5952 #endif | 5947 #endif |
| 5953 } | 5948 } |
| 5954 | 5949 |
| 5955 } } // namespace v8::internal | 5950 } } // namespace v8::internal |
| OLD | NEW |