| 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 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 // not have declarations). | 2436 // not have declarations). |
| 2437 if (scope->arguments() != NULL) { | 2437 if (scope->arguments() != NULL) { |
| 2438 if (!scope->arguments()->IsStackAllocated()) { | 2438 if (!scope->arguments()->IsStackAllocated()) { |
| 2439 return Bailout("context-allocated arguments"); | 2439 return Bailout("context-allocated arguments"); |
| 2440 } | 2440 } |
| 2441 HArgumentsObject* object = new(zone()) HArgumentsObject; | 2441 HArgumentsObject* object = new(zone()) HArgumentsObject; |
| 2442 AddInstruction(object); | 2442 AddInstruction(object); |
| 2443 graph()->SetArgumentsObject(object); | 2443 graph()->SetArgumentsObject(object); |
| 2444 environment()->Bind(scope->arguments(), object); | 2444 environment()->Bind(scope->arguments(), object); |
| 2445 } | 2445 } |
| 2446 // Handle implicit declaration of the function name in named function |
| 2447 // expressions before other declarations. |
| 2448 if (scope->is_function_scope() && scope->function() != NULL) { |
| 2449 if (!scope->function()->IsStackAllocated()) { |
| 2450 return Bailout("unsupported declaration"); |
| 2451 } |
| 2452 environment()->Bind(scope->function(), graph()->GetConstantHole()); |
| 2453 } |
| 2446 } | 2454 } |
| 2447 | 2455 |
| 2448 | 2456 |
| 2449 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { | 2457 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { |
| 2450 for (int i = 0; i < statements->length(); i++) { | 2458 for (int i = 0; i < statements->length(); i++) { |
| 2451 CHECK_ALIVE(Visit(statements->at(i))); | 2459 CHECK_ALIVE(Visit(statements->at(i))); |
| 2452 } | 2460 } |
| 2453 } | 2461 } |
| 2454 | 2462 |
| 2455 | 2463 |
| (...skipping 4306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6762 } | 6770 } |
| 6763 } | 6771 } |
| 6764 | 6772 |
| 6765 #ifdef DEBUG | 6773 #ifdef DEBUG |
| 6766 if (graph_ != NULL) graph_->Verify(); | 6774 if (graph_ != NULL) graph_->Verify(); |
| 6767 if (allocator_ != NULL) allocator_->Verify(); | 6775 if (allocator_ != NULL) allocator_->Verify(); |
| 6768 #endif | 6776 #endif |
| 6769 } | 6777 } |
| 6770 | 6778 |
| 6771 } } // namespace v8::internal | 6779 } } // namespace v8::internal |
| OLD | NEW |