Commit 08071597 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [runtime] Pass closure to %CreateArrayLiteral and %CreateObjectLiteral.

  port 1b1db135 (r32220)

  original commit message:
  Change the runtime entries and their associated code stubs for object
  and array literal creation to take the closure instead of the raw
  literals pointer. This is way easier to deal with (and cleaner) in
  TurboFan.

BUG=

Review URL: https://codereview.chromium.org/1472273002

Cr-Commit-Position: refs/heads/master@{#32244}
parent 4a472a03
......@@ -1452,15 +1452,13 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
// If any of the keys would store to the elements array, then we shouldn't
// allow it.
if (MustCreateObjectLiteralWithRuntime(expr)) {
__ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ push(FieldOperand(edi, JSFunction::kLiteralsOffset));
__ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ push(Immediate(Smi::FromInt(expr->literal_index())));
__ push(Immediate(constant_properties));
__ push(Immediate(Smi::FromInt(flags)));
__ CallRuntime(Runtime::kCreateObjectLiteral, 4);
} else {
__ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ mov(eax, FieldOperand(edi, JSFunction::kLiteralsOffset));
__ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ mov(ebx, Immediate(Smi::FromInt(expr->literal_index())));
__ mov(ecx, Immediate(constant_properties));
__ mov(edx, Immediate(Smi::FromInt(flags)));
......@@ -1649,15 +1647,13 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
}
if (MustCreateArrayLiteralWithRuntime(expr)) {
__ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
__ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ push(Immediate(Smi::FromInt(expr->literal_index())));
__ push(Immediate(constant_elements));
__ push(Immediate(Smi::FromInt(expr->ComputeFlags())));
__ CallRuntime(Runtime::kCreateArrayLiteral, 4);
} else {
__ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset));
__ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ mov(ebx, Immediate(Smi::FromInt(expr->literal_index())));
__ mov(ecx, Immediate(constant_elements));
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment