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 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 Handle<String> name = factory->InternalizeUtf8String("SIMD"); | 1985 Handle<String> name = factory->InternalizeUtf8String("SIMD"); |
1986 Handle<JSFunction> cons = factory->NewFunction(name); | 1986 Handle<JSFunction> cons = factory->NewFunction(name); |
1987 JSFunction::SetInstancePrototype( | 1987 JSFunction::SetInstancePrototype( |
1988 cons, | 1988 cons, |
1989 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | 1989 Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
1990 cons->SetInstanceClassName(*name); | 1990 cons->SetInstanceClassName(*name); |
1991 Handle<JSObject> simd_object = factory->NewJSObject(cons, TENURED); | 1991 Handle<JSObject> simd_object = factory->NewJSObject(cons, TENURED); |
1992 DCHECK(simd_object->IsJSObject()); | 1992 DCHECK(simd_object->IsJSObject()); |
1993 JSObject::AddProperty(global, name, simd_object, DONT_ENUM); | 1993 JSObject::AddProperty(global, name, simd_object, DONT_ENUM); |
1994 | 1994 |
1995 Handle<JSFunction> float32x4_function = | 1995 // Install SIMD type functions. Set the instance class names since |
1996 InstallFunction(simd_object, "Float32x4", JS_VALUE_TYPE, JSValue::kSize, | 1996 // InstallFunction only does this when we install on the GlobalObject. |
1997 isolate->initial_object_prototype(), Builtins::kIllegal); | 1997 #define SIMD128_INSTALL_FUNCTION(name, type, lane_count, lane_type) \ |
1998 // Set the instance class name since InstallFunction only does this when | 1998 Handle<JSFunction> type##_function = InstallFunction( \ |
1999 // we install on the GlobalObject. | 1999 simd_object, #name, JS_VALUE_TYPE, JSValue::kSize, \ |
2000 float32x4_function->SetInstanceClassName(*factory->Float32x4_string()); | 2000 isolate->initial_object_prototype(), Builtins::kIllegal); \ |
2001 native_context()->set_float32x4_function(*float32x4_function); | 2001 native_context()->set_##type##_function(*type##_function); \ |
| 2002 type##_function->SetInstanceClassName(*factory->name##_string()); |
| 2003 |
| 2004 SIMD128_TYPES(SIMD128_INSTALL_FUNCTION) |
2002 } | 2005 } |
2003 | 2006 |
2004 | 2007 |
2005 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, | 2008 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, |
2006 const char* name, | 2009 const char* name, |
2007 ElementsKind elements_kind) { | 2010 ElementsKind elements_kind) { |
2008 // --- I n t e r n a l A r r a y --- | 2011 // --- I n t e r n a l A r r a y --- |
2009 // An array constructor on the builtins object that works like | 2012 // An array constructor on the builtins object that works like |
2010 // the public Array constructor, except that its prototype | 2013 // the public Array constructor, except that its prototype |
2011 // doesn't inherit from Object.prototype. | 2014 // doesn't inherit from Object.prototype. |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3305 } | 3308 } |
3306 | 3309 |
3307 | 3310 |
3308 // Called when the top-level V8 mutex is destroyed. | 3311 // Called when the top-level V8 mutex is destroyed. |
3309 void Bootstrapper::FreeThreadResources() { | 3312 void Bootstrapper::FreeThreadResources() { |
3310 DCHECK(!IsActive()); | 3313 DCHECK(!IsActive()); |
3311 } | 3314 } |
3312 | 3315 |
3313 } // namespace internal | 3316 } // namespace internal |
3314 } // namespace v8 | 3317 } // namespace v8 |
OLD | NEW |