| 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 5786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5797 ASSERT(current_block() != NULL); | 5797 ASSERT(current_block() != NULL); |
| 5798 ASSERT(current_block()->HasPredecessor()); | 5798 ASSERT(current_block()->HasPredecessor()); |
| 5799 HThisFunction* self = new(zone()) HThisFunction; | 5799 HThisFunction* self = new(zone()) HThisFunction; |
| 5800 return ast_context()->ReturnInstruction(self, expr->id()); | 5800 return ast_context()->ReturnInstruction(self, expr->id()); |
| 5801 } | 5801 } |
| 5802 | 5802 |
| 5803 | 5803 |
| 5804 void HGraphBuilder::VisitDeclaration(Declaration* decl) { | 5804 void HGraphBuilder::VisitDeclaration(Declaration* decl) { |
| 5805 // We support only declarations that do not require code generation. | 5805 // We support only declarations that do not require code generation. |
| 5806 Variable* var = decl->proxy()->var(); | 5806 Variable* var = decl->proxy()->var(); |
| 5807 if (!var->IsStackAllocated()) { | 5807 if (!var->IsStackAllocated() || decl->fun() != NULL) { |
| 5808 return Bailout("unsupported declaration"); | 5808 return Bailout("unsupported declaration"); |
| 5809 } | 5809 } |
| 5810 | 5810 |
| 5811 if (decl->mode() == Variable::CONST) { | 5811 if (decl->mode() == Variable::CONST) { |
| 5812 ASSERT(var->IsStackAllocated()); | 5812 ASSERT(var->IsStackAllocated()); |
| 5813 environment()->Bind(var, graph()->GetConstantHole()); | 5813 environment()->Bind(var, graph()->GetConstantHole()); |
| 5814 } else if (decl->fun() != NULL) { | |
| 5815 VisitForValue(decl->fun()); | |
| 5816 HValue* function = Pop(); | |
| 5817 environment()->Bind(var, function); | |
| 5818 } | 5814 } |
| 5819 } | 5815 } |
| 5820 | 5816 |
| 5821 | 5817 |
| 5822 // Generators for inline runtime functions. | 5818 // Generators for inline runtime functions. |
| 5823 // Support for types. | 5819 // Support for types. |
| 5824 void HGraphBuilder::GenerateIsSmi(CallRuntime* call) { | 5820 void HGraphBuilder::GenerateIsSmi(CallRuntime* call) { |
| 5825 ASSERT(call->arguments()->length() == 1); | 5821 ASSERT(call->arguments()->length() == 1); |
| 5826 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 5822 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 5827 HValue* value = Pop(); | 5823 HValue* value = Pop(); |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6744 } | 6740 } |
| 6745 } | 6741 } |
| 6746 | 6742 |
| 6747 #ifdef DEBUG | 6743 #ifdef DEBUG |
| 6748 if (graph_ != NULL) graph_->Verify(); | 6744 if (graph_ != NULL) graph_->Verify(); |
| 6749 if (allocator_ != NULL) allocator_->Verify(); | 6745 if (allocator_ != NULL) allocator_->Verify(); |
| 6750 #endif | 6746 #endif |
| 6751 } | 6747 } |
| 6752 | 6748 |
| 6753 } } // namespace v8::internal | 6749 } } // namespace v8::internal |
| OLD | NEW |