| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 namespace v8 { | 34 namespace v8 { |
| 35 namespace internal { | 35 namespace internal { |
| 36 | 36 |
| 37 | 37 |
| 38 Handle<Code> HydrogenCodeStub::CodeFromGraph(HGraph* graph) { | 38 Handle<Code> HydrogenCodeStub::CodeFromGraph(HGraph* graph) { |
| 39 graph->OrderBlocks(); | 39 graph->OrderBlocks(); |
| 40 graph->AssignDominators(); | 40 graph->AssignDominators(); |
| 41 graph->CollectPhis(); | 41 graph->CollectPhis(); |
| 42 graph->InsertRepresentationChanges(); | 42 graph->InsertRepresentationChanges(); |
| 43 graph->EliminateRedundantBoundsChecks(); | 43 graph->RestoreActualValues(); |
| 44 LChunk* chunk = LChunk::NewChunk(graph); | 44 LChunk* chunk = LChunk::NewChunk(graph); |
| 45 ASSERT(chunk != NULL); | 45 ASSERT(chunk != NULL); |
| 46 Handle<Code> stub = chunk->Codegen(Code::COMPILED_STUB); | 46 Handle<Code> stub = chunk->Codegen(Code::COMPILED_STUB); |
| 47 return stub; | 47 return stub; |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 class CodeStubGraphBuilderBase : public HGraphBuilder { | 51 class CodeStubGraphBuilderBase : public HGraphBuilder { |
| 52 public: | 52 public: |
| 53 CodeStubGraphBuilderBase(Isolate* isolate, HydrogenCodeStub* stub) | 53 CodeStubGraphBuilderBase(Isolate* isolate, HydrogenCodeStub* stub) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 Stub* casted_stub() { return static_cast<Stub*>(stub()); } | 116 Stub* casted_stub() { return static_cast<Stub*>(stub()); } |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 | 119 |
| 120 template <> | 120 template <> |
| 121 void CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { | 121 void CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { |
| 122 Zone* zone = this->zone(); | 122 Zone* zone = this->zone(); |
| 123 | 123 |
| 124 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 124 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
| 125 GetParameter(0), GetParameter(1), NULL, NULL, | 125 GetParameter(0), GetParameter(1), NULL, NULL, |
| 126 casted_stub()->is_js_array(), casted_stub()->elements_kind(), false); | 126 casted_stub()->is_js_array(), casted_stub()->elements_kind(), |
| 127 false, Representation::Tagged()); |
| 127 AddInstruction(load); | 128 AddInstruction(load); |
| 128 | 129 |
| 129 HReturn* ret = new(zone) HReturn(load, context()); | 130 HReturn* ret = new(zone) HReturn(load, context()); |
| 130 current_block()->Finish(ret); | 131 current_block()->Finish(ret); |
| 131 } | 132 } |
| 132 | 133 |
| 133 | 134 |
| 134 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { | 135 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { |
| 135 CodeStubGraphBuilder<KeyedLoadFastElementStub> builder(this); | 136 CodeStubGraphBuilder<KeyedLoadFastElementStub> builder(this); |
| 136 return CodeFromGraph(builder.CreateGraph()); | 137 return CodeFromGraph(builder.CreateGraph()); |
| 137 } | 138 } |
| 138 | 139 |
| 139 | 140 |
| 140 } } // namespace v8::internal | 141 } } // namespace v8::internal |
| OLD | NEW |