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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1682853004: [interpreter, debugger] implement bytecode break location iterator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix build Created 4 years, 10 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
« no previous file with comments | « test/mjsunit/mjsunit.status ('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 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/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "src/interpreter/bytecode-register-allocator.h" 9 #include "src/interpreter/bytecode-register-allocator.h"
10 #include "test/unittests/test-utils.h" 10 #include "test/unittests/test-utils.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 Factory* factory = isolate()->factory(); 387 Factory* factory = isolate()->factory();
388 Handle<HeapObject> heap_num_1 = factory->NewHeapNumber(3.14); 388 Handle<HeapObject> heap_num_1 = factory->NewHeapNumber(3.14);
389 Handle<HeapObject> heap_num_2 = factory->NewHeapNumber(5.2); 389 Handle<HeapObject> heap_num_2 = factory->NewHeapNumber(5.2);
390 Handle<Object> large_smi(Smi::FromInt(0x12345678), isolate()); 390 Handle<Object> large_smi(Smi::FromInt(0x12345678), isolate());
391 Handle<HeapObject> heap_num_2_copy(*heap_num_2); 391 Handle<HeapObject> heap_num_2_copy(*heap_num_2);
392 builder.LoadLiteral(heap_num_1) 392 builder.LoadLiteral(heap_num_1)
393 .LoadLiteral(heap_num_2) 393 .LoadLiteral(heap_num_2)
394 .LoadLiteral(large_smi) 394 .LoadLiteral(large_smi)
395 .LoadLiteral(heap_num_1) 395 .LoadLiteral(heap_num_1)
396 .LoadLiteral(heap_num_1) 396 .LoadLiteral(heap_num_1)
397 .LoadLiteral(heap_num_2_copy); 397 .LoadLiteral(heap_num_2_copy)
398 .Return();
398 399
399 Handle<BytecodeArray> array = builder.ToBytecodeArray(); 400 Handle<BytecodeArray> array = builder.ToBytecodeArray();
400 // Should only have one entry for each identical constant. 401 // Should only have one entry for each identical constant.
401 CHECK_EQ(array->constant_pool()->length(), 3); 402 CHECK_EQ(array->constant_pool()->length(), 3);
402 } 403 }
403 404
404 405
405 TEST_F(BytecodeArrayBuilderTest, ForwardJumps) { 406 TEST_F(BytecodeArrayBuilderTest, ForwardJumps) {
406 static const int kFarJumpDistance = 256; 407 static const int kFarJumpDistance = 256;
407 408
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 iterator.Advance(); 660 iterator.Advance();
660 } 661 }
661 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 662 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
662 iterator.Advance(); 663 iterator.Advance();
663 CHECK(iterator.done()); 664 CHECK(iterator.done());
664 } 665 }
665 666
666 } // namespace interpreter 667 } // namespace interpreter
667 } // namespace internal 668 } // namespace internal
668 } // namespace v8 669 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698