Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef V8_WASM_OPCODES_H_ | 5 #ifndef V8_WASM_OPCODES_H_ |
| 6 #define V8_WASM_OPCODES_H_ | 6 #define V8_WASM_OPCODES_H_ |
| 7 | 7 |
| 8 #include "src/globals.h" | 8 #include "src/globals.h" |
| 9 #include "src/machine-type.h" | 9 #include "src/machine-type.h" |
| 10 #include "src/runtime/runtime.h" | |
|
titzer
2016/12/15 14:21:08
I think it's best not to include the runtime heade
ahaas
2016/12/15 16:55:51
I moved the function to wasm-compiler.cc
| |
| 10 #include "src/signature.h" | 11 #include "src/signature.h" |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 namespace wasm { | 15 namespace wasm { |
| 15 | 16 |
| 16 // Binary encoding of local types. | 17 // Binary encoding of local types. |
| 17 enum LocalTypeCode { | 18 enum LocalTypeCode { |
| 18 kLocalVoid = 0x40, | 19 kLocalVoid = 0x40, |
| 19 kLocalI32 = 0x7f, | 20 kLocalI32 = 0x7f, |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 526 public: | 527 public: |
| 527 static const char* OpcodeName(WasmOpcode opcode); | 528 static const char* OpcodeName(WasmOpcode opcode); |
| 528 static const char* ShortOpcodeName(WasmOpcode opcode); | 529 static const char* ShortOpcodeName(WasmOpcode opcode); |
| 529 static FunctionSig* Signature(WasmOpcode opcode); | 530 static FunctionSig* Signature(WasmOpcode opcode); |
| 530 static FunctionSig* AsmjsSignature(WasmOpcode opcode); | 531 static FunctionSig* AsmjsSignature(WasmOpcode opcode); |
| 531 static FunctionSig* AtomicSignature(WasmOpcode opcode); | 532 static FunctionSig* AtomicSignature(WasmOpcode opcode); |
| 532 static bool IsPrefixOpcode(WasmOpcode opcode); | 533 static bool IsPrefixOpcode(WasmOpcode opcode); |
| 533 | 534 |
| 534 static int TrapReasonToMessageId(TrapReason reason); | 535 static int TrapReasonToMessageId(TrapReason reason); |
| 535 static const char* TrapReasonMessage(TrapReason reason); | 536 static const char* TrapReasonMessage(TrapReason reason); |
| 536 static int32_t TrapReasonToFunctionId(TrapReason reason); | 537 static Runtime::FunctionId TrapReasonToFunctionId(TrapReason reason); |
| 537 | 538 |
| 538 static byte MemSize(MachineType type) { | 539 static byte MemSize(MachineType type) { |
| 539 return 1 << ElementSizeLog2Of(type.representation()); | 540 return 1 << ElementSizeLog2Of(type.representation()); |
| 540 } | 541 } |
| 541 | 542 |
| 542 static byte MemSize(LocalType type) { return 1 << ElementSizeLog2Of(type); } | 543 static byte MemSize(LocalType type) { return 1 << ElementSizeLog2Of(type); } |
| 543 | 544 |
| 544 static LocalTypeCode LocalTypeCodeFor(LocalType type) { | 545 static LocalTypeCode LocalTypeCodeFor(LocalType type) { |
| 545 switch (type) { | 546 switch (type) { |
| 546 case kAstI32: | 547 case kAstI32: |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 678 default: | 679 default: |
| 679 return "<unknown>"; | 680 return "<unknown>"; |
| 680 } | 681 } |
| 681 } | 682 } |
| 682 }; | 683 }; |
| 683 } // namespace wasm | 684 } // namespace wasm |
| 684 } // namespace internal | 685 } // namespace internal |
| 685 } // namespace v8 | 686 } // namespace v8 |
| 686 | 687 |
| 687 #endif // V8_WASM_OPCODES_H_ | 688 #endif // V8_WASM_OPCODES_H_ |
| OLD | NEW |