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 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 | « 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 369
370 // Mod <src> 370 // Mod <src>
371 // 371 //
372 // Modulo register <src> by accumulator. 372 // Modulo register <src> by accumulator.
373 void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) { 373 void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
374 DoBinaryOp(Runtime::kModulus, assembler); 374 DoBinaryOp(Runtime::kModulus, assembler);
375 } 375 }
376 376
377 377
378 // ShiftLeft <src>
379 //
380 // Left shifts register <src> by the count specified in the accumulator.
381 // Register <src> is converted to an int32 and the accumulator to uint32
382 // before the operation. 5 lsb bits from the accumulator are used as count
383 // i.e. <src> << (accumulator & 0x1F).
384 void Interpreter::DoShiftLeft(compiler::InterpreterAssembler* assembler) {
385 DoBinaryOp(Runtime::kShiftLeft, assembler);
386 }
387
388
389 // ShiftRight <src>
390 //
391 // Right shifts register <src> by the count specified in the accumulator.
392 // Result is sign extended. Register <src> is converted to an int32 and the
393 // accumulator to uint32 before the operation. 5 lsb bits from the accumulator
394 // are used as count i.e. <src> >> (accumulator & 0x1F).
395 void Interpreter::DoShiftRight(compiler::InterpreterAssembler* assembler) {
396 DoBinaryOp(Runtime::kShiftRight, assembler);
397 }
398
399
400 // ShiftRightLogical <src>
401 //
402 // Right Shifts register <src> by the count specified in the accumulator.
403 // Result is zero-filled. The accumulator and register <src> are converted to
404 // uint32 before the operation 5 lsb bits from the accumulator are used as
405 // count i.e. <src> << (accumulator & 0x1F).
406 void Interpreter::DoShiftRightLogical(
407 compiler::InterpreterAssembler* assembler) {
408 DoBinaryOp(Runtime::kShiftRightLogical, assembler);
409 }
410
411
378 // LogicalNot 412 // LogicalNot
379 // 413 //
380 // Perform logical-not on the accumulator, first casting the 414 // Perform logical-not on the accumulator, first casting the
381 // accumulator to a boolean value if required. 415 // accumulator to a boolean value if required.
382 void Interpreter::DoLogicalNot(compiler::InterpreterAssembler* assembler) { 416 void Interpreter::DoLogicalNot(compiler::InterpreterAssembler* assembler) {
383 Node* accumulator = __ GetAccumulator(); 417 Node* accumulator = __ GetAccumulator();
384 Node* result = __ CallRuntime(Runtime::kInterpreterLogicalNot, accumulator); 418 Node* result = __ CallRuntime(Runtime::kInterpreterLogicalNot, accumulator);
385 __ SetAccumulator(result); 419 __ SetAccumulator(result);
386 __ Dispatch(); 420 __ Dispatch();
387 } 421 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // 642 //
609 // Return the value in the accumulator. 643 // Return the value in the accumulator.
610 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 644 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
611 __ Return(); 645 __ Return();
612 } 646 }
613 647
614 648
615 } // namespace interpreter 649 } // namespace interpreter
616 } // namespace internal 650 } // namespace internal
617 } // namespace v8 651 } // 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