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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 Handle<ScriptContextTable> script_context_table( | 663 Handle<ScriptContextTable> script_context_table( |
664 native_context->script_context_table()); | 664 native_context->script_context_table()); |
665 | 665 |
666 Object* name_clash_result = | 666 Object* name_clash_result = |
667 FindNameClash(scope_info, global_object, script_context_table); | 667 FindNameClash(scope_info, global_object, script_context_table); |
668 if (isolate->has_pending_exception()) return name_clash_result; | 668 if (isolate->has_pending_exception()) return name_clash_result; |
669 | 669 |
670 // Script contexts have a canonical empty function as their closure, not the | 670 // Script contexts have a canonical empty function as their closure, not the |
671 // anonymous closure containing the global code. See | 671 // anonymous closure containing the global code. See |
672 // FullCodeGenerator::PushFunctionArgumentForContextAllocation. | 672 // FullCodeGenerator::PushFunctionArgumentForContextAllocation. |
673 Handle<JSFunction> closure(function->shared()->IsUserJavaScript() | 673 Handle<JSFunction> closure( |
674 ? native_context->closure() | 674 function->shared()->IsBuiltin() ? *function : native_context->closure()); |
675 : *function); | |
676 Handle<Context> result = | 675 Handle<Context> result = |
677 isolate->factory()->NewScriptContext(closure, scope_info); | 676 isolate->factory()->NewScriptContext(closure, scope_info); |
678 | 677 |
679 DCHECK(function->context() == isolate->context()); | 678 DCHECK(function->context() == isolate->context()); |
680 DCHECK(*global_object == result->global_object()); | 679 DCHECK(*global_object == result->global_object()); |
681 | 680 |
682 Handle<ScriptContextTable> new_script_context_table = | 681 Handle<ScriptContextTable> new_script_context_table = |
683 ScriptContextTable::Extend(script_context_table, result); | 682 ScriptContextTable::Extend(script_context_table, result); |
684 native_context->set_script_context_table(*new_script_context_table); | 683 native_context->set_script_context_table(*new_script_context_table); |
685 return *result; | 684 return *result; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 956 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { |
958 HandleScope scope(isolate); | 957 HandleScope scope(isolate); |
959 DCHECK_EQ(2, args.length()); | 958 DCHECK_EQ(2, args.length()); |
960 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 959 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
961 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 960 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
962 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 961 RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); |
963 } | 962 } |
964 | 963 |
965 } // namespace internal | 964 } // namespace internal |
966 } // namespace v8 | 965 } // namespace v8 |
OLD | NEW |