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

Unified Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1507683005: [Interpreter] Removes ToBoolean bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased the patch. Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index 6e5cc182f8cee117e9a44c1536b404ec538da9c9..beaa4e34cf9825097dc2ec9ad3361dade1df38d8 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -1562,43 +1562,6 @@ static void LoadAny(BytecodeArrayBuilder* builder,
}
-TEST(InterpreterToBoolean) {
- HandleAndZoneScope handles;
- i::Factory* factory = handles.main_isolate()->factory();
-
- std::pair<Handle<Object>, bool> object_type_tuples[] = {
- std::make_pair(factory->undefined_value(), false),
- std::make_pair(factory->null_value(), false),
- std::make_pair(factory->false_value(), false),
- std::make_pair(factory->true_value(), true),
- std::make_pair(factory->NewNumber(9.1), true),
- std::make_pair(factory->NewNumberFromInt(0), false),
- std::make_pair(
- Handle<Object>::cast(factory->NewStringFromStaticChars("hello")),
- true),
- std::make_pair(
- Handle<Object>::cast(factory->NewStringFromStaticChars("")), false),
- };
-
- for (size_t i = 0; i < arraysize(object_type_tuples); i++) {
- BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone());
- Register r0(0);
- builder.set_locals_count(0);
- builder.set_context_count(0);
- builder.set_parameter_count(0);
- LoadAny(&builder, factory, object_type_tuples[i].first);
- builder.CastAccumulatorToBoolean();
- builder.Return();
- Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
- InterpreterTester tester(handles.main_isolate(), bytecode_array);
- auto callable = tester.GetCallable<>();
- Handle<Object> return_value = callable().ToHandleChecked();
- CHECK(return_value->IsBoolean());
- CHECK_EQ(return_value->BooleanValue(), object_type_tuples[i].second);
- }
-}
-
-
TEST(InterpreterUnaryNotNonBoolean) {
HandleAndZoneScope handles;
i::Factory* factory = handles.main_isolate()->factory();
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698