OLD | NEW |
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 // Check the safepoint - it should contain an entry for the call | 204 // Check the safepoint - it should contain an entry for the call |
205 // with the right deoptimization address. | 205 // with the right deoptimization address. |
206 SafepointEntry entry = t.result_code->GetSafepointEntry( | 206 SafepointEntry entry = t.result_code->GetSafepointEntry( |
207 t.result_code->instruction_start() + cont_label->pos()); | 207 t.result_code->instruction_start() + cont_label->pos()); |
208 CHECK(entry.is_valid()); | 208 CHECK(entry.is_valid()); |
209 CHECK_EQ(deopt_label->pos(), entry.deoptimization_pc()); | 209 CHECK_EQ(deopt_label->pos(), entry.deoptimization_pc()); |
210 | 210 |
211 // Check that we deoptimize to the right AST id. | 211 // Check that we deoptimize to the right AST id. |
212 CHECK_EQ(1, data->DeoptCount()); | 212 CHECK_EQ(1, data->DeoptCount()); |
213 CHECK_EQ(1, data->DeoptCount()); | |
214 CHECK_EQ(t.bailout_id.ToInt(), data->AstId(0).ToInt()); | 213 CHECK_EQ(t.bailout_id.ToInt(), data->AstId(0).ToInt()); |
215 } | 214 } |
216 | 215 |
217 | 216 |
218 TEST(TurboTrivialDeoptCodegenAndRun) { | 217 TEST(TurboTrivialDeoptCodegenAndRun) { |
219 HandleAndZoneScope scope; | 218 HandleAndZoneScope scope; |
220 InitializedHandleScope handles; | 219 InitializedHandleScope handles; |
221 | 220 |
222 FLAG_allow_natives_syntax = true; | 221 FLAG_allow_natives_syntax = true; |
223 FLAG_turbo_deoptimization = true; | 222 FLAG_turbo_deoptimization = true; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 Handle<Object> result; | 337 Handle<Object> result; |
339 bool has_pending_exception = | 338 bool has_pending_exception = |
340 !Execution::Call(isolate, t.function, | 339 !Execution::Call(isolate, t.function, |
341 isolate->factory()->undefined_value(), 0, NULL, | 340 isolate->factory()->undefined_value(), 0, NULL, |
342 false).ToHandle(&result); | 341 false).ToHandle(&result); |
343 CHECK(!has_pending_exception); | 342 CHECK(!has_pending_exception); |
344 CHECK(result->SameValue(Smi::FromInt(42))); | 343 CHECK(result->SameValue(Smi::FromInt(42))); |
345 } | 344 } |
346 | 345 |
347 #endif | 346 #endif |
OLD | NEW |