OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #if defined(V8_TARGET_ARCH_X64) | 30 #if defined(V8_TARGET_ARCH_X64) |
31 | 31 |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "builtins-decls.h" | |
34 #include "code-stubs.h" | 33 #include "code-stubs.h" |
35 #include "regexp-macro-assembler.h" | 34 #include "regexp-macro-assembler.h" |
36 #include "stub-cache.h" | 35 #include "stub-cache.h" |
37 #include "runtime.h" | 36 #include "runtime.h" |
38 | 37 |
39 namespace v8 { | 38 namespace v8 { |
40 namespace internal { | 39 namespace internal { |
41 | 40 |
42 | 41 |
43 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 42 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 static Register registers[] = { rdi, rbx }; | 125 static Register registers[] = { rdi, rbx }; |
127 descriptor->register_param_count_ = 2; | 126 descriptor->register_param_count_ = 2; |
128 if (constant_stack_parameter_count != 0) { | 127 if (constant_stack_parameter_count != 0) { |
129 // stack param count needs (constructor pointer, and single argument) | 128 // stack param count needs (constructor pointer, and single argument) |
130 descriptor->stack_parameter_count_ = &rax; | 129 descriptor->stack_parameter_count_ = &rax; |
131 } | 130 } |
132 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 131 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
133 descriptor->register_params_ = registers; | 132 descriptor->register_params_ = registers; |
134 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 133 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
135 descriptor->deoptimization_handler_ = | 134 descriptor->deoptimization_handler_ = |
136 FUNCTION_ADDR(ArrayConstructor_StubFailure); | 135 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; |
137 } | 136 } |
138 | 137 |
139 | 138 |
140 static void InitializeInternalArrayConstructorDescriptor( | 139 static void InitializeInternalArrayConstructorDescriptor( |
141 Isolate* isolate, | 140 Isolate* isolate, |
142 CodeStubInterfaceDescriptor* descriptor, | 141 CodeStubInterfaceDescriptor* descriptor, |
143 int constant_stack_parameter_count) { | 142 int constant_stack_parameter_count) { |
144 // register state | 143 // register state |
145 // rax -- number of arguments | 144 // rax -- number of arguments |
146 // rdi -- constructor function | 145 // rdi -- constructor function |
147 static Register registers[] = { rdi }; | 146 static Register registers[] = { rdi }; |
148 descriptor->register_param_count_ = 1; | 147 descriptor->register_param_count_ = 1; |
149 | 148 |
150 if (constant_stack_parameter_count != 0) { | 149 if (constant_stack_parameter_count != 0) { |
151 // stack param count needs (constructor pointer, and single argument) | 150 // stack param count needs (constructor pointer, and single argument) |
152 descriptor->stack_parameter_count_ = &rax; | 151 descriptor->stack_parameter_count_ = &rax; |
153 } | 152 } |
154 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 153 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
155 descriptor->register_params_ = registers; | 154 descriptor->register_params_ = registers; |
156 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 155 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
157 descriptor->deoptimization_handler_ = | 156 descriptor->deoptimization_handler_ = |
158 FUNCTION_ADDR(InternalArrayConstructor_StubFailure); | 157 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; |
159 } | 158 } |
160 | 159 |
161 | 160 |
162 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 161 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
163 Isolate* isolate, | 162 Isolate* isolate, |
164 CodeStubInterfaceDescriptor* descriptor) { | 163 CodeStubInterfaceDescriptor* descriptor) { |
165 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 164 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
166 } | 165 } |
167 | 166 |
168 | 167 |
(...skipping 6927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7096 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 7095 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
7097 } | 7096 } |
7098 } | 7097 } |
7099 | 7098 |
7100 | 7099 |
7101 #undef __ | 7100 #undef __ |
7102 | 7101 |
7103 } } // namespace v8::internal | 7102 } } // namespace v8::internal |
7104 | 7103 |
7105 #endif // V8_TARGET_ARCH_X64 | 7104 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |