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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1386133002: [Interpreter] Add bitwise operators (Or, Xor, And) to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased the patch 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 | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.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/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/interpreter-assembler.h" 9 #include "src/compiler/interpreter-assembler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 393
394 394
395 // Mod <src> 395 // Mod <src>
396 // 396 //
397 // Modulo register <src> by accumulator. 397 // Modulo register <src> by accumulator.
398 void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) { 398 void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
399 DoBinaryOp(Runtime::kModulus, assembler); 399 DoBinaryOp(Runtime::kModulus, assembler);
400 } 400 }
401 401
402 402
403 // BitwiseOr <src>
404 //
405 // BitwiseOr register <src> to accumulator.
406 void Interpreter::DoBitwiseOr(compiler::InterpreterAssembler* assembler) {
407 DoBinaryOp(Runtime::kBitwiseOr, assembler);
408 }
409
410
411 // BitwiseXor <src>
412 //
413 // BitwiseXor register <src> to accumulator.
414 void Interpreter::DoBitwiseXor(compiler::InterpreterAssembler* assembler) {
415 DoBinaryOp(Runtime::kBitwiseXor, assembler);
416 }
417
418
419 // BitwiseAnd <src>
420 //
421 // BitwiseAnd register <src> to accumulator.
422 void Interpreter::DoBitwiseAnd(compiler::InterpreterAssembler* assembler) {
423 DoBinaryOp(Runtime::kBitwiseAnd, assembler);
424 }
425
426
403 // ShiftLeft <src> 427 // ShiftLeft <src>
404 // 428 //
405 // Left shifts register <src> by the count specified in the accumulator. 429 // Left shifts register <src> by the count specified in the accumulator.
406 // Register <src> is converted to an int32 and the accumulator to uint32 430 // Register <src> is converted to an int32 and the accumulator to uint32
407 // before the operation. 5 lsb bits from the accumulator are used as count 431 // before the operation. 5 lsb bits from the accumulator are used as count
408 // i.e. <src> << (accumulator & 0x1F). 432 // i.e. <src> << (accumulator & 0x1F).
409 void Interpreter::DoShiftLeft(compiler::InterpreterAssembler* assembler) { 433 void Interpreter::DoShiftLeft(compiler::InterpreterAssembler* assembler) {
410 DoBinaryOp(Runtime::kShiftLeft, assembler); 434 DoBinaryOp(Runtime::kShiftLeft, assembler);
411 } 435 }
412 436
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // 691 //
668 // Return the value in the accumulator. 692 // Return the value in the accumulator.
669 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 693 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
670 __ Return(); 694 __ Return();
671 } 695 }
672 696
673 697
674 } // namespace interpreter 698 } // namespace interpreter
675 } // namespace internal 699 } // namespace internal
676 } // namespace v8 700 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698