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

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

Issue 1903723003: [stubs]: Implement ArrayNoArgumentConstructor as a TF stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback 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/code-stubs.h ('k') | src/code-stubs-hydrogen.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 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 4232 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 4243
4244 4244
4245 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, 4245 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
4246 intptr_t stack_pointer, 4246 intptr_t stack_pointer,
4247 Isolate* isolate) { 4247 Isolate* isolate) {
4248 FunctionEntryHook entry_hook = isolate->function_entry_hook(); 4248 FunctionEntryHook entry_hook = isolate->function_entry_hook();
4249 DCHECK(entry_hook != NULL); 4249 DCHECK(entry_hook != NULL);
4250 entry_hook(function, stack_pointer); 4250 entry_hook(function, stack_pointer);
4251 } 4251 }
4252 4252
4253 void ArrayNoArgumentConstructorStub::GenerateAssembly(
4254 CodeStubAssembler* assembler) const {
4255 typedef compiler::Node Node;
4256 Node* native_context = assembler->LoadObjectField(
4257 assembler->Parameter(
4258 ArrayNoArgumentConstructorDescriptor::kFunctionIndex),
4259 JSFunction::kContextOffset);
4260 bool track_allocation_site =
4261 AllocationSite::GetMode(elements_kind()) == TRACK_ALLOCATION_SITE &&
4262 override_mode() != DISABLE_ALLOCATION_SITES;
4263 Node* allocation_site =
4264 track_allocation_site
4265 ? assembler->Parameter(
4266 ArrayNoArgumentConstructorDescriptor::kAllocationSiteIndex)
4267 : nullptr;
4268 Node* array = assembler->AllocateJSArray(elements_kind(), native_context,
4269 JSArray::kPreallocatedArrayElements,
4270 0, allocation_site);
4271 assembler->Return(array);
4272 }
4253 4273
4254 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) 4274 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
4255 : PlatformCodeStub(isolate) { 4275 : PlatformCodeStub(isolate) {
4256 minor_key_ = ArgumentCountBits::encode(ANY); 4276 minor_key_ = ArgumentCountBits::encode(ANY);
4257 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 4277 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
4258 } 4278 }
4259 4279
4260 4280
4261 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, 4281 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate,
4262 int argument_count) 4282 int argument_count)
(...skipping 29 matching lines...) Expand all
4292 if (type->Is(Type::UntaggedPointer())) { 4312 if (type->Is(Type::UntaggedPointer())) {
4293 return Representation::External(); 4313 return Representation::External();
4294 } 4314 }
4295 4315
4296 DCHECK(!type->Is(Type::Untagged())); 4316 DCHECK(!type->Is(Type::Untagged()));
4297 return Representation::Tagged(); 4317 return Representation::Tagged();
4298 } 4318 }
4299 4319
4300 } // namespace internal 4320 } // namespace internal
4301 } // namespace v8 4321 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698