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

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

Issue 1390483002: [Interpreter] Unary operators - typeof, void, and logical not. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments on patch set 3. 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 builder.Call(reg, reg, 0); 53 builder.Call(reg, reg, 0);
54 builder.CallRuntime(Runtime::kIsArray, reg, 1); 54 builder.CallRuntime(Runtime::kIsArray, reg, 1);
55 55
56 // Emit binary operator invocations. 56 // Emit binary operator invocations.
57 builder.BinaryOperation(Token::Value::ADD, reg) 57 builder.BinaryOperation(Token::Value::ADD, reg)
58 .BinaryOperation(Token::Value::SUB, reg) 58 .BinaryOperation(Token::Value::SUB, reg)
59 .BinaryOperation(Token::Value::MUL, reg) 59 .BinaryOperation(Token::Value::MUL, reg)
60 .BinaryOperation(Token::Value::DIV, reg) 60 .BinaryOperation(Token::Value::DIV, reg)
61 .BinaryOperation(Token::Value::MOD, reg); 61 .BinaryOperation(Token::Value::MOD, reg);
62 62
63 // Emit unary operator invocations.
64 builder.LogicalNot().TypeOf();
65
63 // Emit test operator invocations. 66 // Emit test operator invocations.
64 builder.CompareOperation(Token::Value::EQ, reg, LanguageMode::SLOPPY) 67 builder.CompareOperation(Token::Value::EQ, reg, LanguageMode::SLOPPY)
65 .CompareOperation(Token::Value::NE, reg, LanguageMode::SLOPPY) 68 .CompareOperation(Token::Value::NE, reg, LanguageMode::SLOPPY)
66 .CompareOperation(Token::Value::EQ_STRICT, reg, LanguageMode::SLOPPY) 69 .CompareOperation(Token::Value::EQ_STRICT, reg, LanguageMode::SLOPPY)
67 .CompareOperation(Token::Value::NE_STRICT, reg, LanguageMode::SLOPPY) 70 .CompareOperation(Token::Value::NE_STRICT, reg, LanguageMode::SLOPPY)
68 .CompareOperation(Token::Value::LT, reg, LanguageMode::SLOPPY) 71 .CompareOperation(Token::Value::LT, reg, LanguageMode::SLOPPY)
69 .CompareOperation(Token::Value::GT, reg, LanguageMode::SLOPPY) 72 .CompareOperation(Token::Value::GT, reg, LanguageMode::SLOPPY)
70 .CompareOperation(Token::Value::LTE, reg, LanguageMode::SLOPPY) 73 .CompareOperation(Token::Value::LTE, reg, LanguageMode::SLOPPY)
71 .CompareOperation(Token::Value::GTE, reg, LanguageMode::SLOPPY) 74 .CompareOperation(Token::Value::GTE, reg, LanguageMode::SLOPPY)
72 .CompareOperation(Token::Value::INSTANCEOF, reg, LanguageMode::SLOPPY) 75 .CompareOperation(Token::Value::INSTANCEOF, reg, LanguageMode::SLOPPY)
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 438
436 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 439 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
437 iterator.Advance(); 440 iterator.Advance();
438 CHECK(iterator.done()); 441 CHECK(iterator.done());
439 } 442 }
440 443
441 444
442 } // namespace interpreter 445 } // namespace interpreter
443 } // namespace internal 446 } // namespace internal
444 } // namespace v8 447 } // 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