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

Side by Side Diff: test/cctest/test-deoptimization.cc

Issue 453363003: Revert "Initial shot at deoptimizing JSCallFunction in Turbofan." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/test-scheduler.cc ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj, 107 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj,
108 const char* property_name) { 108 const char* property_name) {
109 v8::Local<v8::Function> fun = 109 v8::Local<v8::Function> fun =
110 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name))); 110 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name)));
111 return v8::Utils::OpenHandle(*fun); 111 return v8::Utils::OpenHandle(*fun);
112 } 112 }
113 113
114 114
115 TEST(DeoptimizeSimple) { 115 TEST(DeoptimizeSimple) {
116 i::FLAG_turbo_deoptimization = true;
117
118 LocalContext env; 116 LocalContext env;
119 v8::HandleScope scope(env->GetIsolate()); 117 v8::HandleScope scope(env->GetIsolate());
120 118
121 // Test lazy deoptimization of a simple function. 119 // Test lazy deoptimization of a simple function.
122 { 120 {
123 AlwaysOptimizeAllowNativesSyntaxNoInlining options; 121 AlwaysOptimizeAllowNativesSyntaxNoInlining options;
124 CompileRun( 122 CompileRun(
125 "var count = 0;" 123 "var count = 0;"
126 "function h() { %DeoptimizeFunction(f); }" 124 "function h() { %DeoptimizeFunction(f); }"
127 "function g() { count++; h(); }" 125 "function g() { count++; h(); }"
(...skipping 18 matching lines...) Expand all
146 } 144 }
147 NonIncrementalGC(); 145 NonIncrementalGC();
148 146
149 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); 147 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
150 CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized()); 148 CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
151 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate())); 149 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate()));
152 } 150 }
153 151
154 152
155 TEST(DeoptimizeSimpleWithArguments) { 153 TEST(DeoptimizeSimpleWithArguments) {
156 i::FLAG_turbo_deoptimization = true;
157
158 LocalContext env; 154 LocalContext env;
159 v8::HandleScope scope(env->GetIsolate()); 155 v8::HandleScope scope(env->GetIsolate());
160 156
161 // Test lazy deoptimization of a simple function with some arguments. 157 // Test lazy deoptimization of a simple function with some arguments.
162 { 158 {
163 AlwaysOptimizeAllowNativesSyntaxNoInlining options; 159 AlwaysOptimizeAllowNativesSyntaxNoInlining options;
164 CompileRun( 160 CompileRun(
165 "var count = 0;" 161 "var count = 0;"
166 "function h(x) { %DeoptimizeFunction(f); }" 162 "function h(x) { %DeoptimizeFunction(f); }"
167 "function g(x, y) { count++; h(x); }" 163 "function g(x, y) { count++; h(x); }"
(...skipping 19 matching lines...) Expand all
187 } 183 }
188 NonIncrementalGC(); 184 NonIncrementalGC();
189 185
190 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); 186 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
191 CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized()); 187 CHECK(!GetJSFunction(env->Global(), "f")->IsOptimized());
192 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate())); 188 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate()));
193 } 189 }
194 190
195 191
196 TEST(DeoptimizeSimpleNested) { 192 TEST(DeoptimizeSimpleNested) {
197 i::FLAG_turbo_deoptimization = true;
198
199 LocalContext env; 193 LocalContext env;
200 v8::HandleScope scope(env->GetIsolate()); 194 v8::HandleScope scope(env->GetIsolate());
201 195
202 // Test lazy deoptimization of a simple function. Have a nested function call 196 // Test lazy deoptimization of a simple function. Have a nested function call
203 // do the deoptimization. 197 // do the deoptimization.
204 { 198 {
205 AlwaysOptimizeAllowNativesSyntaxNoInlining options; 199 AlwaysOptimizeAllowNativesSyntaxNoInlining options;
206 CompileRun( 200 CompileRun(
207 "var count = 0;" 201 "var count = 0;"
208 "var result = 0;" 202 "var result = 0;"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 } 688 }
695 NonIncrementalGC(); 689 NonIncrementalGC();
696 690
697 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized()); 691 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized());
698 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized()); 692 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized());
699 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized()); 693 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized());
700 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); 694 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
701 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); 695 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
702 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); 696 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
703 } 697 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698