4b52882b0c3df71920893edd14c116db1c2ac310
[platform/upstream/nodejs.git] / deps / v8 / src / ppc / frames-ppc.cc
1 // Copyright 2014 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/v8.h"
6
7 #if V8_TARGET_ARCH_PPC
8
9 #include "src/assembler.h"
10 #include "src/frames.h"
11 #include "src/macro-assembler.h"
12
13 #include "src/ppc/assembler-ppc.h"
14 #include "src/ppc/assembler-ppc-inl.h"
15 #include "src/ppc/macro-assembler-ppc.h"
16
17 namespace v8 {
18 namespace internal {
19
20
21 Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
22 Register JavaScriptFrame::context_register() { return cp; }
23 Register JavaScriptFrame::constant_pool_pointer_register() {
24 #if V8_OOL_CONSTANT_POOL
25   DCHECK(FLAG_enable_ool_constant_pool);
26   return kConstantPoolRegister;
27 #else
28   UNREACHABLE();
29   return no_reg;
30 #endif
31 }
32
33
34 Register StubFailureTrampolineFrame::fp_register() { return v8::internal::fp; }
35 Register StubFailureTrampolineFrame::context_register() { return cp; }
36 Register StubFailureTrampolineFrame::constant_pool_pointer_register() {
37 #if V8_OOL_CONSTANT_POOL
38   DCHECK(FLAG_enable_ool_constant_pool);
39   return kConstantPoolRegister;
40 #else
41   UNREACHABLE();
42   return no_reg;
43 #endif
44 }
45
46
47 Object*& ExitFrame::constant_pool_slot() const {
48 #if V8_OOL_CONSTANT_POOL
49   DCHECK(FLAG_enable_ool_constant_pool);
50   const int offset = ExitFrameConstants::kConstantPoolOffset;
51   return Memory::Object_at(fp() + offset);
52 #else
53   UNREACHABLE();
54   return Memory::Object_at(NULL);
55 #endif
56 }
57 }
58 }  // namespace v8::internal
59
60 #endif  // V8_TARGET_ARCH_PPC