Chromium Code Reviews| 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(), |
| 85 descriptor); | |
|
Jakob Kummerow
2012/12/05 16:14:33
nit: fits on one line?
danno
2012/12/05 16:16:51
Done.
| |
| 85 } | 86 } |
| 86 | 87 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 | 88 |
| 90 HGraph* graph = this->graph(); | 89 HGraph* graph = this->graph(); |
| 91 Zone* zone = this->zone(); | 90 Zone* zone = this->zone(); |
| 92 for (int i = 0; i < descriptor->number_of_register_params; ++i) { | 91 for (int i = 0; i < descriptor->register_param_count_; ++i) { |
| 93 HParameter* param = new(zone) HParameter(i); | 92 HParameter* param = new(zone) HParameter(i); |
| 94 AddInstruction(param); | 93 AddInstruction(param); |
| 95 graph->start_environment()->Push(param); | 94 graph->start_environment()->Push(param); |
| 96 parameters_[i] = param; | 95 parameters_[i] = param; |
| 97 } | 96 } |
| 98 AddSimulate(BailoutId::StubEntry()); | 97 AddSimulate(BailoutId::StubEntry()); |
| 99 | 98 |
| 100 BuildCodeStub(); | 99 BuildCodeStub(); |
| 101 | 100 |
| 102 return true; | 101 return true; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 128 } | 127 } |
| 129 | 128 |
| 130 | 129 |
| 131 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { | 130 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { |
| 132 CodeStubGraphBuilder<KeyedLoadFastElementStub> builder(this); | 131 CodeStubGraphBuilder<KeyedLoadFastElementStub> builder(this); |
| 133 return CodeFromGraph(builder.CreateGraph()); | 132 return CodeFromGraph(builder.CreateGraph()); |
| 134 } | 133 } |
| 135 | 134 |
| 136 | 135 |
| 137 } } // namespace v8::internal | 136 } } // namespace v8::internal |
| OLD | NEW |