Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: src/parser.cc

Issue 1312613003: Ensure hole checks take place in switch statement scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename function and add sloppy mode tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/scopes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after
3003 Assignment* tag_assign = factory()->NewAssignment( 3003 Assignment* tag_assign = factory()->NewAssignment(
3004 Token::ASSIGN, factory()->NewVariableProxy(tag_variable), tag, 3004 Token::ASSIGN, factory()->NewVariableProxy(tag_variable), tag,
3005 tag->position()); 3005 tag->position());
3006 Statement* tag_statement = 3006 Statement* tag_statement =
3007 factory()->NewExpressionStatement(tag_assign, RelocInfo::kNoPosition); 3007 factory()->NewExpressionStatement(tag_assign, RelocInfo::kNoPosition);
3008 switch_block->AddStatement(tag_statement, zone()); 3008 switch_block->AddStatement(tag_statement, zone());
3009 3009
3010 Block* cases_block = 3010 Block* cases_block =
3011 factory()->NewBlock(NULL, 1, true, RelocInfo::kNoPosition); 3011 factory()->NewBlock(NULL, 1, true, RelocInfo::kNoPosition);
3012 Scope* cases_scope = NewScope(scope_, BLOCK_SCOPE); 3012 Scope* cases_scope = NewScope(scope_, BLOCK_SCOPE);
3013 cases_scope->SetNonlinear();
3013 3014
3014 SwitchStatement* switch_statement = 3015 SwitchStatement* switch_statement =
3015 factory()->NewSwitchStatement(labels, switch_pos); 3016 factory()->NewSwitchStatement(labels, switch_pos);
3016 3017
3017 cases_scope->set_start_position(scanner()->location().beg_pos); 3018 cases_scope->set_start_position(scanner()->location().beg_pos);
3018 { 3019 {
3019 BlockState cases_block_state(&scope_, cases_scope); 3020 BlockState cases_block_state(&scope_, cases_scope);
3020 Target target(&this->target_stack_, switch_statement); 3021 Target target(&this->target_stack_, switch_statement);
3021 3022
3022 Expression* tag_read = factory()->NewVariableProxy(tag_variable); 3023 Expression* tag_read = factory()->NewVariableProxy(tag_variable);
(...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after
6106 6107
6107 Expression* Parser::SpreadCallNew(Expression* function, 6108 Expression* Parser::SpreadCallNew(Expression* function,
6108 ZoneList<v8::internal::Expression*>* args, 6109 ZoneList<v8::internal::Expression*>* args,
6109 int pos) { 6110 int pos) {
6110 args->InsertAt(0, function, zone()); 6111 args->InsertAt(0, function, zone());
6111 6112
6112 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); 6113 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos);
6113 } 6114 }
6114 } // namespace internal 6115 } // namespace internal
6115 } // namespace v8 6116 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698