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 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2326 | 2326 |
2327 // Handle implicit declaration of the function name in named function | 2327 // Handle implicit declaration of the function name in named function |
2328 // expressions before other declarations. | 2328 // expressions before other declarations. |
2329 if (scope->is_function_scope() && scope->function() != NULL) { | 2329 if (scope->is_function_scope() && scope->function() != NULL) { |
2330 HandleDeclaration(scope->function(), CONST, NULL); | 2330 HandleDeclaration(scope->function(), CONST, NULL); |
2331 } | 2331 } |
2332 VisitDeclarations(scope->declarations()); | 2332 VisitDeclarations(scope->declarations()); |
2333 AddSimulate(AstNode::kDeclarationsId); | 2333 AddSimulate(AstNode::kDeclarationsId); |
2334 | 2334 |
2335 HValue* context = environment()->LookupContext(); | 2335 HValue* context = environment()->LookupContext(); |
2336 AddInstruction( | 2336 AddInstruction(new(zone()) HStackCheck(context)); |
2337 new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry)); | |
2338 | 2337 |
2339 VisitStatements(info()->function()->body()); | 2338 VisitStatements(info()->function()->body()); |
2340 if (HasStackOverflow()) return NULL; | 2339 if (HasStackOverflow()) return NULL; |
2341 | 2340 |
2342 if (current_block() != NULL) { | 2341 if (current_block() != NULL) { |
2343 HReturn* instr = new(zone()) HReturn(graph()->GetConstantUndefined()); | 2342 HReturn* instr = new(zone()) HReturn(graph()->GetConstantUndefined()); |
2344 current_block()->FinishExit(instr); | 2343 current_block()->FinishExit(instr); |
2345 set_current_block(NULL); | 2344 set_current_block(NULL); |
2346 } | 2345 } |
2347 } | 2346 } |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 set_current_block(loop_predecessor); | 2914 set_current_block(loop_predecessor); |
2916 } | 2915 } |
2917 | 2916 |
2918 | 2917 |
2919 void HGraphBuilder::VisitLoopBody(IterationStatement* stmt, | 2918 void HGraphBuilder::VisitLoopBody(IterationStatement* stmt, |
2920 HBasicBlock* loop_entry, | 2919 HBasicBlock* loop_entry, |
2921 BreakAndContinueInfo* break_info) { | 2920 BreakAndContinueInfo* break_info) { |
2922 BreakAndContinueScope push(break_info, this); | 2921 BreakAndContinueScope push(break_info, this); |
2923 AddSimulate(stmt->StackCheckId()); | 2922 AddSimulate(stmt->StackCheckId()); |
2924 HValue* context = environment()->LookupContext(); | 2923 HValue* context = environment()->LookupContext(); |
2925 HStackCheck* stack_check = | 2924 HStackCheck* stack_check = new(zone()) HStackCheck(context); |
2926 new(zone()) HStackCheck(context, HStackCheck::kBackwardsBranch); | |
2927 AddInstruction(stack_check); | 2925 AddInstruction(stack_check); |
2928 ASSERT(loop_entry->IsLoopHeader()); | 2926 ASSERT(loop_entry->IsLoopHeader()); |
2929 loop_entry->loop_information()->set_stack_check(stack_check); | 2927 loop_entry->loop_information()->set_stack_check(stack_check); |
2930 CHECK_BAILOUT(Visit(stmt->body())); | 2928 CHECK_BAILOUT(Visit(stmt->body())); |
2931 } | 2929 } |
2932 | 2930 |
2933 | 2931 |
2934 void HGraphBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) { | 2932 void HGraphBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) { |
2935 ASSERT(!HasStackOverflow()); | 2933 ASSERT(!HasStackOverflow()); |
2936 ASSERT(current_block() != NULL); | 2934 ASSERT(current_block() != NULL); |
(...skipping 4287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7224 } | 7222 } |
7225 } | 7223 } |
7226 | 7224 |
7227 #ifdef DEBUG | 7225 #ifdef DEBUG |
7228 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 7226 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
7229 if (allocator_ != NULL) allocator_->Verify(); | 7227 if (allocator_ != NULL) allocator_->Verify(); |
7230 #endif | 7228 #endif |
7231 } | 7229 } |
7232 | 7230 |
7233 } } // namespace v8::internal | 7231 } } // namespace v8::internal |
OLD | NEW |