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

Side by Side Diff: src/builtins/builtins-regexp.cc

Issue 2607233002: [builtins] Add EmitFastNewObject (Closed)
Patch Set: Created 3 years, 11 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/builtins/builtins-promise.cc ('k') | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins-constructor.h"
5 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 7 #include "src/builtins/builtins.h"
7 #include "src/code-factory.h" 8 #include "src/code-factory.h"
8 #include "src/code-stub-assembler.h" 9 #include "src/code-stub-assembler.h"
9 #include "src/regexp/jsregexp.h" 10 #include "src/regexp/jsregexp.h"
10 #include "src/regexp/regexp-utils.h" 11 #include "src/regexp/regexp-utils.h"
11 #include "src/string-builder.h" 12 #include "src/string-builder.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 { 780 {
780 Node* const initial_map = LoadObjectField( 781 Node* const initial_map = LoadObjectField(
781 regexp_function, JSFunction::kPrototypeOrInitialMapOffset); 782 regexp_function, JSFunction::kPrototypeOrInitialMapOffset);
782 Node* const regexp = AllocateJSObjectFromMap(initial_map); 783 Node* const regexp = AllocateJSObjectFromMap(initial_map);
783 var_regexp.Bind(regexp); 784 var_regexp.Bind(regexp);
784 Goto(&next); 785 Goto(&next);
785 } 786 }
786 787
787 Bind(&allocate_generic); 788 Bind(&allocate_generic);
788 { 789 {
789 Callable fastnewobject_callable = CodeFactory::FastNewObject(isolate); 790 ConstructorBuiltinsAssembler constructor_assembler(this->state());
790 Node* const regexp = CallStub(fastnewobject_callable, context, 791 Node* const regexp = constructor_assembler.EmitFastNewObject(
791 regexp_function, var_new_target.value()); 792 context, regexp_function, var_new_target.value());
792 var_regexp.Bind(regexp); 793 var_regexp.Bind(regexp);
793 Goto(&next); 794 Goto(&next);
794 } 795 }
795 796
796 Bind(&next); 797 Bind(&next);
797 } 798 }
798 799
799 Node* const result = RegExpInitialize(context, var_regexp.value(), 800 Node* const result = RegExpInitialize(context, var_regexp.value(),
800 var_pattern.value(), var_flags.value()); 801 var_pattern.value(), var_flags.value());
801 Return(result); 802 Return(result);
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 Bind(&if_matched); 2522 Bind(&if_matched);
2522 { 2523 {
2523 Node* result = 2524 Node* result =
2524 ConstructNewResultFromMatchInfo(context, match_indices, string); 2525 ConstructNewResultFromMatchInfo(context, match_indices, string);
2525 Return(result); 2526 Return(result);
2526 } 2527 }
2527 } 2528 }
2528 2529
2529 } // namespace internal 2530 } // namespace internal
2530 } // namespace v8 2531 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-promise.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698