blob: 667f0fd6d7cf67e21e935991725bccffc66a91e0 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2012 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_X87_SIMULATOR_X87_H_
6#define V8_X87_SIMULATOR_X87_H_
7
8#include "src/allocation.h"
9
10namespace v8 {
11namespace internal {
12
13// Since there is no simulator for the ia32 architecture the only thing we can
14// do is to call the entry directly.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000015#define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000016 (entry(p0, p1, p2, p3, p4))
17
18
19typedef int (*regexp_matcher)(String*, int, const byte*,
20 const byte*, int*, int, Address, int, Isolate*);
21
22// Call the generated regexp code directly. The code at the entry address should
23// expect eight int/pointer sized arguments and return an int.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000024#define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
25 p7, p8) \
Ben Murdochb8a8cc12014-11-26 15:28:44 +000026 (FUNCTION_CAST<regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, p8))
27
28
29// The stack limit beyond which we will throw stack overflow errors in
30// generated code. Because generated code on ia32 uses the C stack, we
31// just use the C stack limit.
32class SimulatorStack : public v8::internal::AllStatic {
33 public:
34 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
35 uintptr_t c_limit) {
36 USE(isolate);
37 return c_limit;
38 }
39
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000040 static inline uintptr_t RegisterCTryCatch(Isolate* isolate,
41 uintptr_t try_catch_address) {
42 USE(isolate);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000043 return try_catch_address;
44 }
45
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000046 static inline void UnregisterCTryCatch(Isolate* isolate) { USE(isolate); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +000047};
48
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000049} // namespace internal
50} // namespace v8
Ben Murdochb8a8cc12014-11-26 15:28:44 +000051
52#endif // V8_X87_SIMULATOR_X87_H_