| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/js-operator.h" | 10 #include "src/compiler/js-operator.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 graph.SetStart(start); | 57 graph.SetStart(start); |
| 58 graph.SetEnd(end); | 58 graph.SetEnd(end); |
| 59 FunctionTester ft(&graph); | 59 FunctionTester ft(&graph); |
| 60 | 60 |
| 61 Handle<Object> value = ft.Val(1.5); | 61 Handle<Object> value = ft.Val(1.5); |
| 62 Handle<Object> result = ft.Call(value, value).ToHandleChecked(); | 62 Handle<Object> result = ft.Call(value, value).ToHandleChecked(); |
| 63 CHECK_EQ(1, Smi::cast(*result)->value()); | 63 CHECK_EQ(1, Smi::cast(*result)->value()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 TEST(RunUnoptimizedMathFloorStub) { |
| 68 HandleAndZoneScope scope; |
| 69 Isolate* isolate = scope.main_isolate(); |
| 70 |
| 71 // Create code and an accompanying descriptor. |
| 72 MathFloorStub stub(isolate, TurboFanIC::CALL_FROM_UNOPTIMIZED_CODE); |
| 73 stub.GenerateCode(); |
| 74 } |
| 75 |
| 76 |
| 67 TEST(RunStringLengthTFStub) { | 77 TEST(RunStringLengthTFStub) { |
| 68 HandleAndZoneScope scope; | 78 HandleAndZoneScope scope; |
| 69 Isolate* isolate = scope.main_isolate(); | 79 Isolate* isolate = scope.main_isolate(); |
| 70 Zone* zone = scope.main_zone(); | 80 Zone* zone = scope.main_zone(); |
| 71 | 81 |
| 72 // Create code and an accompanying descriptor. | 82 // Create code and an accompanying descriptor. |
| 73 StringLengthTFStub stub(isolate); | 83 StringLengthTFStub stub(isolate); |
| 74 Handle<Code> code = stub.GenerateCode(); | 84 Handle<Code> code = stub.GenerateCode(); |
| 75 CompilationInfo info(&stub, isolate, zone); | 85 CompilationInfo info(&stub, isolate, zone); |
| 76 CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info); | 86 CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 FunctionTester ft(&graph); | 151 FunctionTester ft(&graph); |
| 142 | 152 |
| 143 // Actuall call through to the stub, verifying its result. | 153 // Actuall call through to the stub, verifying its result. |
| 144 Handle<String> leftArg = ft.Val("links"); | 154 Handle<String> leftArg = ft.Val("links"); |
| 145 Handle<String> rightArg = ft.Val("rechts"); | 155 Handle<String> rightArg = ft.Val("rechts"); |
| 146 Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked(); | 156 Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked(); |
| 147 CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result))); | 157 CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result))); |
| 148 } | 158 } |
| 149 | 159 |
| 150 #endif // V8_TURBOFAN_TARGET | 160 #endif // V8_TURBOFAN_TARGET |
| OLD | NEW |