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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 PrintF("Compiling stub using hydrogen\n"); | 71 PrintF("Compiling stub using hydrogen\n"); |
72 HTracer::Instance()->TraceCompilation(&info_); | 72 HTracer::Instance()->TraceCompilation(&info_); |
73 } | 73 } |
74 HBasicBlock* next_block = graph()->CreateBasicBlock(); | 74 HBasicBlock* next_block = graph()->CreateBasicBlock(); |
75 next_block->SetInitialEnvironment(graph()->start_environment()); | 75 next_block->SetInitialEnvironment(graph()->start_environment()); |
76 HGoto* jump = new(zone()) HGoto(next_block); | 76 HGoto* jump = new(zone()) HGoto(next_block); |
77 graph()->entry_block()->Finish(jump); | 77 graph()->entry_block()->Finish(jump); |
78 set_current_block(next_block); | 78 set_current_block(next_block); |
79 | 79 |
80 int major_key = stub()->MajorKey(); | 80 int major_key = stub()->MajorKey(); |
81 CodeStubInterfaceDescriptor** descriptors = | 81 CodeStubInterfaceDescriptor* descriptor = |
82 info_.isolate()->code_stub_interface_descriptors(); | 82 info_.isolate()->code_stub_interface_descriptor(major_key); |
83 if (descriptors[major_key] == NULL) { | 83 if (descriptor->register_param_count_ < 0) { |
84 descriptors[major_key] = stub()->GetInterfaceDescriptor(info_.isolate()); | 84 stub()->InitializeInterfaceDescriptor(info_.isolate(), descriptor); |
85 } | 85 } |
86 | 86 parameters_.Reset(new HParameter*[descriptor->register_param_count_]); |
87 CodeStubInterfaceDescriptor* descriptor = descriptors[major_key]; | |
88 parameters_.Reset(new HParameter*[descriptor->number_of_register_params]); | |
89 | 87 |
90 HGraph* graph = this->graph(); | 88 HGraph* graph = this->graph(); |
91 Zone* zone = this->zone(); | 89 Zone* zone = this->zone(); |
92 for (int i = 0; i < descriptor->number_of_register_params; ++i) { | 90 for (int i = 0; i < descriptor->register_param_count_; ++i) { |
93 HParameter* param = new(zone) HParameter(i); | 91 HParameter* param = new(zone) HParameter(i); |
94 AddInstruction(param); | 92 AddInstruction(param); |
95 graph->start_environment()->Push(param); | 93 graph->start_environment()->Push(param); |
96 parameters_[i] = param; | 94 parameters_[i] = param; |
97 } | 95 } |
98 AddSimulate(BailoutId::StubEntry()); | 96 AddSimulate(BailoutId::StubEntry()); |
99 | 97 |
100 BuildCodeStub(); | 98 BuildCodeStub(); |
101 | 99 |
102 return true; | 100 return true; |
(...skipping 25 matching lines...) Expand all Loading... |
128 } | 126 } |
129 | 127 |
130 | 128 |
131 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { | 129 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { |
132 CodeStubGraphBuilder<KeyedLoadFastElementStub> builder(this); | 130 CodeStubGraphBuilder<KeyedLoadFastElementStub> builder(this); |
133 return CodeFromGraph(builder.CreateGraph()); | 131 return CodeFromGraph(builder.CreateGraph()); |
134 } | 132 } |
135 | 133 |
136 | 134 |
137 } } // namespace v8::internal | 135 } } // namespace v8::internal |
OLD | NEW |