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

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

Issue 1239793002: [interpreter] Add basic framework for bytecode handler code generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix GN for realz Created 5 years, 5 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') | src/interpreter/interpreter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/interpreter/bytecodes.h"
6
7 namespace v8 {
8 namespace internal {
9 namespace interpreter {
10
11 // static
12 const char* Bytecodes::ToString(Bytecode bytecode) {
13 switch (bytecode) {
14 #define CASE(Name, _) \
15 case Bytecode::k##Name: \
16 return #Name;
17 BYTECODE_LIST(CASE)
18 #undef CASE
19 }
20 UNREACHABLE();
21 return "";
22 }
23
24
25 // static
26 const int Bytecodes::NumberOfArguments(Bytecode bytecode) {
27 switch (bytecode) {
28 #define CASE(Name, arg_count) \
29 case Bytecode::k##Name: \
30 return arg_count;
31 BYTECODE_LIST(CASE)
32 #undef CASE
33 }
34 UNREACHABLE();
35 return 0;
36 }
37
38
39 // static
40 const int Bytecodes::Size(Bytecode bytecode) {
41 return NumberOfArguments(bytecode) + 1;
42 }
43
44
45 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) {
46 return os << Bytecodes::ToString(bytecode);
47 }
48
49 } // namespace interpreter
50 } // namespace internal
51 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698