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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 TEST(TestLinkageRuntimeCall) { | 93 TEST(TestLinkageRuntimeCall) { |
94 // TODO(titzer): test linkage creation for outgoing runtime calls. | 94 // TODO(titzer): test linkage creation for outgoing runtime calls. |
95 } | 95 } |
96 | 96 |
97 | 97 |
98 TEST(TestLinkageStubCall) { | 98 TEST(TestLinkageStubCall) { |
99 Isolate* isolate = CcTest::InitIsolateOnce(); | 99 Isolate* isolate = CcTest::InitIsolateOnce(); |
100 Zone zone(isolate->allocator()); | 100 Zone zone(isolate->allocator(), ZONE_NAME); |
101 Callable callable = CodeFactory::ToNumber(isolate); | 101 Callable callable = CodeFactory::ToNumber(isolate); |
102 CompilationInfo info(ArrayVector("test"), isolate, &zone, | 102 CompilationInfo info(ArrayVector("test"), isolate, &zone, |
103 Code::ComputeFlags(Code::STUB)); | 103 Code::ComputeFlags(Code::STUB)); |
104 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( | 104 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
105 isolate, &zone, callable.descriptor(), 0, CallDescriptor::kNoFlags, | 105 isolate, &zone, callable.descriptor(), 0, CallDescriptor::kNoFlags, |
106 Operator::kNoProperties); | 106 Operator::kNoProperties); |
107 CHECK(descriptor); | 107 CHECK(descriptor); |
108 CHECK_EQ(0, static_cast<int>(descriptor->StackParameterCount())); | 108 CHECK_EQ(0, static_cast<int>(descriptor->StackParameterCount())); |
109 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount())); | 109 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount())); |
110 CHECK_EQ(Operator::kNoProperties, descriptor->properties()); | 110 CHECK_EQ(Operator::kNoProperties, descriptor->properties()); |
111 CHECK_EQ(false, descriptor->IsJSFunctionCall()); | 111 CHECK_EQ(false, descriptor->IsJSFunctionCall()); |
112 // TODO(titzer): test linkage creation for outgoing stub calls. | 112 // TODO(titzer): test linkage creation for outgoing stub calls. |
113 } | 113 } |
114 | 114 |
115 } // namespace compiler | 115 } // namespace compiler |
116 } // namespace internal | 116 } // namespace internal |
117 } // namespace v8 | 117 } // namespace v8 |
OLD | NEW |