| 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 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 // not have declarations). | 2444 // not have declarations). |
| 2445 if (scope->arguments() != NULL) { | 2445 if (scope->arguments() != NULL) { |
| 2446 if (!scope->arguments()->IsStackAllocated()) { | 2446 if (!scope->arguments()->IsStackAllocated()) { |
| 2447 return Bailout("context-allocated arguments"); | 2447 return Bailout("context-allocated arguments"); |
| 2448 } | 2448 } |
| 2449 HArgumentsObject* object = new(zone()) HArgumentsObject; | 2449 HArgumentsObject* object = new(zone()) HArgumentsObject; |
| 2450 AddInstruction(object); | 2450 AddInstruction(object); |
| 2451 graph()->SetArgumentsObject(object); | 2451 graph()->SetArgumentsObject(object); |
| 2452 environment()->Bind(scope->arguments(), object); | 2452 environment()->Bind(scope->arguments(), object); |
| 2453 } | 2453 } |
| 2454 // Handle implicit declaration of the function name in named function |
| 2455 // expressions before other declarations. |
| 2456 if (scope->is_function_scope() && scope->function() != NULL) { |
| 2457 if (!scope->function()->IsStackAllocated()) { |
| 2458 return Bailout("unsupported declaration"); |
| 2459 } |
| 2460 environment()->Bind(scope->function(), graph()->GetConstantHole()); |
| 2461 } |
| 2454 } | 2462 } |
| 2455 | 2463 |
| 2456 | 2464 |
| 2457 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { | 2465 void HGraphBuilder::VisitStatements(ZoneList<Statement*>* statements) { |
| 2458 for (int i = 0; i < statements->length(); i++) { | 2466 for (int i = 0; i < statements->length(); i++) { |
| 2459 CHECK_ALIVE(Visit(statements->at(i))); | 2467 CHECK_ALIVE(Visit(statements->at(i))); |
| 2460 } | 2468 } |
| 2461 } | 2469 } |
| 2462 | 2470 |
| 2463 | 2471 |
| (...skipping 4285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6749 } | 6757 } |
| 6750 } | 6758 } |
| 6751 | 6759 |
| 6752 #ifdef DEBUG | 6760 #ifdef DEBUG |
| 6753 if (graph_ != NULL) graph_->Verify(); | 6761 if (graph_ != NULL) graph_->Verify(); |
| 6754 if (allocator_ != NULL) allocator_->Verify(); | 6762 if (allocator_ != NULL) allocator_->Verify(); |
| 6755 #endif | 6763 #endif |
| 6756 } | 6764 } |
| 6757 | 6765 |
| 6758 } } // namespace v8::internal | 6766 } } // namespace v8::internal |
| OLD | NEW |