OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // 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 | 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 const Register InterfaceDescriptor::ContextRegister() { return esi; } | 14 const Register InterfaceDescriptor::ContextRegister() { return cp; } |
15 | 15 |
16 | 16 |
17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
18 { | 18 { |
19 CallInterfaceDescriptor* descriptor = | 19 CallInterfaceDescriptor* descriptor = |
20 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); | 20 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); |
21 Register registers[] = { | 21 Register registers[] = { cp, // context |
22 esi, // context | 22 a1, // JSFunction |
23 edi, // JSFunction | 23 a0, // actual number of arguments |
24 eax, // actual number of arguments | 24 a2, // expected number of arguments |
25 ebx, // expected number of arguments | |
26 }; | 25 }; |
27 Representation representations[] = { | 26 Representation representations[] = { |
28 Representation::Tagged(), // context | 27 Representation::Tagged(), // context |
29 Representation::Tagged(), // JSFunction | 28 Representation::Tagged(), // JSFunction |
30 Representation::Integer32(), // actual number of arguments | 29 Representation::Integer32(), // actual number of arguments |
31 Representation::Integer32(), // expected number of arguments | 30 Representation::Integer32(), // expected number of arguments |
32 }; | 31 }; |
33 descriptor->Initialize(arraysize(registers), registers, representations); | 32 descriptor->Initialize(arraysize(registers), registers, representations); |
34 } | 33 } |
35 { | 34 { |
36 CallInterfaceDescriptor* descriptor = | 35 CallInterfaceDescriptor* descriptor = |
37 isolate->call_descriptor(CallDescriptorKey::KeyedCall); | 36 isolate->call_descriptor(CallDescriptorKey::KeyedCall); |
38 Register registers[] = { | 37 Register registers[] = { cp, // context |
39 esi, // context | 38 a2, // key |
40 ecx, // key | |
41 }; | 39 }; |
42 Representation representations[] = { | 40 Representation representations[] = { |
43 Representation::Tagged(), // context | 41 Representation::Tagged(), // context |
44 Representation::Tagged(), // key | 42 Representation::Tagged(), // key |
45 }; | 43 }; |
46 descriptor->Initialize(arraysize(registers), registers, representations); | 44 descriptor->Initialize(arraysize(registers), registers, representations); |
47 } | 45 } |
48 { | 46 { |
49 CallInterfaceDescriptor* descriptor = | 47 CallInterfaceDescriptor* descriptor = |
50 isolate->call_descriptor(CallDescriptorKey::NamedCall); | 48 isolate->call_descriptor(CallDescriptorKey::NamedCall); |
51 Register registers[] = { | 49 Register registers[] = { cp, // context |
52 esi, // context | 50 a2, // name |
53 ecx, // name | |
54 }; | 51 }; |
55 Representation representations[] = { | 52 Representation representations[] = { |
56 Representation::Tagged(), // context | 53 Representation::Tagged(), // context |
57 Representation::Tagged(), // name | 54 Representation::Tagged(), // name |
58 }; | 55 }; |
59 descriptor->Initialize(arraysize(registers), registers, representations); | 56 descriptor->Initialize(arraysize(registers), registers, representations); |
60 } | 57 } |
61 { | 58 { |
62 CallInterfaceDescriptor* descriptor = | 59 CallInterfaceDescriptor* descriptor = |
63 isolate->call_descriptor(CallDescriptorKey::CallHandler); | 60 isolate->call_descriptor(CallDescriptorKey::CallHandler); |
64 Register registers[] = { | 61 Register registers[] = { cp, // context |
65 esi, // context | 62 a0, // receiver |
66 edx, // name | |
67 }; | 63 }; |
68 Representation representations[] = { | 64 Representation representations[] = { |
69 Representation::Tagged(), // context | 65 Representation::Tagged(), // context |
70 Representation::Tagged(), // receiver | 66 Representation::Tagged(), // receiver |
71 }; | 67 }; |
72 descriptor->Initialize(arraysize(registers), registers, representations); | 68 descriptor->Initialize(arraysize(registers), registers, representations); |
73 } | 69 } |
74 { | 70 { |
75 CallInterfaceDescriptor* descriptor = | 71 CallInterfaceDescriptor* descriptor = |
76 isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); | 72 isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); |
77 Register registers[] = { | 73 Register registers[] = { cp, // context |
78 esi, // context | 74 a0, // callee |
79 eax, // callee | 75 a4, // call_data |
80 ebx, // call_data | 76 a2, // holder |
81 ecx, // holder | 77 a1, // api_function_address |
82 edx, // api_function_address | |
83 }; | 78 }; |
84 Representation representations[] = { | 79 Representation representations[] = { |
85 Representation::Tagged(), // context | 80 Representation::Tagged(), // context |
86 Representation::Tagged(), // callee | 81 Representation::Tagged(), // callee |
87 Representation::Tagged(), // call_data | 82 Representation::Tagged(), // call_data |
88 Representation::Tagged(), // holder | 83 Representation::Tagged(), // holder |
89 Representation::External(), // api_function_address | 84 Representation::External(), // api_function_address |
90 }; | 85 }; |
91 descriptor->Initialize(arraysize(registers), registers, representations); | 86 descriptor->Initialize(arraysize(registers), registers, representations); |
92 } | 87 } |
93 } | 88 } |
94 } | 89 } |
95 } // namespace v8::internal | 90 } // namespace v8::internal |
96 | 91 |
97 #endif // V8_TARGET_ARCH_IA32 | 92 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |