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

Side by Side Diff: src/code-stubs.cc

Issue 2227723003: Fix mistake in FastNewFunctionContextStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 4779 matching lines...) Expand 10 before | Expand all | Expand 10 after
4790 // Initialize the rest of the slots to undefined. 4790 // Initialize the rest of the slots to undefined.
4791 Node* undefined = assembler->UndefinedConstant(); 4791 Node* undefined = assembler->UndefinedConstant();
4792 Variable var_slot_index(assembler, MachineRepresentation::kWord32); 4792 Variable var_slot_index(assembler, MachineRepresentation::kWord32);
4793 var_slot_index.Bind(min_context_slots); 4793 var_slot_index.Bind(min_context_slots);
4794 Label loop(assembler, &var_slot_index), after_loop(assembler); 4794 Label loop(assembler, &var_slot_index), after_loop(assembler);
4795 assembler->Goto(&loop); 4795 assembler->Goto(&loop);
4796 4796
4797 assembler->Bind(&loop); 4797 assembler->Bind(&loop);
4798 { 4798 {
4799 Node* slot_index = var_slot_index.value(); 4799 Node* slot_index = var_slot_index.value();
4800 // check for < length later, there are at least Context::MIN_CONTEXT_SLOTS 4800 assembler->GotoUnless(assembler->Int32LessThan(slot_index, length),
4801 &after_loop);
4801 assembler->StoreFixedArrayElement(function_context, slot_index, undefined, 4802 assembler->StoreFixedArrayElement(function_context, slot_index, undefined,
4802 SKIP_WRITE_BARRIER); 4803 SKIP_WRITE_BARRIER);
4803 Node* one = assembler->Int32Constant(1); 4804 Node* one = assembler->Int32Constant(1);
4804 Node* next_index = assembler->Int32Add(slot_index, one); 4805 Node* next_index = assembler->Int32Add(slot_index, one);
4805 var_slot_index.Bind(next_index); 4806 var_slot_index.Bind(next_index);
4806 assembler->Branch(assembler->Int32LessThan(next_index, length), &loop, 4807 assembler->Goto(&loop);
4807 &after_loop);
4808 } 4808 }
4809 assembler->Bind(&after_loop); 4809 assembler->Bind(&after_loop);
4810 4810
4811 return function_context; 4811 return function_context;
4812 } 4812 }
4813 4813
4814 void FastNewFunctionContextStub::GenerateAssembly( 4814 void FastNewFunctionContextStub::GenerateAssembly(
4815 CodeStubAssembler* assembler) const { 4815 CodeStubAssembler* assembler) const {
4816 typedef compiler::Node Node; 4816 typedef compiler::Node Node;
4817 Node* function = assembler->Parameter(Descriptor::kFunction); 4817 Node* function = assembler->Parameter(Descriptor::kFunction);
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
5280 if (type->Is(Type::UntaggedPointer())) { 5280 if (type->Is(Type::UntaggedPointer())) {
5281 return Representation::External(); 5281 return Representation::External();
5282 } 5282 }
5283 5283
5284 DCHECK(!type->Is(Type::Untagged())); 5284 DCHECK(!type->Is(Type::Untagged()));
5285 return Representation::Tagged(); 5285 return Representation::Tagged();
5286 } 5286 }
5287 5287
5288 } // namespace internal 5288 } // namespace internal
5289 } // namespace v8 5289 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698