| 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( | 673   Handle<JSFunction> closure(function->shared()->IsUserJavaScript() | 
| 674       function->shared()->IsBuiltin() ? *function : native_context->closure()); | 674                                  ? native_context->closure() | 
|  | 675                                  : *function); | 
| 675   Handle<Context> result = | 676   Handle<Context> result = | 
| 676       isolate->factory()->NewScriptContext(closure, scope_info); | 677       isolate->factory()->NewScriptContext(closure, scope_info); | 
| 677 | 678 | 
| 678   DCHECK(function->context() == isolate->context()); | 679   DCHECK(function->context() == isolate->context()); | 
| 679   DCHECK(*global_object == result->global_object()); | 680   DCHECK(*global_object == result->global_object()); | 
| 680 | 681 | 
| 681   Handle<ScriptContextTable> new_script_context_table = | 682   Handle<ScriptContextTable> new_script_context_table = | 
| 682       ScriptContextTable::Extend(script_context_table, result); | 683       ScriptContextTable::Extend(script_context_table, result); | 
| 683   native_context->set_script_context_table(*new_script_context_table); | 684   native_context->set_script_context_table(*new_script_context_table); | 
| 684   return *result; | 685   return *result; | 
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 956 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 957 RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) { | 
| 957   HandleScope scope(isolate); | 958   HandleScope scope(isolate); | 
| 958   DCHECK_EQ(2, args.length()); | 959   DCHECK_EQ(2, args.length()); | 
| 959   CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 960   CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | 
| 960   CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 961   CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 
| 961   RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 962   RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT)); | 
| 962 } | 963 } | 
| 963 | 964 | 
| 964 }  // namespace internal | 965 }  // namespace internal | 
| 965 }  // namespace v8 | 966 }  // namespace v8 | 
| OLD | NEW | 
|---|