#include "src/codegen.h"
#include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
namespace v8 {
}
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- // Push receiver, key and value for runtime call.
- __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- __ mov(r0, Operand(Smi::FromInt(strict_mode))); // Strict mode.
- __ Push(r0);
-
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
static void KeyedStoreGenerateGenericHelper(
MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length,
// r0: value.
// r1: key.
// r2: receiver.
- GenerateRuntimeSetProperty(masm, strict_mode);
+ PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
// Extra capacity case: Check if there is extra capacity to
// perform the store and update the length. Used for adding one
}
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- __ mov(r0, Operand(Smi::FromInt(strict_mode)));
- __ Push(r0);
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
#undef __
}
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+ __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+ StoreIC::ValueRegister());
+
+ __ mov(r0, Operand(Smi::FromInt(strict_mode)));
+ __ Push(r0);
+
+ // Do tail-call to runtime routine.
+ __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}
+
+
#undef __
}
} // namespace v8::internal
#include "src/codegen.h"
#include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
namespace v8 {
}
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- ASM_LOCATION("KeyedStoreIC::GenerateRuntimeSetProperty");
-
- // Push receiver, key and value for runtime call.
- __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- // Push strict_mode for runtime call.
- __ Mov(x10, Smi::FromInt(strict_mode));
- __ Push(x10);
-
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
static void KeyedStoreGenerateGenericHelper(
MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length,
// x0: value
// x1: key
// x2: receiver
- GenerateRuntimeSetProperty(masm, strict_mode);
+ PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
__ Bind(&extra);
}
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- ASM_LOCATION("StoreIC::GenerateRuntimeSetProperty");
-
- __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- __ Mov(x10, Smi::FromInt(strict_mode));
- __ Push(x10);
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
void StoreIC::GenerateSlow(MacroAssembler* masm) {
// ---------- S t a t e --------------
// -- x0 : value
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}
+
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+ ASM_LOCATION("PropertyICCompiler::GenerateRuntimeSetProperty");
+
+ __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+ StoreIC::ValueRegister());
+
+ __ Mov(x10, Smi::FromInt(strict_mode));
+ __ Push(x10);
+
+ // Do tail-call to runtime routine.
+ __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}
+
+
#undef __
}
} // namespace v8::internal
}
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+ // Return address is on the stack.
+ DCHECK(!ebx.is(StoreIC::ReceiverRegister()) &&
+ !ebx.is(StoreIC::NameRegister()) && !ebx.is(StoreIC::ValueRegister()));
+ __ pop(ebx);
+ __ push(StoreIC::ReceiverRegister());
+ __ push(StoreIC::NameRegister());
+ __ push(StoreIC::ValueRegister());
+ __ push(Immediate(Smi::FromInt(strict_mode)));
+ __ push(ebx); // return address
+
+ // Do tail-call to runtime routine.
+ __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}
+
+
#undef __
}
} // namespace v8::internal
#include "src/codegen.h"
#include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
namespace v8 {
// Slow case: call runtime.
__ bind(&slow);
- GenerateRuntimeSetProperty(masm, strict_mode);
+ PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
// Extra capacity case: Check if there is extra capacity to
// perform the store and update the length. Used for adding one
}
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- // Return address is on the stack.
- DCHECK(!ebx.is(ReceiverRegister()) && !ebx.is(NameRegister()) &&
- !ebx.is(ValueRegister()));
- __ pop(ebx);
- __ push(ReceiverRegister());
- __ push(NameRegister());
- __ push(ValueRegister());
- __ push(Immediate(Smi::FromInt(strict_mode)));
- __ push(ebx); // return address
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- // Return address is on the stack.
- DCHECK(!ebx.is(ReceiverRegister()) && !ebx.is(NameRegister()) &&
- !ebx.is(ValueRegister()));
- __ pop(ebx);
- __ push(ReceiverRegister());
- __ push(NameRegister());
- __ push(ValueRegister());
- __ push(Immediate(Smi::FromInt(strict_mode)));
- __ push(ebx); // return address
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
Handle<Code> PropertyICCompiler::CompileStoreGeneric(Code::Flags flags) {
ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
StrictMode strict_mode = StoreIC::GetStrictMode(extra_state);
- StoreIC::GenerateRuntimeSetProperty(masm(), strict_mode);
+ GenerateRuntimeSetProperty(masm(), strict_mode);
Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreGeneric");
PROFILE(isolate(), CodeCreateEvent(Logger::STORE_GENERIC_TAG, *code, 0));
return code;
static Handle<Code> ComputeCompareNil(Handle<Map> receiver_map,
CompareNilICStub* stub);
+ // Helpers
+ // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler
+ // and make the helpers private.
+ static void GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode);
+
private:
PropertyICCompiler(Isolate* isolate, Code::Kind kind,
}
static void GenerateMiss(MacroAssembler* masm);
static void GenerateSlow(MacroAssembler* masm);
- static void GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode);
static void GenerateGeneric(MacroAssembler* masm, StrictMode strict_mode);
static void GenerateSloppyArguments(MacroAssembler* masm);
}
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+ // Return address is on the stack.
+ DCHECK(!rbx.is(StoreIC::ReceiverRegister()) &&
+ !rbx.is(StoreIC::NameRegister()) && !rbx.is(StoreIC::ValueRegister()));
+
+ __ PopReturnAddressTo(rbx);
+ __ Push(StoreIC::ReceiverRegister());
+ __ Push(StoreIC::NameRegister());
+ __ Push(StoreIC::ValueRegister());
+ __ Push(Smi::FromInt(strict_mode));
+ __ PushReturnAddressFrom(rbx);
+
+ // Do tail-call to runtime routine.
+ __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}
+
+
#undef __
}
} // namespace v8::internal
#include "src/codegen.h"
#include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
namespace v8 {
__ bind(&slow);
__ Integer32ToSmi(key, key);
__ bind(&slow_with_tagged_index);
- GenerateRuntimeSetProperty(masm, strict_mode);
+ PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
// Never returns to here.
// Extra capacity case: Check if there is extra capacity to
}
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- // Return address is on the stack.
- DCHECK(!rbx.is(ReceiverRegister()) && !rbx.is(NameRegister()) &&
- !rbx.is(ValueRegister()));
-
- __ PopReturnAddressTo(rbx);
- __ Push(ReceiverRegister());
- __ Push(NameRegister());
- __ Push(ValueRegister());
- __ Push(Smi::FromInt(strict_mode));
- __ PushReturnAddressFrom(rbx);
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
- StrictMode strict_mode) {
- // Return address is on the stack.
- DCHECK(!rbx.is(ReceiverRegister()) && !rbx.is(NameRegister()) &&
- !rbx.is(ValueRegister()));
-
- __ PopReturnAddressTo(rbx);
- __ Push(ReceiverRegister());
- __ Push(NameRegister());
- __ Push(ValueRegister());
- __ Push(Smi::FromInt(strict_mode)); // Strict mode.
- __ PushReturnAddressFrom(rbx);
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
void StoreIC::GenerateSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);