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

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

Issue 132963012: Pretenure call new support. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment response. Created 6 years, 10 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
Index: src/arm/code-stubs-arm.cc
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
index 282a6d87562981a3368c8a8c3e7a26e044afc443..c07d6811a381b167916da5714e8c3eb38feca9e9 100644
--- a/src/arm/code-stubs-arm.cc
+++ b/src/arm/code-stubs-arm.cc
@@ -102,16 +102,6 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
}
-void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
- Isolate* isolate,
- CodeStubInterfaceDescriptor* descriptor) {
- static Register registers[] = { r2, r3 };
- descriptor->register_param_count_ = 2;
- descriptor->register_params_ = registers;
- descriptor->deoptimization_handler_ = NULL;
-}
-
-
void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
@@ -1449,7 +1439,6 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate);
StubFailureTrampolineStub::GenerateAheadOfTime(isolate);
ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
- CreateAllocationSiteStub::GenerateAheadOfTime(isolate);
BinaryOpICStub::GenerateAheadOfTime(isolate);
BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate);
}
@@ -3027,20 +3016,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ cmp(r4, r1);
__ b(eq, &done);
- // If we came here, we need to see if we are the array function.
- // If we didn't have a matching function, and we didn't find the megamorph
- // sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in ecx.
- __ ldr(r5, FieldMemOperand(r4, 0));
- __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex);
- __ b(ne, &miss);
-
- // Make sure the function is the Array() function
- __ LoadArrayFunction(r4);
- __ cmp(r1, r4);
- __ b(ne, &megamorphic);
- __ jmp(&done);
-
__ bind(&miss);
// A monomorphic miss (i.e, here the cache is not uninitialized) goes
@@ -3058,30 +3033,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// An uninitialized cache is patched with the function or sentinel to
// indicate the ElementsKind if function is the Array constructor.
__ bind(&initialize);
- // Make sure the function is the Array() function
- __ LoadArrayFunction(r4);
- __ cmp(r1, r4);
- __ b(ne, &not_array_function);
-
- // The target function is the Array constructor,
- // Create an AllocationSite if we don't already have it, store it in the slot.
- {
- FrameScope scope(masm, StackFrame::INTERNAL);
-
- // Arguments register must be smi-tagged to call out.
- __ SmiTag(r0);
- __ Push(r3, r2, r1, r0);
-
- CreateAllocationSiteStub create_stub;
- __ CallStub(&create_stub);
-
- __ Pop(r3, r2, r1, r0);
- __ SmiUntag(r0);
- }
- __ b(&done);
-
- __ bind(&not_array_function);
-
__ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3));
__ add(r4, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ str(r1, MemOperand(r4, 0));
@@ -3112,6 +3063,10 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
if (RecordCallTarget()) {
GenerateRecordCallTarget(masm);
+ // Type information was updated. Because we may call Array, which
+ // expects either undefined or an AllocationSite in ebx we need
+ // to set ebx to undefined.
+ __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
}
}
@@ -3214,6 +3169,12 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
if (RecordCallTarget()) {
GenerateRecordCallTarget(masm);
+ // Put the AllocationSite from the feedback vector into r2.
+ // By adding kPointerSize we encode that we know the AllocationSite
+ // entry is at the feedback vector slot given by r3 + 1.
+ __ add(r5, r2, Operand::PointerOffsetFromSmiKey(r3));
+ __ ldr(r2, FieldMemOperand(r5, FixedArray::kHeaderSize + kPointerSize));
+ __ AssertUndefinedOrAllocationSite(r2, r5);
}
// Jump to the function-specific construct stub.
@@ -5296,8 +5257,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : argc (only if argument_count_ == ANY)
// -- r1 : constructor
- // -- r2 : feedback vector (fixed array or undefined)
- // -- r3 : slot index (if r2 is fixed array)
+ // -- r2 : AllocationSite or undefined
// -- sp[0] : return address
// -- sp[4] : last argument
// -----------------------------------
@@ -5313,33 +5273,14 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
__ CompareObjectType(r4, r4, r5, MAP_TYPE);
__ Assert(eq, kUnexpectedInitialMapForArrayFunction);
- // We should either have undefined in ebx or a valid fixed array.
- Label okay_here;
- Handle<Map> fixed_array_map = masm->isolate()->factory()->fixed_array_map();
- __ CompareRoot(r2, Heap::kUndefinedValueRootIndex);
- __ b(eq, &okay_here);
- __ ldr(r4, FieldMemOperand(r2, 0));
- __ cmp(r4, Operand(fixed_array_map));
- __ Assert(eq, kExpectedFixedArrayInRegisterR2);
-
- // r3 should be a smi if we don't have undefined in r2
- __ AssertSmi(r3);
-
- __ bind(&okay_here);
+ // We should either have undefined in ebx or a valid AllocationSite
Hannes Payer (out of office) 2014/02/18 16:24:26 r2
mvstanton 2014/02/19 08:40:26 Done.
+ __ AssertUndefinedOrAllocationSite(r2, r4);
}
Label no_info;
// Get the elements kind and case on that.
__ CompareRoot(r2, Heap::kUndefinedValueRootIndex);
__ b(eq, &no_info);
- __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3));
- __ ldr(r2, FieldMemOperand(r2, FixedArray::kHeaderSize));
-
- // If the feedback vector is undefined, or contains anything other than an
- // AllocationSite, call an array constructor that doesn't use AllocationSites.
- __ ldr(r4, FieldMemOperand(r2, 0));
- __ CompareRoot(r4, Heap::kAllocationSiteMapRootIndex);
- __ b(ne, &no_info);
__ ldr(r3, FieldMemOperand(r2, AllocationSite::kTransitionInfoOffset));
__ SmiUntag(r3);

Powered by Google App Engine
This is Rietveld 408576698