| 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/interface-descriptors.h" | 5 #include "src/interface-descriptors.h" |
| 6 #include "src/isolate.h" | 6 #include "src/isolate.h" |
| 7 #include "test/cctest/compiler/function-tester.h" | 7 #include "test/cctest/compiler/function-tester.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| 11 namespace compiler { | 11 namespace compiler { |
| 12 | 12 |
| 13 | 13 |
| 14 class CodeStubAssemblerTester : public CodeStubAssembler { | 14 class CodeStubAssemblerTester : public CodeStubAssembler { |
| 15 public: | 15 public: |
| 16 CodeStubAssemblerTester(Isolate* isolate, | 16 CodeStubAssemblerTester(Isolate* isolate, |
| 17 const CallInterfaceDescriptor& descriptor) | 17 const CallInterfaceDescriptor& descriptor) |
| 18 : CodeStubAssembler(isolate, isolate->runtime_zone(), descriptor, | 18 : CodeStubAssembler(isolate, isolate->runtime_zone(), descriptor, |
| 19 Code::STUB, "test"), | 19 Code::ComputeFlags(Code::STUB), "test"), |
| 20 scope_(isolate) {} | 20 scope_(isolate) {} |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 HandleScope scope_; | 23 HandleScope scope_; |
| 24 LocalContext context_; | 24 LocalContext context_; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 | 27 |
| 28 TEST(SimpleSmiReturn) { | 28 TEST(SimpleSmiReturn) { |
| 29 Isolate* isolate(CcTest::InitIsolateOnce()); | 29 Isolate* isolate(CcTest::InitIsolateOnce()); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 m.TailCallRuntime(Runtime::kMathPow, context, a, b); | 116 m.TailCallRuntime(Runtime::kMathPow, context, a, b); |
| 117 Handle<Code> code = m.GenerateCode(); | 117 Handle<Code> code = m.GenerateCode(); |
| 118 FunctionTester ft(descriptor, code); | 118 FunctionTester ft(descriptor, code); |
| 119 MaybeHandle<Object> result = ft.Call(); | 119 MaybeHandle<Object> result = ft.Call(); |
| 120 CHECK_EQ(16, Handle<Smi>::cast(result.ToHandleChecked())->value()); | 120 CHECK_EQ(16, Handle<Smi>::cast(result.ToHandleChecked())->value()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace compiler | 123 } // namespace compiler |
| 124 } // namespace internal | 124 } // namespace internal |
| 125 } // namespace v8 | 125 } // namespace v8 |
| OLD | NEW |