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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
11 #include "src/compiler/graph.h" | 11 #include "src/compiler/graph.h" |
12 #include "src/compiler/js-graph.h" | 12 #include "src/compiler/js-graph.h" |
13 #include "src/compiler/js-operator.h" | 13 #include "src/compiler/js-operator.h" |
14 #include "src/compiler/linkage.h" | 14 #include "src/compiler/linkage.h" |
15 #include "src/compiler/machine-operator.h" | 15 #include "src/compiler/machine-operator.h" |
16 #include "src/compiler/pipeline.h" | 16 #include "src/compiler/pipeline.h" |
17 #include "src/parser.h" | 17 #include "src/parser.h" |
18 #include "test/cctest/compiler/function-tester.h" | 18 #include "test/cctest/compiler/function-tester.h" |
19 | 19 |
20 using namespace v8::internal; | 20 namespace v8 { |
21 using namespace v8::internal::compiler; | 21 namespace internal { |
| 22 namespace compiler { |
22 | 23 |
23 | 24 |
24 TEST(RunOptimizedMathFloorStub) { | 25 TEST(RunOptimizedMathFloorStub) { |
25 HandleAndZoneScope scope; | 26 HandleAndZoneScope scope; |
26 Isolate* isolate = scope.main_isolate(); | 27 Isolate* isolate = scope.main_isolate(); |
27 | 28 |
28 // Create code and an accompanying descriptor. | 29 // Create code and an accompanying descriptor. |
29 MathFloorStub stub(isolate, TurboFanIC::CALL_FROM_OPTIMIZED_CODE); | 30 MathFloorStub stub(isolate, TurboFanIC::CALL_FROM_OPTIMIZED_CODE); |
30 Handle<Code> code = stub.GenerateCode(); | 31 Handle<Code> code = stub.GenerateCode(); |
31 Zone* zone = scope.main_zone(); | 32 Zone* zone = scope.main_zone(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 graph.SetStart(start); | 137 graph.SetStart(start); |
137 graph.SetEnd(end); | 138 graph.SetEnd(end); |
138 FunctionTester ft(&graph); | 139 FunctionTester ft(&graph); |
139 | 140 |
140 // Actuall call through to the stub, verifying its result. | 141 // Actuall call through to the stub, verifying its result. |
141 Handle<String> leftArg = ft.Val("links"); | 142 Handle<String> leftArg = ft.Val("links"); |
142 Handle<String> rightArg = ft.Val("rechts"); | 143 Handle<String> rightArg = ft.Val("rechts"); |
143 Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked(); | 144 Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked(); |
144 CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result))); | 145 CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result))); |
145 } | 146 } |
| 147 |
| 148 } // namespace compiler |
| 149 } // namespace internal |
| 150 } // namespace v8 |
OLD | NEW |