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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1392913002: [Interpreter] Adds shift operators to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a test for shift operators and comments Created 5 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/interpreter/test-interpreter.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 builder.Call(reg, reg, 0); 57 builder.Call(reg, reg, 0);
58 builder.CallRuntime(Runtime::kIsArray, reg, 1); 58 builder.CallRuntime(Runtime::kIsArray, reg, 1);
59 59
60 // Emit binary operator invocations. 60 // Emit binary operator invocations.
61 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 61 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
62 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) 62 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK)
63 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) 63 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK)
64 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) 64 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK)
65 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); 65 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK);
66 66
67 // Emit shift operator invocations
68 builder.BinaryOperation(Token::Value::SHL, reg, Strength::WEAK)
69 .BinaryOperation(Token::Value::SAR, reg, Strength::WEAK)
70 .BinaryOperation(Token::Value::SHR, reg, Strength::WEAK);
71
67 // Emit unary operator invocations. 72 // Emit unary operator invocations.
68 builder.LogicalNot().TypeOf(); 73 builder.LogicalNot().TypeOf();
69 74
70 // Emit test operator invocations. 75 // Emit test operator invocations.
71 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 76 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
72 .CompareOperation(Token::Value::NE, reg, Strength::WEAK) 77 .CompareOperation(Token::Value::NE, reg, Strength::WEAK)
73 .CompareOperation(Token::Value::EQ_STRICT, reg, Strength::WEAK) 78 .CompareOperation(Token::Value::EQ_STRICT, reg, Strength::WEAK)
74 .CompareOperation(Token::Value::NE_STRICT, reg, Strength::WEAK) 79 .CompareOperation(Token::Value::NE_STRICT, reg, Strength::WEAK)
75 .CompareOperation(Token::Value::LT, reg, Strength::WEAK) 80 .CompareOperation(Token::Value::LT, reg, Strength::WEAK)
76 .CompareOperation(Token::Value::GT, reg, Strength::WEAK) 81 .CompareOperation(Token::Value::GT, reg, Strength::WEAK)
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 447
443 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 448 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
444 iterator.Advance(); 449 iterator.Advance();
445 CHECK(iterator.done()); 450 CHECK(iterator.done());
446 } 451 }
447 452
448 453
449 } // namespace interpreter 454 } // namespace interpreter
450 } // namespace internal 455 } // namespace internal
451 } // namespace v8 456 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698