1 // Copyright 2016 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 #ifndef V8_ASMJS_SWITCH_LOGIC_H_ 6 #define V8_ASMJS_SWITCH_LOGIC_H_ 7 8 #include "src/globals.h" 9 #include "src/zone/zone-containers.h" 10 #include "src/zone/zone.h" 11 12 namespace v8 { 13 namespace internal { 14 namespace wasm { 15 16 struct CaseNode : public ZoneObject { 17 const int begin; 18 const int end; 19 CaseNode* left; 20 CaseNode* right; CaseNodeCaseNode21 CaseNode(int begin, int end) : begin(begin), end(end) { 22 left = nullptr; 23 right = nullptr; 24 } 25 }; 26 27 V8_EXPORT_PRIVATE CaseNode* OrderCases(ZoneVector<int>* cases, Zone* zone); 28 29 } // namespace wasm 30 } // namespace internal 31 } // namespace v8 32 33 #endif // V8_ASMJS_SWITCH_LOGIC_H_ 34