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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1949023003: [Interpreter] Fix incorrect frame walking in arguments create stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 } 1507 }
1508 1508
1509 // CreateMappedArguments 1509 // CreateMappedArguments
1510 // 1510 //
1511 // Creates a new mapped arguments object. 1511 // Creates a new mapped arguments object.
1512 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { 1512 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) {
1513 Node* closure = __ LoadRegister(Register::function_closure()); 1513 Node* closure = __ LoadRegister(Register::function_closure());
1514 Node* context = __ GetContext(); 1514 Node* context = __ GetContext();
1515 1515
1516 Variable result(assembler, MachineRepresentation::kTagged); 1516 Variable result(assembler, MachineRepresentation::kTagged);
1517 Label end(assembler), if_duplicate_parameters(assembler), 1517 Label end(assembler), if_duplicate_parameters(assembler, Label::kDeferred),
1518 if_not_duplicate_parameters(assembler); 1518 if_not_duplicate_parameters(assembler);
1519 1519
1520 // Check if function has duplicate parameters. 1520 // Check if function has duplicate parameters.
1521 // TODO(rmcilroy): Remove this check when FastNewSloppyArgumentsStub supports 1521 // TODO(rmcilroy): Remove this check when FastNewSloppyArgumentsStub supports
1522 // duplicate parameters. 1522 // duplicate parameters.
1523 Node* shared_info = 1523 Node* shared_info =
1524 __ LoadObjectField(closure, JSFunction::kSharedFunctionInfoOffset); 1524 __ LoadObjectField(closure, JSFunction::kSharedFunctionInfoOffset);
1525 Node* compiler_hints = __ LoadObjectField( 1525 Node* compiler_hints = __ LoadObjectField(
1526 shared_info, SharedFunctionInfo::kHasDuplicateParametersByteOffset, 1526 shared_info, SharedFunctionInfo::kHasDuplicateParametersByteOffset,
1527 MachineType::Uint8()); 1527 MachineType::Uint8());
1528 Node* duplicate_parameters_bit = __ Int32Constant( 1528 Node* duplicate_parameters_bit = __ Int32Constant(
1529 1 << SharedFunctionInfo::kHasDuplicateParametersBitWithinByte); 1529 1 << SharedFunctionInfo::kHasDuplicateParametersBitWithinByte);
1530 Node* compare = __ Word32And(compiler_hints, duplicate_parameters_bit); 1530 Node* compare = __ Word32And(compiler_hints, duplicate_parameters_bit);
1531 __ BranchIf(compare, &if_duplicate_parameters, &if_not_duplicate_parameters); 1531 __ BranchIf(compare, &if_duplicate_parameters, &if_not_duplicate_parameters);
1532 1532
1533 __ Bind(&if_duplicate_parameters); 1533 __ Bind(&if_duplicate_parameters);
1534 { 1534 {
1535 result.Bind( 1535 result.Bind(
1536 __ CallRuntime(Runtime::kNewSloppyArguments_Generic, context, closure)); 1536 __ CallRuntime(Runtime::kNewSloppyArguments_Generic, context, closure));
1537 __ Goto(&end); 1537 __ Goto(&end);
1538 } 1538 }
1539 1539
1540 __ Bind(&if_not_duplicate_parameters); 1540 __ Bind(&if_not_duplicate_parameters);
1541 { 1541 {
1542 Callable callable = CodeFactory::FastNewSloppyArguments(isolate_); 1542 Callable callable = CodeFactory::FastNewSloppyArguments(isolate_, true);
1543 Node* target = __ HeapConstant(callable.code()); 1543 Node* target = __ HeapConstant(callable.code());
1544 result.Bind(__ CallStub(callable.descriptor(), target, context, closure)); 1544 result.Bind(__ CallStub(callable.descriptor(), target, context, closure));
1545 __ Goto(&end); 1545 __ Goto(&end);
1546 } 1546 }
1547 __ Bind(&end); 1547 __ Bind(&end);
1548 __ SetAccumulator(result.value()); 1548 __ SetAccumulator(result.value());
1549 __ Dispatch(); 1549 __ Dispatch();
1550 } 1550 }
1551 1551
1552 1552
1553 // CreateUnmappedArguments 1553 // CreateUnmappedArguments
1554 // 1554 //
1555 // Creates a new unmapped arguments object. 1555 // Creates a new unmapped arguments object.
1556 void Interpreter::DoCreateUnmappedArguments(InterpreterAssembler* assembler) { 1556 void Interpreter::DoCreateUnmappedArguments(InterpreterAssembler* assembler) {
1557 Callable callable = CodeFactory::FastNewStrictArguments(isolate_); 1557 Callable callable = CodeFactory::FastNewStrictArguments(isolate_, true);
1558 Node* target = __ HeapConstant(callable.code()); 1558 Node* target = __ HeapConstant(callable.code());
1559 Node* context = __ GetContext(); 1559 Node* context = __ GetContext();
1560 Node* closure = __ LoadRegister(Register::function_closure()); 1560 Node* closure = __ LoadRegister(Register::function_closure());
1561 Node* result = __ CallStub(callable.descriptor(), target, context, closure); 1561 Node* result = __ CallStub(callable.descriptor(), target, context, closure);
1562 __ SetAccumulator(result); 1562 __ SetAccumulator(result);
1563 __ Dispatch(); 1563 __ Dispatch();
1564 } 1564 }
1565 1565
1566 // CreateRestParameter 1566 // CreateRestParameter
1567 // 1567 //
1568 // Creates a new rest parameter array. 1568 // Creates a new rest parameter array.
1569 void Interpreter::DoCreateRestParameter(InterpreterAssembler* assembler) { 1569 void Interpreter::DoCreateRestParameter(InterpreterAssembler* assembler) {
1570 Callable callable = CodeFactory::FastNewRestParameter(isolate_); 1570 Callable callable = CodeFactory::FastNewRestParameter(isolate_, true);
1571 Node* target = __ HeapConstant(callable.code()); 1571 Node* target = __ HeapConstant(callable.code());
1572 Node* closure = __ LoadRegister(Register::function_closure()); 1572 Node* closure = __ LoadRegister(Register::function_closure());
1573 Node* context = __ GetContext(); 1573 Node* context = __ GetContext();
1574 Node* result = __ CallStub(callable.descriptor(), target, context, closure); 1574 Node* result = __ CallStub(callable.descriptor(), target, context, closure);
1575 __ SetAccumulator(result); 1575 __ SetAccumulator(result);
1576 __ Dispatch(); 1576 __ Dispatch();
1577 } 1577 }
1578 1578
1579 // StackCheck 1579 // StackCheck
1580 // 1580 //
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 1805 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
1806 __ SmiTag(new_state)); 1806 __ SmiTag(new_state));
1807 __ SetAccumulator(old_state); 1807 __ SetAccumulator(old_state);
1808 1808
1809 __ Dispatch(); 1809 __ Dispatch();
1810 } 1810 }
1811 1811
1812 } // namespace interpreter 1812 } // namespace interpreter
1813 } // namespace internal 1813 } // namespace internal
1814 } // namespace v8 1814 } // namespace v8
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698