OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/bytecode-array-iterator.h" | 8 #include "src/interpreter/bytecode-array-iterator.h" |
9 #include "src/interpreter/bytecode-generator.h" | 9 #include "src/interpreter/bytecode-generator.h" |
10 #include "src/interpreter/interpreter.h" | 10 #include "src/interpreter/interpreter.h" |
(...skipping 8323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8334 }; | 8334 }; |
8335 // clang-format on | 8335 // clang-format on |
8336 | 8336 |
8337 for (size_t i = 0; i < arraysize(snippets); i++) { | 8337 for (size_t i = 0; i < arraysize(snippets); i++) { |
8338 Handle<BytecodeArray> bytecode_array = | 8338 Handle<BytecodeArray> bytecode_array = |
8339 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 8339 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
8340 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 8340 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
8341 } | 8341 } |
8342 } | 8342 } |
8343 | 8343 |
| 8344 TEST(DoDebugger) { |
| 8345 InitializedHandleScope handle_scope; |
| 8346 BytecodeGeneratorHelper helper; |
| 8347 |
| 8348 // clang-format off |
| 8349 ExpectedSnippet<const char*> snippet = { |
| 8350 "debugger;", |
| 8351 0, |
| 8352 1, |
| 8353 4, |
| 8354 { |
| 8355 B(StackCheck), // |
| 8356 B(Debugger), // |
| 8357 B(LdaUndefined), // |
| 8358 B(Return) // |
| 8359 }, |
| 8360 0 |
| 8361 }; |
| 8362 // clang-format on |
| 8363 |
| 8364 Handle<BytecodeArray> bytecode_array = |
| 8365 helper.MakeBytecodeForFunctionBody(snippet.code_snippet); |
| 8366 CheckBytecodeArrayEqual(snippet, bytecode_array); |
| 8367 } |
| 8368 |
8344 } // namespace interpreter | 8369 } // namespace interpreter |
8345 } // namespace internal | 8370 } // namespace internal |
8346 } // namespace v8 | 8371 } // namespace v8 |
OLD | NEW |