OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 } | 630 } |
631 | 631 |
632 RUNTIME_FUNCTION(Runtime_NewClosure) { | 632 RUNTIME_FUNCTION(Runtime_NewClosure) { |
633 HandleScope scope(isolate); | 633 HandleScope scope(isolate); |
634 DCHECK_EQ(3, args.length()); | 634 DCHECK_EQ(3, args.length()); |
635 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); | 635 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); |
636 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 1); | 636 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 1); |
637 CONVERT_SMI_ARG_CHECKED(index, 2); | 637 CONVERT_SMI_ARG_CHECKED(index, 2); |
638 Handle<Context> context(isolate->context(), isolate); | 638 Handle<Context> context(isolate->context(), isolate); |
639 FeedbackSlot slot = FeedbackVector::ToSlot(index); | 639 FeedbackSlot slot = FeedbackVector::ToSlot(index); |
640 Handle<Cell> literals(Cell::cast(vector->Get(slot)), isolate); | 640 Handle<Cell> vector_cell(Cell::cast(vector->Get(slot)), isolate); |
641 Handle<JSFunction> function = | 641 Handle<JSFunction> function = |
642 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 642 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
643 shared, context, literals, NOT_TENURED); | 643 shared, context, vector_cell, NOT_TENURED); |
644 return *function; | 644 return *function; |
645 } | 645 } |
646 | 646 |
647 | 647 |
648 RUNTIME_FUNCTION(Runtime_NewClosure_Tenured) { | 648 RUNTIME_FUNCTION(Runtime_NewClosure_Tenured) { |
649 HandleScope scope(isolate); | 649 HandleScope scope(isolate); |
650 DCHECK_EQ(3, args.length()); | 650 DCHECK_EQ(3, args.length()); |
651 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); | 651 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); |
652 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 1); | 652 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 1); |
653 CONVERT_SMI_ARG_CHECKED(index, 2); | 653 CONVERT_SMI_ARG_CHECKED(index, 2); |
654 Handle<Context> context(isolate->context(), isolate); | 654 Handle<Context> context(isolate->context(), isolate); |
655 FeedbackSlot slot = FeedbackVector::ToSlot(index); | 655 FeedbackSlot slot = FeedbackVector::ToSlot(index); |
656 Handle<Cell> literals(Cell::cast(vector->Get(slot)), isolate); | 656 Handle<Cell> vector_cell(Cell::cast(vector->Get(slot)), isolate); |
657 // The caller ensures that we pretenure closures that are assigned | 657 // The caller ensures that we pretenure closures that are assigned |
658 // directly to properties. | 658 // directly to properties. |
659 Handle<JSFunction> function = | 659 Handle<JSFunction> function = |
660 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context, | 660 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
661 literals, TENURED); | 661 shared, context, vector_cell, TENURED); |
662 return *function; | 662 return *function; |
663 } | 663 } |
664 | 664 |
665 static Object* FindNameClash(Handle<ScopeInfo> scope_info, | 665 static Object* FindNameClash(Handle<ScopeInfo> scope_info, |
666 Handle<JSGlobalObject> global_object, | 666 Handle<JSGlobalObject> global_object, |
667 Handle<ScriptContextTable> script_context) { | 667 Handle<ScriptContextTable> script_context) { |
668 Isolate* isolate = scope_info->GetIsolate(); | 668 Isolate* isolate = scope_info->GetIsolate(); |
669 for (int var = 0; var < scope_info->ContextLocalCount(); var++) { | 669 for (int var = 0; var < scope_info->ContextLocalCount(); var++) { |
670 Handle<String> name(scope_info->ContextLocalName(var)); | 670 Handle<String> name(scope_info->ContextLocalName(var)); |
671 VariableMode mode = scope_info->ContextLocalMode(var); | 671 VariableMode mode = scope_info->ContextLocalMode(var); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 1007 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { |
1008 HandleScope scope(isolate); | 1008 HandleScope scope(isolate); |
1009 DCHECK_EQ(2, args.length()); | 1009 DCHECK_EQ(2, args.length()); |
1010 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 1010 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
1011 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 1011 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
1012 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 1012 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); |
1013 } | 1013 } |
1014 | 1014 |
1015 } // namespace internal | 1015 } // namespace internal |
1016 } // namespace v8 | 1016 } // namespace v8 |
OLD | NEW |