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

Unified Diff: src/ic/ia32/handler-compiler-ia32.cc

Issue 508643002: Vector-ic project, current state (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added platform dependent version of dispatchers. Created 6 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/ic/handler-compiler.cc ('k') | src/ic/ia32/ic-compiler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ia32/handler-compiler-ia32.cc
diff --git a/src/ic/ia32/handler-compiler-ia32.cc b/src/ic/ia32/handler-compiler-ia32.cc
index d0b940bcc550b38711f3b28fde0eaa337d0a3ac5..f438dad19b78e1aed4425a83fd79e445e59a48ec 100644
--- a/src/ic/ia32/handler-compiler-ia32.cc
+++ b/src/ic/ia32/handler-compiler-ia32.cc
@@ -47,6 +47,41 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
}
+void PropertyHandlerCompiler::PushVectorAndSlot() {
+ MacroAssembler* masm = this->masm();
+ __ push(VectorLoadICDescriptor::VectorRegister());
+ __ push(VectorLoadICDescriptor::SlotRegister());
+}
+
+
+void PropertyHandlerCompiler::PopVectorAndSlot() {
+ MacroAssembler* masm = this->masm();
+ __ pop(VectorLoadICDescriptor::SlotRegister());
+ __ pop(VectorLoadICDescriptor::VectorRegister());
+}
+
+
+void PropertyHandlerCompiler::PushVectorAndSlot(Register vector,
+ Register slot) {
+ MacroAssembler* masm = this->masm();
+ __ push(vector);
+ __ push(slot);
+}
+
+
+void PropertyHandlerCompiler::PopVectorAndSlot(Register vector, Register slot) {
+ MacroAssembler* masm = this->masm();
+ __ pop(slot);
+ __ pop(vector);
+}
+
+
+void PropertyHandlerCompiler::DiscardVectorAndSlot() {
+ MacroAssembler* masm = this->masm();
+ __ add(esp, Immediate(2 * kPointerSize)); // remove vector and slot
+}
+
+
void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup(
MacroAssembler* masm, Label* miss_label, Register receiver,
Handle<Name> name, Register scratch0, Register scratch1) {
@@ -110,6 +145,7 @@ void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
MacroAssembler* masm, Register receiver, Register scratch1,
Register scratch2, Label* miss_label) {
+ DCHECK(!FLAG_vector_ics);
__ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
__ mov(eax, scratch1);
__ ret(0);
@@ -467,6 +503,10 @@ void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
Label success;
__ jmp(&success);
__ bind(miss);
+ if (FLAG_vector_ics) {
+ DCHECK(kind() == Code::LOAD_IC);
+ PopVectorAndSlot();
+ }
TailCallBuiltin(masm(), MissBuiltin(kind()));
__ bind(&success);
}
@@ -566,7 +606,15 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup(
}
__ push(holder_reg);
__ push(this->name());
-
+ if (FLAG_vector_ics &&
+ (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
+ // The vector and slot values are already saved on the stack.
+ if (!holder_reg.is(receiver())) {
+ PushVectorAndSlot(scratch2(), scratch3());
+ } else {
+ PushVectorAndSlot();
+ }
+ }
// Invoke an interceptor. Note: map checks from receiver to
// interceptor's holder has been compiled before (see a caller
// of this method.)
@@ -590,6 +638,14 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup(
__ mov(this->name(), Immediate(bit_cast<int32_t>(kZapValue)));
}
+ if (FLAG_vector_ics &&
+ (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
+ if (!holder_reg.is(receiver())) {
+ PopVectorAndSlot(scratch2(), scratch3());
+ } else {
+ PopVectorAndSlot();
+ }
+ }
__ pop(this->name());
__ pop(holder_reg);
if (must_preserve_receiver_reg) {
@@ -668,7 +724,10 @@ Register NamedStoreHandlerCompiler::value() {
Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
Label miss;
-
+ if (FLAG_vector_ics &&
+ (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
+ PushVectorAndSlot();
+ }
FrontendHeader(receiver(), name, &miss);
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
@@ -691,6 +750,10 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
Counters* counters = isolate()->counters();
__ IncrementCounter(counters->named_load_global_stub(), 1);
// The code above already loads the result into the return register.
+ if (FLAG_vector_ics &&
+ (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
+ DiscardVectorAndSlot();
+ }
__ ret(0);
FrontendFooter(name, &miss);
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/ia32/ic-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698