| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 builder.CallRuntime(Runtime::kInlineIsArray, reg_list); | 365 builder.CallRuntime(Runtime::kInlineIsArray, reg_list); |
| 366 | 366 |
| 367 // Emit debugger bytecode. | 367 // Emit debugger bytecode. |
| 368 builder.Debugger(); | 368 builder.Debugger(); |
| 369 | 369 |
| 370 // Insert dummy ops to force longer jumps. | 370 // Insert dummy ops to force longer jumps. |
| 371 for (int i = 0; i < 256; i++) { | 371 for (int i = 0; i < 256; i++) { |
| 372 builder.Debugger(); | 372 builder.Debugger(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 // Emit block counter increments. |
| 376 FLAG_block_coverage = true; // Satisfy DCHECKs. |
| 377 builder.IncBlockCounter(0); |
| 378 |
| 375 // Bind labels for long jumps at the very end. | 379 // Bind labels for long jumps at the very end. |
| 376 for (size_t i = 0; i < arraysize(end); i++) { | 380 for (size_t i = 0; i < arraysize(end); i++) { |
| 377 builder.Bind(&end[i]); | 381 builder.Bind(&end[i]); |
| 378 } | 382 } |
| 379 | 383 |
| 380 // Return must be the last instruction. | 384 // Return must be the last instruction. |
| 381 builder.Return(); | 385 builder.Return(); |
| 382 | 386 |
| 383 // Generate BytecodeArray. | 387 // Generate BytecodeArray. |
| 384 scope.SetScriptScopeInfo(factory->NewScopeInfo(1)); | 388 scope.SetScriptScopeInfo(factory->NewScopeInfo(1)); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 iterator.Advance(); | 748 iterator.Advance(); |
| 745 } | 749 } |
| 746 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 750 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
| 747 iterator.Advance(); | 751 iterator.Advance(); |
| 748 CHECK(iterator.done()); | 752 CHECK(iterator.done()); |
| 749 } | 753 } |
| 750 | 754 |
| 751 } // namespace interpreter | 755 } // namespace interpreter |
| 752 } // namespace internal | 756 } // namespace internal |
| 753 } // namespace v8 | 757 } // namespace v8 |
| OLD | NEW |