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/execution.h" | 7 #include "src/execution.h" |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/interpreter/bytecode-array-builder.h" | 9 #include "src/interpreter/bytecode-array-builder.h" |
10 #include "src/interpreter/bytecode-array-iterator.h" | 10 #include "src/interpreter/bytecode-array-iterator.h" |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 BytecodeLabel label[3]; | 1401 BytecodeLabel label[3]; |
1402 | 1402 |
1403 builder.LoadLiteral(Smi::FromInt(0)) | 1403 builder.LoadLiteral(Smi::FromInt(0)) |
1404 .StoreAccumulatorInRegister(reg) | 1404 .StoreAccumulatorInRegister(reg) |
1405 .Jump(&label[1]); | 1405 .Jump(&label[1]); |
1406 SetRegister(builder, reg, 1024, scratch).Bind(&label[0]); | 1406 SetRegister(builder, reg, 1024, scratch).Bind(&label[0]); |
1407 IncrementRegister(builder, reg, 1, scratch, vector->GetIndex(slot)) | 1407 IncrementRegister(builder, reg, 1, scratch, vector->GetIndex(slot)) |
1408 .Jump(&label[2]); | 1408 .Jump(&label[2]); |
1409 SetRegister(builder, reg, 2048, scratch).Bind(&label[1]); | 1409 SetRegister(builder, reg, 2048, scratch).Bind(&label[1]); |
1410 IncrementRegister(builder, reg, 2, scratch, vector->GetIndex(slot1)) | 1410 IncrementRegister(builder, reg, 2, scratch, vector->GetIndex(slot1)) |
1411 .Jump(&label[0]); | 1411 .JumpLoop(&label[0], 0); |
1412 SetRegister(builder, reg, 4096, scratch).Bind(&label[2]); | 1412 SetRegister(builder, reg, 4096, scratch).Bind(&label[2]); |
1413 IncrementRegister(builder, reg, 4, scratch, vector->GetIndex(slot2)) | 1413 IncrementRegister(builder, reg, 4, scratch, vector->GetIndex(slot2)) |
1414 .LoadAccumulatorWithRegister(reg) | 1414 .LoadAccumulatorWithRegister(reg) |
1415 .Return(); | 1415 .Return(); |
1416 | 1416 |
1417 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); | 1417 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); |
1418 InterpreterTester tester(isolate, bytecode_array, vector); | 1418 InterpreterTester tester(isolate, bytecode_array, vector); |
1419 auto callable = tester.GetCallable<>(); | 1419 auto callable = tester.GetCallable<>(); |
1420 Handle<Object> return_value = callable().ToHandleChecked(); | 1420 Handle<Object> return_value = callable().ToHandleChecked(); |
1421 CHECK_EQ(Smi::cast(*return_value)->value(), 7); | 1421 CHECK_EQ(Smi::cast(*return_value)->value(), 7); |
(...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4721 auto callable = tester.GetCallable<>(); | 4721 auto callable = tester.GetCallable<>(); |
4722 | 4722 |
4723 Handle<i::Object> return_value = callable().ToHandleChecked(); | 4723 Handle<i::Object> return_value = callable().ToHandleChecked(); |
4724 CHECK(return_value->SameValue(*tests[i].second)); | 4724 CHECK(return_value->SameValue(*tests[i].second)); |
4725 } | 4725 } |
4726 } | 4726 } |
4727 | 4727 |
4728 } // namespace interpreter | 4728 } // namespace interpreter |
4729 } // namespace internal | 4729 } // namespace internal |
4730 } // namespace v8 | 4730 } // namespace v8 |
OLD | NEW |