OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 cfunction_count | 160 cfunction_count |
161 }; | 161 }; |
162 | 162 |
163 enum JavaScript { | 163 enum JavaScript { |
164 #define DEF_ENUM(name, ignore) name, | 164 #define DEF_ENUM(name, ignore) name, |
165 BUILTINS_LIST_JS(DEF_ENUM) | 165 BUILTINS_LIST_JS(DEF_ENUM) |
166 #undef DEF_ENUM | 166 #undef DEF_ENUM |
167 id_count | 167 id_count |
168 }; | 168 }; |
169 | 169 |
170 static bool IsConstructCall(Address pc); | |
171 static bool IsArgumentsAdaptorCall(Address pc); | |
172 | |
173 static Code* builtin(Name name) { | 170 static Code* builtin(Name name) { |
174 // Code::cast cannot be used here since we access builtins | 171 // Code::cast cannot be used here since we access builtins |
175 // during the marking phase of mark sweep. See IC::Clear. | 172 // during the marking phase of mark sweep. See IC::Clear. |
176 return reinterpret_cast<Code*>(builtins_[name]); | 173 return reinterpret_cast<Code*>(builtins_[name]); |
177 } | 174 } |
178 | 175 |
179 static Address builtin_address(Name name) { | 176 static Address builtin_address(Name name) { |
180 return reinterpret_cast<Address>(&builtins_[name]); | 177 return reinterpret_cast<Address>(&builtins_[name]); |
181 } | 178 } |
182 | 179 |
(...skipping 16 matching lines...) Expand all Loading... |
199 static Address c_functions_[cfunction_count]; | 196 static Address c_functions_[cfunction_count]; |
200 | 197 |
201 // Note: These are always Code objects, but to conform with | 198 // Note: These are always Code objects, but to conform with |
202 // IterateBuiltins() above which assumes Object**'s for the callback | 199 // IterateBuiltins() above which assumes Object**'s for the callback |
203 // function f, we use an Object* array here. | 200 // function f, we use an Object* array here. |
204 static Object* builtins_[builtin_count]; | 201 static Object* builtins_[builtin_count]; |
205 static const char* names_[builtin_count]; | 202 static const char* names_[builtin_count]; |
206 static const char* javascript_names_[id_count]; | 203 static const char* javascript_names_[id_count]; |
207 static int javascript_argc_[id_count]; | 204 static int javascript_argc_[id_count]; |
208 | 205 |
209 // The offset from the beginning of the JSConstructCall builtin code | |
210 // object to the return address after the call. Used for determining | |
211 // if a call is a constructor invocation. | |
212 static int construct_call_pc_offset_; | |
213 static int arguments_adaptor_call_pc_offset_; | |
214 | |
215 static void Generate_Adaptor(MacroAssembler* masm, CFunctionId id); | 206 static void Generate_Adaptor(MacroAssembler* masm, CFunctionId id); |
216 static void Generate_JSConstructCall(MacroAssembler* masm); | 207 static void Generate_JSConstructCall(MacroAssembler* masm); |
217 static void Generate_JSEntryTrampoline(MacroAssembler* masm); | 208 static void Generate_JSEntryTrampoline(MacroAssembler* masm); |
218 static void Generate_JSConstructEntryTrampoline(MacroAssembler* masm); | 209 static void Generate_JSConstructEntryTrampoline(MacroAssembler* masm); |
219 static void Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm); | 210 static void Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm); |
220 | 211 |
221 static void Generate_FunctionCall(MacroAssembler* masm); | 212 static void Generate_FunctionCall(MacroAssembler* masm); |
222 static void Generate_FunctionApply(MacroAssembler* masm); | 213 static void Generate_FunctionApply(MacroAssembler* masm); |
223 | 214 |
224 static void Generate_LoadIC_DebugBreak(MacroAssembler* masm); | 215 static void Generate_LoadIC_DebugBreak(MacroAssembler* masm); |
225 static void Generate_StoreIC_DebugBreak(MacroAssembler* masm); | 216 static void Generate_StoreIC_DebugBreak(MacroAssembler* masm); |
226 static void Generate_KeyedLoadIC_DebugBreak(MacroAssembler* masm); | 217 static void Generate_KeyedLoadIC_DebugBreak(MacroAssembler* masm); |
227 static void Generate_KeyedStoreIC_DebugBreak(MacroAssembler* masm); | 218 static void Generate_KeyedStoreIC_DebugBreak(MacroAssembler* masm); |
228 static void Generate_ConstructCall_DebugBreak(MacroAssembler* masm); | 219 static void Generate_ConstructCall_DebugBreak(MacroAssembler* masm); |
229 static void Generate_Return_DebugBreak(MacroAssembler* masm); | 220 static void Generate_Return_DebugBreak(MacroAssembler* masm); |
230 static void Generate_Return_DebugBreakEntry(MacroAssembler* masm); | 221 static void Generate_Return_DebugBreakEntry(MacroAssembler* masm); |
231 static void Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm); | 222 static void Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm); |
232 }; | 223 }; |
233 | 224 |
234 } } // namespace v8::internal | 225 } } // namespace v8::internal |
235 | 226 |
236 #endif // V8_BUILTINS_H_ | 227 #endif // V8_BUILTINS_H_ |
OLD | NEW |