simulator-ia32.h 1.79 KB
Newer Older
1
// Copyright 2012 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4

5 6
#ifndef V8_IA32_SIMULATOR_IA32_H_
#define V8_IA32_SIMULATOR_IA32_H_
7

8
#include "src/allocation.h"
9

10 11 12
namespace v8 {
namespace internal {

13 14
// Since there is no simulator for the ia32 architecture the only thing we can
// do is to call the entry directly.
15
#define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
16 17
  (entry(p0, p1, p2, p3, p4))

18 19

typedef 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.
24 25
#define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
                                   p7, p8)                                     \
26
  (FUNCTION_CAST<regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, p8))
27

28

29 30 31 32 33
// The stack limit beyond which we will throw stack overflow errors in
// generated code. Because generated code on ia32 uses the C stack, we
// just use the C stack limit.
class SimulatorStack : public v8::internal::AllStatic {
 public:
34 35 36
  static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
                                            uintptr_t c_limit) {
    USE(isolate);
37 38
    return c_limit;
  }
39

40 41 42
  static inline uintptr_t RegisterCTryCatch(v8::internal::Isolate* isolate,
                                            uintptr_t try_catch_address) {
    USE(isolate);
43 44 45
    return try_catch_address;
  }

46 47 48
  static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) {
    USE(isolate);
  }
49
};
50

51 52
}  // namespace internal
}  // namespace v8
53

54
#endif  // V8_IA32_SIMULATOR_IA32_H_