OLD | NEW |
---|---|
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/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2717 Node* closure = assembler.Parameter(Descriptor::kClosure); | 2717 Node* closure = assembler.Parameter(Descriptor::kClosure); |
2718 Node* literal_index = assembler.Parameter(Descriptor::kLiteralIndex); | 2718 Node* literal_index = assembler.Parameter(Descriptor::kLiteralIndex); |
2719 Node* pattern = assembler.Parameter(Descriptor::kPattern); | 2719 Node* pattern = assembler.Parameter(Descriptor::kPattern); |
2720 Node* flags = assembler.Parameter(Descriptor::kFlags); | 2720 Node* flags = assembler.Parameter(Descriptor::kFlags); |
2721 Node* context = assembler.Parameter(Descriptor::kContext); | 2721 Node* context = assembler.Parameter(Descriptor::kContext); |
2722 | 2722 |
2723 assembler.Return( | 2723 assembler.Return( |
2724 Generate(&assembler, closure, literal_index, pattern, flags, context)); | 2724 Generate(&assembler, closure, literal_index, pattern, flags, context)); |
2725 } | 2725 } |
2726 | 2726 |
2727 // static | |
2728 bool FastCloneShallowArrayStub::IsSupported(ArrayLiteral* expr) { | |
2729 return expr->depth() <= 1 && | |
2730 expr->values()->length() <= kMaximumClonedElements; | |
Camillo Bruni
2016/12/14 10:59:08
How about putting this on the ArrayLiteral node in
Michael Starzinger
2016/12/14 14:01:03
Done. Good idea, applied it to ArrayLiteral as wel
| |
2731 } | |
2732 | |
2727 namespace { | 2733 namespace { |
2728 | 2734 |
2729 compiler::Node* NonEmptyShallowClone(CodeStubAssembler* assembler, | 2735 compiler::Node* NonEmptyShallowClone(CodeStubAssembler* assembler, |
2730 compiler::Node* boilerplate, | 2736 compiler::Node* boilerplate, |
2731 compiler::Node* boilerplate_map, | 2737 compiler::Node* boilerplate_map, |
2732 compiler::Node* boilerplate_elements, | 2738 compiler::Node* boilerplate_elements, |
2733 compiler::Node* allocation_site, | 2739 compiler::Node* allocation_site, |
2734 compiler::Node* capacity, | 2740 compiler::Node* capacity, |
2735 ElementsKind kind) { | 2741 ElementsKind kind) { |
2736 typedef compiler::Node Node; | 2742 typedef compiler::Node Node; |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3217 } | 3223 } |
3218 | 3224 |
3219 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 3225 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
3220 : PlatformCodeStub(isolate) {} | 3226 : PlatformCodeStub(isolate) {} |
3221 | 3227 |
3222 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 3228 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
3223 : PlatformCodeStub(isolate) {} | 3229 : PlatformCodeStub(isolate) {} |
3224 | 3230 |
3225 } // namespace internal | 3231 } // namespace internal |
3226 } // namespace v8 | 3232 } // namespace v8 |
OLD | NEW |