Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: test/cctest/test-code-stub-assembler.cc

Issue 2489743002: [stubs] Ensure CSA_ASSERT and CSA_SLOW_ASSERT do not produce unused instructions in release mode. (Closed)
Patch Set: ((void)0) Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interpreter/interpreter-assembler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/utils/random-number-generator.h" 5 #include "src/base/utils/random-number-generator.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 #include "src/compiler/node.h" 8 #include "src/compiler/node.h"
9 #include "src/ic/stub-cache.h" 9 #include "src/ic/stub-cache.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 } 1918 }
1919 1919
1920 TEST(Arguments) { 1920 TEST(Arguments) {
1921 Isolate* isolate(CcTest::InitIsolateOnce()); 1921 Isolate* isolate(CcTest::InitIsolateOnce());
1922 1922
1923 const int kNumParams = 4; 1923 const int kNumParams = 4;
1924 CodeStubAssemblerTester m(isolate, kNumParams); 1924 CodeStubAssemblerTester m(isolate, kNumParams);
1925 1925
1926 CodeStubArguments arguments(&m, m.IntPtrConstant(3)); 1926 CodeStubArguments arguments(&m, m.IntPtrConstant(3));
1927 1927
1928 m.Assert(m.WordEqual(arguments.AtIndex(0), m.SmiConstant(Smi::FromInt(12)))); 1928 CSA_ASSERT(
1929 m.Assert(m.WordEqual(arguments.AtIndex(1), m.SmiConstant(Smi::FromInt(13)))); 1929 &m, m.WordEqual(arguments.AtIndex(0), m.SmiConstant(Smi::FromInt(12))));
1930 m.Assert(m.WordEqual(arguments.AtIndex(2), m.SmiConstant(Smi::FromInt(14)))); 1930 CSA_ASSERT(
1931 &m, m.WordEqual(arguments.AtIndex(1), m.SmiConstant(Smi::FromInt(13))));
1932 CSA_ASSERT(
1933 &m, m.WordEqual(arguments.AtIndex(2), m.SmiConstant(Smi::FromInt(14))));
1931 1934
1932 m.Return(arguments.GetReceiver()); 1935 m.Return(arguments.GetReceiver());
1933 1936
1934 Handle<Code> code = m.GenerateCode(); 1937 Handle<Code> code = m.GenerateCode();
1935 CHECK(!code.is_null()); 1938 CHECK(!code.is_null());
1936 1939
1937 FunctionTester ft(code, kNumParams); 1940 FunctionTester ft(code, kNumParams);
1938 Handle<Object> result = ft.Call(isolate->factory()->undefined_value(), 1941 Handle<Object> result = ft.Call(isolate->factory()->undefined_value(),
1939 Handle<Smi>(Smi::FromInt(12), isolate), 1942 Handle<Smi>(Smi::FromInt(12), isolate),
1940 Handle<Smi>(Smi::FromInt(13), isolate), 1943 Handle<Smi>(Smi::FromInt(13), isolate),
(...skipping 29 matching lines...) Expand all
1970 Handle<Object> result = ft.Call(isolate->factory()->undefined_value(), 1973 Handle<Object> result = ft.Call(isolate->factory()->undefined_value(),
1971 Handle<Smi>(Smi::FromInt(12), isolate), 1974 Handle<Smi>(Smi::FromInt(12), isolate),
1972 Handle<Smi>(Smi::FromInt(13), isolate), 1975 Handle<Smi>(Smi::FromInt(13), isolate),
1973 Handle<Smi>(Smi::FromInt(14), isolate)) 1976 Handle<Smi>(Smi::FromInt(14), isolate))
1974 .ToHandleChecked(); 1977 .ToHandleChecked();
1975 CHECK_EQ(Smi::FromInt(12 + 13 + 14), *result); 1978 CHECK_EQ(Smi::FromInt(12 + 13 + 14), *result);
1976 } 1979 }
1977 1980
1978 } // namespace internal 1981 } // namespace internal
1979 } // namespace v8 1982 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/interpreter-assembler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698