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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 434343005: Implement lowering of JSStoreProperty to ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index f87006f08b4c4a5d8267099cd10ad9efa0e36580..a5e1a53fc86905beaabef10eb0cc5dcdd2eee217 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -29,6 +29,40 @@ static CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate,
}
+// TODO(mstarzinger): This is a temporary shim to be able to call an IC stub
+// which doesn't have an interface descriptor yet. It mimics a hydrogen code
+// stub for the underlying IC stub code.
+class KeyedStoreICStubShim : public HydrogenCodeStub {
+ public:
+ KeyedStoreICStubShim(Isolate* isolate, StrictMode strict_mode)
+ : HydrogenCodeStub(isolate), strict_mode_(strict_mode) {
+ i::compiler::GetInterfaceDescriptor(isolate, this);
+ }
+
+ virtual Handle<Code> GenerateCode() V8_OVERRIDE {
+ return strict_mode_ == SLOPPY
+ ? isolate()->builtins()->KeyedStoreIC_Initialize()
+ : isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
+ }
+
+ virtual void InitializeInterfaceDescriptor(
+ CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE {
+ Register registers[] = { InterfaceDescriptor::ContextRegister(),
+ KeyedStoreIC::ReceiverRegister(),
+ KeyedStoreIC::NameRegister(),
+ KeyedStoreIC::ValueRegister() };
+ descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
+ }
+
+ private:
+ virtual Major MajorKey() const V8_OVERRIDE { return NoCache; }
+ virtual int NotMissMinorKey() const V8_OVERRIDE { return 0; }
+ virtual bool UseSpecialCache() V8_OVERRIDE { return true; }
+
+ StrictMode strict_mode_;
+};
+
+
JSGenericLowering::JSGenericLowering(CompilationInfo* info, JSGraph* jsgraph,
MachineOperatorBuilder* machine,
SourcePositionTable* source_positions)
@@ -321,8 +355,8 @@ Node* JSGenericLowering::LowerJSStoreProperty(Node* node) {
// TODO(mstarzinger): The strict_mode needs to be carried along in the
// operator so that graphs are fully compositional for inlining.
StrictMode strict_mode = info()->strict_mode();
- PatchInsertInput(node, 3, SmiConstant(strict_mode));
- ReplaceWithRuntimeCall(node, Runtime::kSetProperty, 4);
+ KeyedStoreICStubShim stub(isolate(), strict_mode);
+ ReplaceWithICStubCall(node, &stub);
return node;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698