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 23 matching lines...) Expand all Loading... |
34 #include "gdb-jit.h" | 34 #include "gdb-jit.h" |
35 #include "macro-assembler.h" | 35 #include "macro-assembler.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 | 40 |
41 CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() | 41 CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() |
42 : register_param_count_(-1), | 42 : register_param_count_(-1), |
43 stack_parameter_count_(NULL), | 43 stack_parameter_count_(NULL), |
| 44 hint_stack_parameter_count_(-1), |
44 function_mode_(NOT_JS_FUNCTION_STUB_MODE), | 45 function_mode_(NOT_JS_FUNCTION_STUB_MODE), |
45 register_params_(NULL), | 46 register_params_(NULL), |
46 deoptimization_handler_(NULL), | 47 deoptimization_handler_(NULL), |
47 miss_handler_(IC_Utility(IC::kUnreachable), Isolate::Current()) { } | 48 miss_handler_(IC_Utility(IC::kUnreachable), Isolate::Current()) { } |
48 | 49 |
49 | 50 |
50 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) { | 51 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) { |
51 UnseededNumberDictionary* stubs = isolate->heap()->code_stubs(); | 52 UnseededNumberDictionary* stubs = isolate->heap()->code_stubs(); |
52 int index = stubs->FindEntry(GetKey()); | 53 int index = stubs->FindEntry(GetKey()); |
53 if (index != UnseededNumberDictionary::kNotFound) { | 54 if (index != UnseededNumberDictionary::kNotFound) { |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 // We don't allow setting a new entry hook over one that's | 651 // We don't allow setting a new entry hook over one that's |
651 // already active, as the hooks won't stack. | 652 // already active, as the hooks won't stack. |
652 if (entry_hook != 0 && entry_hook_ != 0) | 653 if (entry_hook != 0 && entry_hook_ != 0) |
653 return false; | 654 return false; |
654 | 655 |
655 entry_hook_ = entry_hook; | 656 entry_hook_ = entry_hook; |
656 return true; | 657 return true; |
657 } | 658 } |
658 | 659 |
659 | 660 |
| 661 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { |
| 662 int major_key = stub->MajorKey(); |
| 663 CodeStubInterfaceDescriptor* descriptor = |
| 664 isolate->code_stub_interface_descriptor(major_key); |
| 665 if (!descriptor->initialized()) { |
| 666 stub->InitializeInterfaceDescriptor(isolate, descriptor); |
| 667 } |
| 668 } |
| 669 |
| 670 |
| 671 void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) { |
| 672 ArrayNoArgumentConstructorStub stub1(GetInitialFastElementsKind()); |
| 673 InstallDescriptor(isolate, &stub1); |
| 674 ArraySingleArgumentConstructorStub stub2(GetInitialFastElementsKind()); |
| 675 InstallDescriptor(isolate, &stub2); |
| 676 ArrayNArgumentsConstructorStub stub3(GetInitialFastElementsKind()); |
| 677 InstallDescriptor(isolate, &stub3); |
| 678 } |
| 679 |
| 680 |
| 681 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
| 682 : argument_count_(ANY) { |
| 683 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 684 } |
| 685 |
| 686 |
| 687 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, |
| 688 int argument_count) { |
| 689 if (argument_count == 0) { |
| 690 argument_count_ = NONE; |
| 691 } else if (argument_count == 1) { |
| 692 argument_count_ = ONE; |
| 693 } else if (argument_count >= 2) { |
| 694 argument_count_ = MORE_THAN_ONE; |
| 695 } else { |
| 696 UNREACHABLE(); |
| 697 } |
| 698 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 699 } |
| 700 |
| 701 |
660 } } // namespace v8::internal | 702 } } // namespace v8::internal |
OLD | NEW |