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/interpreter.h" | 10 #include "src/interpreter/interpreter.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 using namespace v8::internal; | 66 using namespace v8::internal; |
67 using namespace v8::internal::interpreter; | 67 using namespace v8::internal::interpreter; |
68 | 68 |
69 TEST(TestInterpreterReturn) { | 69 TEST(TestInterpreterReturn) { |
70 InitializedHandleScope handles; | 70 InitializedHandleScope handles; |
71 Handle<Object> undefined_value = | 71 Handle<Object> undefined_value = |
72 handles.main_isolate()->factory()->undefined_value(); | 72 handles.main_isolate()->factory()->undefined_value(); |
73 | 73 |
74 BytecodeArrayBuilder builder(handles.main_isolate()); | 74 BytecodeArrayBuilder builder(handles.main_isolate()); |
75 // TODO(rmcilroy) set to 0 once BytecodeArray update to allow zero size | 75 builder.set_locals_count(0); |
76 // register file. | |
77 builder.set_locals_count(1); | |
78 builder.Return(); | 76 builder.Return(); |
79 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); | 77 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); |
80 | 78 |
81 InterpreterTester tester(handles.main_isolate(), bytecode_array); | 79 InterpreterTester tester(handles.main_isolate(), bytecode_array); |
82 InterpreterCallable callable(tester.GetCallable()); | 80 InterpreterCallable callable(tester.GetCallable()); |
83 Handle<Object> return_val = callable().ToHandleChecked(); | 81 Handle<Object> return_val = callable().ToHandleChecked(); |
84 CHECK(return_val.is_identical_to(undefined_value)); | 82 CHECK(return_val.is_identical_to(undefined_value)); |
85 } | 83 } |
OLD | NEW |