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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 11550005: Elide unnecessary context reload in generated stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 74bd93f8805b768fbcb9806d2da04f754c80dfff..58e17f43f2adf7f98883e97db94b7297710949cb 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -51,17 +51,19 @@ Handle<Code> HydrogenCodeStub::CodeFromGraph(HGraph* graph) {
class CodeStubGraphBuilderBase : public HGraphBuilder {
public:
CodeStubGraphBuilderBase(Isolate* isolate, HydrogenCodeStub* stub)
- : HGraphBuilder(&info_), info_(stub, isolate) {}
+ : HGraphBuilder(&info_), info_(stub, isolate), context_(NULL) {}
virtual bool BuildGraph();
protected:
virtual void BuildCodeStub() = 0;
HParameter* GetParameter(int parameter) { return parameters_[parameter]; }
HydrogenCodeStub* stub() { return info_.code_stub(); }
+ HContext* context() { return context_; }
private:
SmartArrayPointer<HParameter*> parameters_;
CompilationInfoWithZone info_;
+ HContext* context_;
};
@@ -77,6 +79,9 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
graph()->entry_block()->Finish(jump);
set_current_block(next_block);
+ context_ = new(zone()) HContext();
+ AddInstruction(context_);
+
int major_key = stub()->MajorKey();
CodeStubInterfaceDescriptor* descriptor =
info_.isolate()->code_stub_interface_descriptor(major_key);
@@ -121,7 +126,7 @@ void CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
casted_stub()->is_js_array(), casted_stub()->elements_kind(), false);
AddInstruction(load);
- HReturn* ret = new(zone) HReturn(load);
+ HReturn* ret = new(zone) HReturn(load, context());
current_block()->Finish(ret);
}
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698