| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value() | 1928 Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value() |
| 1929 : heap()->false_value()); | 1929 : heap()->false_value()); |
| 1930 Runtime::SetObjectProperty(isolate(), builtins, | 1930 Runtime::SetObjectProperty(isolate(), builtins, |
| 1931 factory()->harmony_unicode_regexps_string(), flag, | 1931 factory()->harmony_unicode_regexps_string(), flag, |
| 1932 STRICT).Assert(); | 1932 STRICT).Assert(); |
| 1933 } | 1933 } |
| 1934 | 1934 |
| 1935 | 1935 |
| 1936 void Genesis::InitializeGlobal_harmony_reflect() { | 1936 void Genesis::InitializeGlobal_harmony_reflect() { |
| 1937 Handle<JSObject> builtins(native_context()->builtins()); | 1937 Handle<JSObject> builtins(native_context()->builtins()); |
| 1938 // Install references to functions of the Reflect object | |
| 1939 if (FLAG_harmony_reflect || FLAG_harmony_spreadcalls) { | |
| 1940 Handle<JSFunction> apply = InstallFunction( | |
| 1941 builtins, "$reflectApply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | |
| 1942 MaybeHandle<JSObject>(), Builtins::kReflectApply); | |
| 1943 Handle<JSFunction> construct = InstallFunction( | |
| 1944 builtins, "$reflectConstruct", JS_OBJECT_TYPE, JSObject::kHeaderSize, | |
| 1945 MaybeHandle<JSObject>(), Builtins::kReflectConstruct); | |
| 1946 apply->shared()->set_internal_formal_parameter_count(3); | |
| 1947 apply->shared()->set_length(3); | |
| 1948 | 1938 |
| 1949 construct->shared()->set_internal_formal_parameter_count(3); | 1939 Handle<JSFunction> apply = InstallFunction( |
| 1950 construct->shared()->set_length(2); | 1940 builtins, "$reflectApply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1951 } | 1941 MaybeHandle<JSObject>(), Builtins::kReflectApply); |
| 1942 apply->shared()->set_internal_formal_parameter_count(3); |
| 1943 apply->shared()->set_length(3); |
| 1944 |
| 1945 Handle<JSFunction> construct = InstallFunction( |
| 1946 builtins, "$reflectConstruct", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1947 MaybeHandle<JSObject>(), Builtins::kReflectConstruct); |
| 1948 construct->shared()->set_internal_formal_parameter_count(3); |
| 1949 construct->shared()->set_length(2); |
| 1952 | 1950 |
| 1953 if (!FLAG_harmony_reflect) return; | 1951 if (!FLAG_harmony_reflect) return; |
| 1952 |
| 1954 Handle<JSGlobalObject> global(JSGlobalObject::cast( | 1953 Handle<JSGlobalObject> global(JSGlobalObject::cast( |
| 1955 native_context()->global_object())); | 1954 native_context()->global_object())); |
| 1956 Handle<String> reflect_string = | 1955 Handle<String> reflect_string = |
| 1957 factory()->NewStringFromStaticChars("Reflect"); | 1956 factory()->NewStringFromStaticChars("Reflect"); |
| 1958 Handle<Object> reflect = | 1957 Handle<Object> reflect = |
| 1959 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1958 factory()->NewJSObject(isolate()->object_function(), TENURED); |
| 1960 JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM); | 1959 JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM); |
| 1961 } | 1960 } |
| 1962 | 1961 |
| 1963 | 1962 |
| (...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3314 } | 3313 } |
| 3315 | 3314 |
| 3316 | 3315 |
| 3317 // Called when the top-level V8 mutex is destroyed. | 3316 // Called when the top-level V8 mutex is destroyed. |
| 3318 void Bootstrapper::FreeThreadResources() { | 3317 void Bootstrapper::FreeThreadResources() { |
| 3319 DCHECK(!IsActive()); | 3318 DCHECK(!IsActive()); |
| 3320 } | 3319 } |
| 3321 | 3320 |
| 3322 } // namespace internal | 3321 } // namespace internal |
| 3323 } // namespace v8 | 3322 } // namespace v8 |
| OLD | NEW |