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

Side by Side Diff: test/cctest/compiler/test-codegen-deopt.cc

Issue 563123004: Unify use-sites of EnsureDeoptimizationSupport. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Decomplicatification (aka. simplify). Created 6 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/compiler/function-tester.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/compiler/code-generator.h" 8 #include "src/compiler/code-generator.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 30 matching lines...) Expand all
41 public: 41 public:
42 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src) 42 explicit DeoptCodegenTester(HandleAndZoneScope* scope, const char* src)
43 : scope_(scope), 43 : scope_(scope),
44 function(NewFunction(src)), 44 function(NewFunction(src)),
45 info(function, scope->main_zone()), 45 info(function, scope->main_zone()),
46 bailout_id(-1) { 46 bailout_id(-1) {
47 CHECK(Parser::Parse(&info)); 47 CHECK(Parser::Parse(&info));
48 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); 48 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
49 CHECK(Rewriter::Rewrite(&info)); 49 CHECK(Rewriter::Rewrite(&info));
50 CHECK(Scope::Analyze(&info)); 50 CHECK(Scope::Analyze(&info));
51 CHECK_NE(NULL, info.scope()); 51 CHECK(Compiler::EnsureDeoptimizationSupport(&info));
52 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(), info.zone());
53 info.shared_info()->set_scope_info(*scope_info);
54
55 FunctionTester::EnsureDeoptimizationSupport(&info);
56 52
57 DCHECK(info.shared_info()->has_deoptimization_support()); 53 DCHECK(info.shared_info()->has_deoptimization_support());
58 54
59 graph = new (scope_->main_zone()) Graph(scope_->main_zone()); 55 graph = new (scope_->main_zone()) Graph(scope_->main_zone());
60 } 56 }
61 57
62 virtual ~DeoptCodegenTester() { delete code; } 58 virtual ~DeoptCodegenTester() { delete code; }
63 59
64 void GenerateCodeFromSchedule(Schedule* schedule) { 60 void GenerateCodeFromSchedule(Schedule* schedule) {
65 OFStream os(stdout); 61 OFStream os(stdout);
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 Handle<Object> result; 304 Handle<Object> result;
309 bool has_pending_exception = 305 bool has_pending_exception =
310 !Execution::Call(isolate, t.function, 306 !Execution::Call(isolate, t.function,
311 isolate->factory()->undefined_value(), 0, NULL, 307 isolate->factory()->undefined_value(), 0, NULL,
312 false).ToHandle(&result); 308 false).ToHandle(&result);
313 CHECK(!has_pending_exception); 309 CHECK(!has_pending_exception);
314 CHECK(result->SameValue(Smi::FromInt(42))); 310 CHECK(result->SameValue(Smi::FromInt(42)));
315 } 311 }
316 312
317 #endif 313 #endif
OLDNEW
« no previous file with comments | « test/cctest/compiler/function-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698