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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 explicit CEntryStub(int result_size) : result_size_(result_size) { } | 294 explicit CEntryStub(int result_size) : result_size_(result_size) { } |
295 | 295 |
296 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } | 296 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } |
297 | 297 |
298 protected: | 298 protected: |
299 void GenerateBody(MacroAssembler* masm, bool is_debug_break); | 299 void GenerateBody(MacroAssembler* masm, bool is_debug_break); |
300 void GenerateCore(MacroAssembler* masm, | 300 void GenerateCore(MacroAssembler* masm, |
301 Label* throw_normal_exception, | 301 Label* throw_normal_exception, |
302 Label* throw_termination_exception, | 302 Label* throw_termination_exception, |
303 Label* throw_out_of_memory_exception, | 303 Label* throw_out_of_memory_exception, |
304 StackFrame::Type frame_type, | 304 ExitFrame::Mode mode, |
305 bool do_gc, | 305 bool do_gc, |
306 bool always_allocate_scope); | 306 bool always_allocate_scope); |
307 void GenerateThrowTOS(MacroAssembler* masm); | 307 void GenerateThrowTOS(MacroAssembler* masm); |
308 void GenerateThrowUncatchable(MacroAssembler* masm, | 308 void GenerateThrowUncatchable(MacroAssembler* masm, |
309 UncatchableExceptionType type); | 309 UncatchableExceptionType type); |
310 private: | 310 private: |
311 // Number of pointers/values returned. | 311 // Number of pointers/values returned. |
312 int result_size_; | 312 int result_size_; |
313 | 313 |
314 Major MajorKey() { return CEntry; } | 314 Major MajorKey() { return CEntry; } |
315 // Minor key must differ if different result_size_ values means different | 315 // Minor key must differ if different result_size_ values means different |
316 // code is generated. | 316 // code is generated. |
317 int MinorKey(); | 317 int MinorKey(); |
318 | 318 |
319 const char* GetName() { return "CEntryStub"; } | 319 const char* GetName() { return "CEntryStub"; } |
320 }; | 320 }; |
321 | 321 |
322 | 322 |
| 323 class ApiGetterEntryStub : public CodeStub { |
| 324 public: |
| 325 ApiGetterEntryStub(Handle<AccessorInfo> info, |
| 326 ApiFunction* fun) |
| 327 : info_(info), |
| 328 fun_(fun) { } |
| 329 void Generate(MacroAssembler* masm); |
| 330 virtual bool has_custom_cache() { return true; } |
| 331 virtual bool GetCustomCache(Code** code_out); |
| 332 virtual void SetCustomCache(Code* value); |
| 333 |
| 334 static const int kStackSpace = 6; |
| 335 static const int kArgc = 4; |
| 336 private: |
| 337 Handle<AccessorInfo> info() { return info_; } |
| 338 ApiFunction* fun() { return fun_; } |
| 339 Major MajorKey() { return NoCache; } |
| 340 int MinorKey() { return 0; } |
| 341 const char* GetName() { return "ApiEntryStub"; } |
| 342 // The accessor info associated with the function. |
| 343 Handle<AccessorInfo> info_; |
| 344 // The function to be called. |
| 345 ApiFunction* fun_; |
| 346 }; |
| 347 |
| 348 |
323 class CEntryDebugBreakStub : public CEntryStub { | 349 class CEntryDebugBreakStub : public CEntryStub { |
324 public: | 350 public: |
325 CEntryDebugBreakStub() : CEntryStub(1) { } | 351 CEntryDebugBreakStub() : CEntryStub(1) { } |
326 | 352 |
327 void Generate(MacroAssembler* masm) { GenerateBody(masm, true); } | 353 void Generate(MacroAssembler* masm) { GenerateBody(masm, true); } |
328 | 354 |
329 private: | 355 private: |
330 int MinorKey() { return 1; } | 356 int MinorKey() { return 1; } |
331 | 357 |
332 const char* GetName() { return "CEntryDebugBreakStub"; } | 358 const char* GetName() { return "CEntryDebugBreakStub"; } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 PrintF("ArgumentsAccessStub (type %d)\n", type_); | 417 PrintF("ArgumentsAccessStub (type %d)\n", type_); |
392 } | 418 } |
393 #endif | 419 #endif |
394 }; | 420 }; |
395 | 421 |
396 | 422 |
397 } // namespace internal | 423 } // namespace internal |
398 } // namespace v8 | 424 } // namespace v8 |
399 | 425 |
400 #endif // V8_CODEGEN_H_ | 426 #endif // V8_CODEGEN_H_ |
OLD | NEW |