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 ExitFrame::Mode mode, | 304 StackFrame::Type frame_type, |
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 | |
349 class CEntryDebugBreakStub : public CEntryStub { | 323 class CEntryDebugBreakStub : public CEntryStub { |
350 public: | 324 public: |
351 CEntryDebugBreakStub() : CEntryStub(1) { } | 325 CEntryDebugBreakStub() : CEntryStub(1) { } |
352 | 326 |
353 void Generate(MacroAssembler* masm) { GenerateBody(masm, true); } | 327 void Generate(MacroAssembler* masm) { GenerateBody(masm, true); } |
354 | 328 |
355 private: | 329 private: |
356 int MinorKey() { return 1; } | 330 int MinorKey() { return 1; } |
357 | 331 |
358 const char* GetName() { return "CEntryDebugBreakStub"; } | 332 const char* GetName() { return "CEntryDebugBreakStub"; } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 PrintF("ArgumentsAccessStub (type %d)\n", type_); | 391 PrintF("ArgumentsAccessStub (type %d)\n", type_); |
418 } | 392 } |
419 #endif | 393 #endif |
420 }; | 394 }; |
421 | 395 |
422 | 396 |
423 } // namespace internal | 397 } // namespace internal |
424 } // namespace v8 | 398 } // namespace v8 |
425 | 399 |
426 #endif // V8_CODEGEN_H_ | 400 #endif // V8_CODEGEN_H_ |
OLD | NEW |