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

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

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 years, 2 months 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-dictionary.cc » ('j') | 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 Handle<Code> code = m.GenerateCode(); 167 Handle<Code> code = m.GenerateCode();
168 FunctionTester ft(code, kNumParams); 168 FunctionTester ft(code, kNumParams);
169 169
170 Handle<Object> expect_index(Smi::FromInt(kKeyIsIndex), isolate); 170 Handle<Object> expect_index(Smi::FromInt(kKeyIsIndex), isolate);
171 Handle<Object> expect_unique(Smi::FromInt(kKeyIsUnique), isolate); 171 Handle<Object> expect_unique(Smi::FromInt(kKeyIsUnique), isolate);
172 Handle<Object> expect_bailout(Smi::FromInt(kBailout), isolate); 172 Handle<Object> expect_bailout(Smi::FromInt(kBailout), isolate);
173 173
174 { 174 {
175 // TryToName(<zero smi>) => if_keyisindex: smi value. 175 // TryToName(<zero smi>) => if_keyisindex: smi value.
176 Handle<Object> key(Smi::FromInt(0), isolate); 176 Handle<Object> key(Smi::kZero, isolate);
177 ft.CheckTrue(key, expect_index, key); 177 ft.CheckTrue(key, expect_index, key);
178 } 178 }
179 179
180 { 180 {
181 // TryToName(<positive smi>) => if_keyisindex: smi value. 181 // TryToName(<positive smi>) => if_keyisindex: smi value.
182 Handle<Object> key(Smi::FromInt(153), isolate); 182 Handle<Object> key(Smi::FromInt(153), isolate);
183 ft.CheckTrue(key, expect_index, key); 183 ft.CheckTrue(key, expect_index, key);
184 } 184 }
185 185
186 { 186 {
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 m.Return(m.BooleanConstant(true)); 937 m.Return(m.BooleanConstant(true));
938 938
939 m.Bind(&failed); 939 m.Bind(&failed);
940 m.Return(m.BooleanConstant(false)); 940 m.Return(m.BooleanConstant(false));
941 } 941 }
942 942
943 Handle<Code> code = m.GenerateCode(); 943 Handle<Code> code = m.GenerateCode();
944 FunctionTester ft(code, kNumParams); 944 FunctionTester ft(code, kNumParams);
945 945
946 Factory* factory = isolate->factory(); 946 Factory* factory = isolate->factory();
947 Handle<Object> smi0(Smi::FromInt(0), isolate); 947 Handle<Object> smi0(Smi::kZero, isolate);
948 Handle<Object> smi1(Smi::FromInt(1), isolate); 948 Handle<Object> smi1(Smi::FromInt(1), isolate);
949 Handle<Object> smi7(Smi::FromInt(7), isolate); 949 Handle<Object> smi7(Smi::FromInt(7), isolate);
950 Handle<Object> smi13(Smi::FromInt(13), isolate); 950 Handle<Object> smi13(Smi::FromInt(13), isolate);
951 Handle<Object> smi42(Smi::FromInt(42), isolate); 951 Handle<Object> smi42(Smi::FromInt(42), isolate);
952 952
953 Handle<Object> expect_found(Smi::FromInt(kFound), isolate); 953 Handle<Object> expect_found(Smi::FromInt(kFound), isolate);
954 Handle<Object> expect_not_found(Smi::FromInt(kNotFound), isolate); 954 Handle<Object> expect_not_found(Smi::FromInt(kNotFound), isolate);
955 Handle<Object> expect_bailout(Smi::FromInt(kBailout), isolate); 955 Handle<Object> expect_bailout(Smi::FromInt(kBailout), isolate);
956 956
957 #define CHECK_FOUND(object, index) \ 957 #define CHECK_FOUND(object, index) \
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 1504
1505 Handle<Object> constructor = 1505 Handle<Object> constructor =
1506 Object::GetPropertyOrElement(result, 1506 Object::GetPropertyOrElement(result,
1507 isolate->factory()->constructor_string()) 1507 isolate->factory()->constructor_string())
1508 .ToHandleChecked(); 1508 .ToHandleChecked();
1509 CHECK(constructor->SameValue(*isolate->type_error_function())); 1509 CHECK(constructor->SameValue(*isolate->type_error_function()));
1510 } 1510 }
1511 1511
1512 } // namespace internal 1512 } // namespace internal
1513 } // namespace v8 1513 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698