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

Side by Side Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1476473005: [Interpreter] Add support for compare operators to bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed compile error on linux_gcc bot. 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 unified diff | Download patch
« no previous file with comments | « test/cctest/compiler/test-run-bytecode-graph-builder.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 // TODO(rmcilroy): Remove this define after this flag is turned on globally 5 // TODO(rmcilroy): Remove this define after this flag is turned on globally
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 1237
1238 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); 1238 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
1239 InterpreterTester tester(handles.main_isolate(), bytecode_array); 1239 InterpreterTester tester(handles.main_isolate(), bytecode_array);
1240 auto callable = tester.GetCallable<>(); 1240 auto callable = tester.GetCallable<>();
1241 Handle<Object> return_value = callable().ToHandleChecked(); 1241 Handle<Object> return_value = callable().ToHandleChecked();
1242 CHECK_EQ(Smi::cast(*return_value)->value(), 7); 1242 CHECK_EQ(Smi::cast(*return_value)->value(), 7);
1243 } 1243 }
1244 1244
1245 1245
1246 static const Token::Value kComparisonTypes[] = { 1246 static const Token::Value kComparisonTypes[] = {
1247 Token::Value::EQ, Token::Value::NE, Token::Value::EQ_STRICT, 1247 Token::Value::EQ, Token::Value::NE, Token::Value::EQ_STRICT,
1248 Token::Value::NE_STRICT, Token::Value::LTE, Token::Value::LTE, 1248 Token::Value::NE_STRICT, Token::Value::LT, Token::Value::LTE,
oth 2015/11/25 14:18:33 Good catch.
1249 Token::Value::GT, Token::Value::GTE}; 1249 Token::Value::GT, Token::Value::GTE};
1250 1250
1251 1251
1252 template <typename T> 1252 template <typename T>
1253 bool CompareC(Token::Value op, T lhs, T rhs, bool types_differed = false) { 1253 bool CompareC(Token::Value op, T lhs, T rhs, bool types_differed = false) {
1254 switch (op) { 1254 switch (op) {
1255 case Token::Value::EQ: 1255 case Token::Value::EQ:
1256 return lhs == rhs; 1256 return lhs == rhs;
1257 case Token::Value::NE: 1257 case Token::Value::NE:
1258 return lhs != rhs; 1258 return lhs != rhs;
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
3087 callable(handle(Smi::FromInt(arg_value), handles.main_isolate())) 3087 callable(handle(Smi::FromInt(arg_value), handles.main_isolate()))
3088 .ToHandleChecked(); 3088 .ToHandleChecked();
3089 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), samples[i].second); 3089 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), samples[i].second);
3090 } 3090 }
3091 } 3091 }
3092 3092
3093 3093
3094 } // namespace interpreter 3094 } // namespace interpreter
3095 } // namespace internal 3095 } // namespace internal
3096 } // namespace v8 3096 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-bytecode-graph-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698