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

Side by Side Diff: test/unittests/compiler/js-create-lowering-unittest.cc

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: updates Created 4 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/compiler/js-create-lowering.h" 5 #include "src/compiler/js-create-lowering.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/js-operator.h" 10 #include "src/compiler/js-operator.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 Context::MIN_CONTEXT_SLOTS)), 188 Context::MIN_CONTEXT_SLOTS)),
189 IsBeginRegion(_), control), 189 IsBeginRegion(_), control),
190 _)); 190 _));
191 } 191 }
192 192
193 // ----------------------------------------------------------------------------- 193 // -----------------------------------------------------------------------------
194 // JSCreateCatchContext 194 // JSCreateCatchContext
195 195
196 TEST_F(JSCreateLoweringTest, JSCreateCatchContext) { 196 TEST_F(JSCreateLoweringTest, JSCreateCatchContext) {
197 Handle<String> name = factory()->length_string(); 197 Handle<String> name = factory()->length_string();
198 Handle<ScopeInfo> scope_info(factory()->NewScopeInfo(1));
198 Node* const exception = Parameter(Type::Receiver()); 199 Node* const exception = Parameter(Type::Receiver());
199 Node* const closure = Parameter(Type::Function()); 200 Node* const closure = Parameter(Type::Function());
200 Node* const context = Parameter(Type::Any()); 201 Node* const context = Parameter(Type::Any());
201 Node* const effect = graph()->start(); 202 Node* const effect = graph()->start();
202 Node* const control = graph()->start(); 203 Node* const control = graph()->start();
203 Reduction r = 204 Reduction r = Reduce(
204 Reduce(graph()->NewNode(javascript()->CreateCatchContext(name), exception, 205 graph()->NewNode(javascript()->CreateCatchContext(name, scope_info),
205 closure, context, effect, control)); 206 exception, closure, context, effect, control));
206 ASSERT_TRUE(r.Changed()); 207 ASSERT_TRUE(r.Changed());
207 EXPECT_THAT(r.replacement(), 208 EXPECT_THAT(r.replacement(),
208 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( 209 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor(
209 Context::MIN_CONTEXT_SLOTS + 1)), 210 Context::MIN_CONTEXT_SLOTS + 1)),
210 IsBeginRegion(_), control), 211 IsBeginRegion(_), control),
211 _)); 212 _));
212 } 213 }
213 214
214 } // namespace compiler 215 } // namespace compiler
215 } // namespace internal 216 } // namespace internal
216 } // namespace v8 217 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698