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 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/interpreter/bytecode-array-builder.h" | 8 #include "src/interpreter/bytecode-array-builder.h" |
9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
10 #include "src/interpreter/bytecode-jump-table.h" | 10 #include "src/interpreter/bytecode-jump-table.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 builder.CallRuntime(Runtime::kInlineIsArray, reg_list); | 364 builder.CallRuntime(Runtime::kInlineIsArray, reg_list); |
365 | 365 |
366 // Emit debugger bytecode. | 366 // Emit debugger bytecode. |
367 builder.Debugger(); | 367 builder.Debugger(); |
368 | 368 |
369 // Insert dummy ops to force longer jumps. | 369 // Insert dummy ops to force longer jumps. |
370 for (int i = 0; i < 256; i++) { | 370 for (int i = 0; i < 256; i++) { |
371 builder.Debugger(); | 371 builder.Debugger(); |
372 } | 372 } |
373 | 373 |
374 // Emit block counter increments. | |
375 { | |
376 SaveFlags save_flags; | |
377 FLAG_block_coverage = true; // Satisfy DCHECKs. | |
Michael Starzinger
2017/06/06 11:49:32
suggestion: We could also just remove the DCHECKs
rmcilroy
2017/06/06 13:02:32
+1
jgruber
2017/06/06 14:52:46
Done.
| |
378 builder.IncBlockCounter(0); | |
379 } | |
380 | |
374 // Bind labels for long jumps at the very end. | 381 // Bind labels for long jumps at the very end. |
375 for (size_t i = 0; i < arraysize(end); i++) { | 382 for (size_t i = 0; i < arraysize(end); i++) { |
376 builder.Bind(&end[i]); | 383 builder.Bind(&end[i]); |
377 } | 384 } |
378 | 385 |
379 // Return must be the last instruction. | 386 // Return must be the last instruction. |
380 builder.Return(); | 387 builder.Return(); |
381 | 388 |
382 // Generate BytecodeArray. | 389 // Generate BytecodeArray. |
383 scope.SetScriptScopeInfo(factory->NewScopeInfo(1)); | 390 scope.SetScriptScopeInfo(factory->NewScopeInfo(1)); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
828 iterator.Advance(); | 835 iterator.Advance(); |
829 } | 836 } |
830 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 837 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
831 iterator.Advance(); | 838 iterator.Advance(); |
832 CHECK(iterator.done()); | 839 CHECK(iterator.done()); |
833 } | 840 } |
834 | 841 |
835 } // namespace interpreter | 842 } // namespace interpreter |
836 } // namespace internal | 843 } // namespace internal |
837 } // namespace v8 | 844 } // namespace v8 |
OLD | NEW |