[cleanup] Remove CreateIterResultObject from crankshaft and full-codegen
This will make it easier if we want to split it into two intrinsics, one for creating an object with `done == true` and one with `done == false`. Also remove apparently-dead method FullCodegen::EmitCreateIteratorResult. Bug: v8:6408, v8:6409 Change-Id: I3d6022a9eff517dd8b664d65950502c22447b364 Reviewed-on: https://chromium-review.googlesource.com/543567 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/master@{#46107}
This commit is contained in:
parent
76078e140a
commit
c52d7e723d
@ -1361,37 +1361,6 @@ HValue* HGraphBuilder::BuildCopyElementsOnWrite(HValue* object,
|
||||
return environment()->Pop();
|
||||
}
|
||||
|
||||
HValue* HGraphBuilder::BuildCreateIterResultObject(HValue* value,
|
||||
HValue* done) {
|
||||
NoObservableSideEffectsScope scope(this);
|
||||
|
||||
// Allocate the JSIteratorResult object.
|
||||
HValue* result =
|
||||
Add<HAllocate>(Add<HConstant>(JSIteratorResult::kSize), HType::JSObject(),
|
||||
NOT_TENURED, JS_OBJECT_TYPE, graph()->GetConstant0());
|
||||
|
||||
// Initialize the JSIteratorResult object.
|
||||
HValue* native_context = BuildGetNativeContext();
|
||||
HValue* map = Add<HLoadNamedField>(
|
||||
native_context, nullptr,
|
||||
HObjectAccess::ForContextSlot(Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
Add<HStoreNamedField>(result, HObjectAccess::ForMap(), map);
|
||||
HValue* empty_fixed_array = Add<HLoadRoot>(Heap::kEmptyFixedArrayRootIndex);
|
||||
Add<HStoreNamedField>(result, HObjectAccess::ForPropertiesPointer(),
|
||||
empty_fixed_array);
|
||||
Add<HStoreNamedField>(result, HObjectAccess::ForElementsPointer(),
|
||||
empty_fixed_array);
|
||||
Add<HStoreNamedField>(result, HObjectAccess::ForObservableJSObjectOffset(
|
||||
JSIteratorResult::kValueOffset),
|
||||
value);
|
||||
Add<HStoreNamedField>(result, HObjectAccess::ForObservableJSObjectOffset(
|
||||
JSIteratorResult::kDoneOffset),
|
||||
done);
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
HValue* HGraphBuilder::BuildNumberToString(HValue* object, AstType* type) {
|
||||
NoObservableSideEffectsScope scope(this);
|
||||
|
||||
|
@ -1093,9 +1093,6 @@ class HGraphBuilder {
|
||||
HValue* BuildToNumber(HValue* input);
|
||||
HValue* BuildToObject(HValue* receiver);
|
||||
|
||||
// ES6 section 7.4.7 CreateIterResultObject ( value, done )
|
||||
HValue* BuildCreateIterResultObject(HValue* value, HValue* done);
|
||||
|
||||
// Allocates a new object according with the given allocation properties.
|
||||
HAllocate* BuildAllocate(HValue* object_size,
|
||||
HType type,
|
||||
|
@ -1460,31 +1460,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, r0, r2, r3, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ b(&done_allocate);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r1);
|
||||
PopOperand(r2);
|
||||
__ LoadRoot(r3,
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
__ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
|
||||
__ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset));
|
||||
__ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset));
|
||||
__ str(r2, FieldMemOperand(r0, JSIteratorResult::kValueOffset));
|
||||
__ str(r3, FieldMemOperand(r0, JSIteratorResult::kDoneOffset));
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left_expr,
|
||||
@ -2075,36 +2050,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, r0, r2, r3, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r1);
|
||||
__ pop(r3);
|
||||
__ pop(r2);
|
||||
__ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
|
||||
__ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset));
|
||||
__ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset));
|
||||
__ str(r2, FieldMemOperand(r0, JSIteratorResult::kValueOffset));
|
||||
__ str(r3, FieldMemOperand(r0, JSIteratorResult::kDoneOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(r0);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), r0);
|
||||
|
@ -2030,47 +2030,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
Register result = x0;
|
||||
__ Allocate(JSIteratorResult::kSize, result, x10, x11, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
Register map_reg = x1;
|
||||
Register result_value = x2;
|
||||
Register boolean_done = x3;
|
||||
Register empty_fixed_array = x4;
|
||||
Register untagged_result = x5;
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, map_reg);
|
||||
__ Pop(boolean_done);
|
||||
__ Pop(result_value);
|
||||
__ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex);
|
||||
STATIC_ASSERT(JSObject::kPropertiesOffset + kPointerSize ==
|
||||
JSObject::kElementsOffset);
|
||||
STATIC_ASSERT(JSIteratorResult::kValueOffset + kPointerSize ==
|
||||
JSIteratorResult::kDoneOffset);
|
||||
__ ObjectUntag(untagged_result, result);
|
||||
__ Str(map_reg, MemOperand(untagged_result, HeapObject::kMapOffset));
|
||||
__ Stp(empty_fixed_array, empty_fixed_array,
|
||||
MemOperand(untagged_result, JSObject::kPropertiesOffset));
|
||||
__ Stp(result_value, boolean_done,
|
||||
MemOperand(untagged_result, JSIteratorResult::kValueOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ B(&done);
|
||||
|
||||
__ Bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ Bind(&done);
|
||||
context()->Plug(x0);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), x0);
|
||||
@ -2592,45 +2551,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
// Allocate and populate an object with this form: { value: VAL, done: DONE }
|
||||
|
||||
Register result = x0;
|
||||
__ Allocate(JSIteratorResult::kSize, result, x10, x11, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ B(&done_allocate);
|
||||
|
||||
__ Bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ Bind(&done_allocate);
|
||||
Register map_reg = x1;
|
||||
Register result_value = x2;
|
||||
Register boolean_done = x3;
|
||||
Register empty_fixed_array = x4;
|
||||
Register untagged_result = x5;
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, map_reg);
|
||||
PopOperand(result_value);
|
||||
__ LoadRoot(boolean_done,
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
__ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex);
|
||||
STATIC_ASSERT(JSObject::kPropertiesOffset + kPointerSize ==
|
||||
JSObject::kElementsOffset);
|
||||
STATIC_ASSERT(JSIteratorResult::kValueOffset + kPointerSize ==
|
||||
JSIteratorResult::kDoneOffset);
|
||||
__ ObjectUntag(untagged_result, result);
|
||||
__ Str(map_reg, MemOperand(untagged_result, HeapObject::kMapOffset));
|
||||
__ Stp(empty_fixed_array, empty_fixed_array,
|
||||
MemOperand(untagged_result, JSObject::kPropertiesOffset));
|
||||
__ Stp(result_value, boolean_done,
|
||||
MemOperand(untagged_result, JSIteratorResult::kValueOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
}
|
||||
|
||||
|
||||
// TODO(all): I don't like this method.
|
||||
// It seems to me that in too many places x0 is used in place of this.
|
||||
// Also, this function is not suitable for all places where x0 should be
|
||||
|
@ -309,11 +309,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
|
||||
// stack depth is in sync with the actual operand stack during runtime.
|
||||
void EmitOperandStackDepthCheck();
|
||||
|
||||
// Generate code to create an iterator result object. The "value" property is
|
||||
// set to a value popped from the stack, and "done" is set according to the
|
||||
// argument. The result object is left in the result register.
|
||||
void EmitCreateIteratorResult(bool done);
|
||||
|
||||
// Try to perform a comparison as a fast inlined literal compare if
|
||||
// the operands allow it. Returns true if the compare operations
|
||||
// has been matched and all code generated; false otherwise.
|
||||
@ -392,8 +387,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
|
||||
F(ToLength) \
|
||||
F(ToNumber) \
|
||||
F(ToObject) \
|
||||
F(DebugIsActive) \
|
||||
F(CreateIterResultObject)
|
||||
F(DebugIsActive)
|
||||
|
||||
#define GENERATOR_DECLARATION(Name) void Emit##Name(CallRuntime* call);
|
||||
FOR_EACH_FULL_CODE_INTRINSIC(GENERATOR_DECLARATION)
|
||||
|
@ -1377,33 +1377,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, eax, ecx, edx, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ jmp(&done_allocate, Label::kNear);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ mov(ebx, NativeContextOperand());
|
||||
__ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
|
||||
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ mov(FieldOperand(eax, JSObject::kElementsOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ pop(FieldOperand(eax, JSIteratorResult::kValueOffset));
|
||||
__ mov(FieldOperand(eax, JSIteratorResult::kDoneOffset),
|
||||
isolate()->factory()->ToBoolean(done));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
OperandStackDepthDecrement(1);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left,
|
||||
@ -1992,36 +1965,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, eax, ecx, edx, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ mov(ebx, NativeContextOperand());
|
||||
__ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
|
||||
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ mov(FieldOperand(eax, JSObject::kElementsOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ pop(FieldOperand(eax, JSIteratorResult::kDoneOffset));
|
||||
__ pop(FieldOperand(eax, JSIteratorResult::kValueOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ jmp(&done, Label::kNear);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(eax);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadGlobalFunction(expr->context_index(), eax);
|
||||
|
@ -1466,32 +1466,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ jmp(&done_allocate);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
|
||||
PopOperand(a2);
|
||||
__ LoadRoot(a3,
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
__ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
|
||||
__ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset));
|
||||
__ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset));
|
||||
__ sw(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset));
|
||||
__ sw(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left_expr,
|
||||
@ -2091,35 +2065,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
|
||||
__ Pop(a2, a3);
|
||||
__ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
|
||||
__ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset));
|
||||
__ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset));
|
||||
__ sw(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset));
|
||||
__ sw(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(v0);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), v0);
|
||||
|
@ -1468,32 +1468,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ jmp(&done_allocate);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
|
||||
PopOperand(a2);
|
||||
__ LoadRoot(a3,
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
__ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ Sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
|
||||
__ Sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset));
|
||||
__ Sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset));
|
||||
__ Sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset));
|
||||
__ Sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left_expr,
|
||||
@ -2092,35 +2066,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
|
||||
__ Pop(a2, a3);
|
||||
__ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ Sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
|
||||
__ Sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset));
|
||||
__ Sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset));
|
||||
__ Sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset));
|
||||
__ Sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(v0);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), v0);
|
||||
|
@ -1437,31 +1437,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, r3, r5, r6, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ b(&done_allocate);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r4);
|
||||
PopOperand(r5);
|
||||
__ LoadRoot(r6,
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
__ LoadRoot(r7, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ StoreP(r4, FieldMemOperand(r3, HeapObject::kMapOffset), r0);
|
||||
__ StoreP(r7, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0);
|
||||
__ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0);
|
||||
__ StoreP(r5, FieldMemOperand(r3, JSIteratorResult::kValueOffset), r0);
|
||||
__ StoreP(r6, FieldMemOperand(r3, JSIteratorResult::kDoneOffset), r0);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left_expr,
|
||||
@ -2085,35 +2060,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, r3, r5, r6, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r4);
|
||||
__ Pop(r5, r6);
|
||||
__ LoadRoot(r7, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ StoreP(r4, FieldMemOperand(r3, HeapObject::kMapOffset), r0);
|
||||
__ StoreP(r7, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0);
|
||||
__ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0);
|
||||
__ StoreP(r5, FieldMemOperand(r3, JSIteratorResult::kValueOffset), r0);
|
||||
__ StoreP(r6, FieldMemOperand(r3, JSIteratorResult::kDoneOffset), r0);
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(r3);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), r3);
|
||||
|
@ -1401,30 +1401,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, r2, r4, r5, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ b(&done_allocate);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r3);
|
||||
PopOperand(r4);
|
||||
__ LoadRoot(r5,
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
__ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ StoreP(r3, FieldMemOperand(r2, HeapObject::kMapOffset), r0);
|
||||
__ StoreP(r6, FieldMemOperand(r2, JSObject::kPropertiesOffset), r0);
|
||||
__ StoreP(r6, FieldMemOperand(r2, JSObject::kElementsOffset), r0);
|
||||
__ StoreP(r4, FieldMemOperand(r2, JSIteratorResult::kValueOffset), r0);
|
||||
__ StoreP(r5, FieldMemOperand(r2, JSIteratorResult::kDoneOffset), r0);
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left_expr,
|
||||
@ -2049,34 +2025,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
context()->Plug(r2);
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, r2, r4, r5, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r3);
|
||||
__ Pop(r4, r5);
|
||||
__ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ StoreP(r3, FieldMemOperand(r2, HeapObject::kMapOffset), r0);
|
||||
__ StoreP(r6, FieldMemOperand(r2, JSObject::kPropertiesOffset), r0);
|
||||
__ StoreP(r6, FieldMemOperand(r2, JSObject::kElementsOffset), r0);
|
||||
__ StoreP(r4, FieldMemOperand(r2, JSIteratorResult::kValueOffset), r0);
|
||||
__ StoreP(r5, FieldMemOperand(r2, JSIteratorResult::kDoneOffset), r0);
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(r2);
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), r2);
|
||||
|
@ -1401,31 +1401,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, rax, rcx, rdx, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ jmp(&done_allocate, Label::kNear);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, rbx);
|
||||
__ movp(FieldOperand(rax, HeapObject::kMapOffset), rbx);
|
||||
__ LoadRoot(rbx, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ movp(FieldOperand(rax, JSObject::kPropertiesOffset), rbx);
|
||||
__ movp(FieldOperand(rax, JSObject::kElementsOffset), rbx);
|
||||
__ Pop(FieldOperand(rax, JSIteratorResult::kValueOffset));
|
||||
__ LoadRoot(FieldOperand(rax, JSIteratorResult::kDoneOffset),
|
||||
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
OperandStackDepthDecrement(1);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left,
|
||||
@ -1977,34 +1952,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, rax, rcx, rdx, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, rbx);
|
||||
__ movp(FieldOperand(rax, HeapObject::kMapOffset), rbx);
|
||||
__ LoadRoot(rbx, Heap::kEmptyFixedArrayRootIndex);
|
||||
__ movp(FieldOperand(rax, JSObject::kPropertiesOffset), rbx);
|
||||
__ movp(FieldOperand(rax, JSObject::kElementsOffset), rbx);
|
||||
__ Pop(FieldOperand(rax, JSIteratorResult::kDoneOffset));
|
||||
__ Pop(FieldOperand(rax, JSIteratorResult::kValueOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ jmp(&done, Label::kNear);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(rax);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadNativeContextSlot(expr->context_index(), rax);
|
||||
|
@ -1367,33 +1367,6 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
||||
Label allocate, done_allocate;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, eax, ecx, edx, &allocate,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ jmp(&done_allocate, Label::kNear);
|
||||
|
||||
__ bind(&allocate);
|
||||
__ Push(Smi::FromInt(JSIteratorResult::kSize));
|
||||
__ CallRuntime(Runtime::kAllocateInNewSpace);
|
||||
|
||||
__ bind(&done_allocate);
|
||||
__ mov(ebx, NativeContextOperand());
|
||||
__ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
|
||||
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ mov(FieldOperand(eax, JSObject::kElementsOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ pop(FieldOperand(eax, JSIteratorResult::kValueOffset));
|
||||
__ mov(FieldOperand(eax, JSIteratorResult::kDoneOffset),
|
||||
isolate()->factory()->ToBoolean(done));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
OperandStackDepthDecrement(1);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
|
||||
Token::Value op,
|
||||
Expression* left,
|
||||
@ -1982,36 +1955,6 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_EQ(2, args->length());
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForStackValue(args->at(1));
|
||||
|
||||
Label runtime, done;
|
||||
|
||||
__ Allocate(JSIteratorResult::kSize, eax, ecx, edx, &runtime,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
__ mov(ebx, NativeContextOperand());
|
||||
__ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
|
||||
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
|
||||
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ mov(FieldOperand(eax, JSObject::kElementsOffset),
|
||||
isolate()->factory()->empty_fixed_array());
|
||||
__ pop(FieldOperand(eax, JSIteratorResult::kDoneOffset));
|
||||
__ pop(FieldOperand(eax, JSIteratorResult::kValueOffset));
|
||||
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
|
||||
__ jmp(&done, Label::kNear);
|
||||
|
||||
__ bind(&runtime);
|
||||
CallRuntimeWithOperands(Runtime::kCreateIterResultObject);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(eax);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
||||
// Push function.
|
||||
__ LoadGlobalFunction(expr->context_index(), eax);
|
||||
|
Loading…
Reference in New Issue
Block a user