| OLD | NEW |
| 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/code-stubs.h" |
| 7 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 8 #include "src/zone.h" | 9 #include "src/zone.h" |
| 9 | 10 |
| 10 #include "src/compiler/common-operator.h" | 11 #include "src/compiler/common-operator.h" |
| 11 #include "src/compiler/graph.h" | 12 #include "src/compiler/graph.h" |
| 12 #include "src/compiler/linkage.h" | 13 #include "src/compiler/linkage.h" |
| 13 #include "src/compiler/machine-operator.h" | 14 #include "src/compiler/machine-operator.h" |
| 14 #include "src/compiler/node.h" | 15 #include "src/compiler/node.h" |
| 15 #include "src/compiler/operator.h" | 16 #include "src/compiler/operator.h" |
| 16 #include "src/compiler/pipeline.h" | 17 #include "src/compiler/pipeline.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 CHECK_EQ(1 + i, static_cast<int>(descriptor->JSParameterCount())); | 67 CHECK_EQ(1 + i, static_cast<int>(descriptor->JSParameterCount())); |
| 67 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount())); | 68 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount())); |
| 68 CHECK_EQ(Operator::kNoProperties, descriptor->properties()); | 69 CHECK_EQ(Operator::kNoProperties, descriptor->properties()); |
| 69 CHECK_EQ(true, descriptor->IsJSFunctionCall()); | 70 CHECK_EQ(true, descriptor->IsJSFunctionCall()); |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 | 73 |
| 73 | 74 |
| 74 TEST(TestLinkageCodeStubIncoming) { | 75 TEST(TestLinkageCodeStubIncoming) { |
| 75 Isolate* isolate = CcTest::InitIsolateOnce(); | 76 Isolate* isolate = CcTest::InitIsolateOnce(); |
| 76 CompilationInfoWithZone info(static_cast<CodeStub*>(NULL), isolate); | 77 ToNumberStub stub(isolate); |
| 78 CompilationInfoWithZone info(&stub, isolate); |
| 77 CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info); | 79 CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info); |
| 78 // TODO(titzer): test linkage creation with a bonafide code stub. | 80 CHECK(descriptor); |
| 79 // this just checks current behavior. | 81 CHECK_EQ(1, static_cast<int>(descriptor->JSParameterCount())); |
| 80 CHECK(!descriptor); | 82 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount())); |
| 83 CHECK_EQ(Operator::kNoProperties, descriptor->properties()); |
| 84 CHECK_EQ(false, descriptor->IsJSFunctionCall()); |
| 81 } | 85 } |
| 82 | 86 |
| 83 | 87 |
| 84 TEST(TestLinkageJSCall) { | 88 TEST(TestLinkageJSCall) { |
| 85 HandleAndZoneScope handles; | 89 HandleAndZoneScope handles; |
| 86 Handle<JSFunction> function = Compile("a + c"); | 90 Handle<JSFunction> function = Compile("a + c"); |
| 87 CompilationInfoWithZone info(function); | 91 CompilationInfoWithZone info(function); |
| 88 | 92 |
| 89 for (int i = 0; i < 32; i++) { | 93 for (int i = 0; i < 32; i++) { |
| 90 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( | 94 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 102 // TODO(titzer): test linkage creation for outgoing runtime calls. | 106 // TODO(titzer): test linkage creation for outgoing runtime calls. |
| 103 } | 107 } |
| 104 | 108 |
| 105 | 109 |
| 106 TEST(TestLinkageStubCall) { | 110 TEST(TestLinkageStubCall) { |
| 107 // TODO(titzer): test linkage creation for outgoing stub calls. | 111 // TODO(titzer): test linkage creation for outgoing stub calls. |
| 108 } | 112 } |
| 109 | 113 |
| 110 | 114 |
| 111 #endif // V8_TURBOFAN_TARGET | 115 #endif // V8_TURBOFAN_TARGET |
| OLD | NEW |