Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 11783055: Make the array bounds check elimination phase optional (and set the foundation for introducing SSI … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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->ApplyActualValues();
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
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
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698