-
Notifications
You must be signed in to change notification settings - Fork 683
[ES2015][TypedArray] Add other 8 types #1532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LaszloLango
merged 1 commit into
jerryscript-project:master
from
jiangzidong:typedarray0118
Jan 24, 2017
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,6 +349,120 @@ BUILTIN (ECMA_BUILTIN_ID_INT8ARRAY, | |
true, | ||
int8array) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT8ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
uint8array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT8ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
uint8array) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_INT16ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
int16array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_INT16ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
int16array) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT16ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
uint16array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT16ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
uint16array) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_INT32ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
int32array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_INT32ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
int32array) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
uint32array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT32ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
uint32array) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
float32array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_FLOAT32ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
float32array) | ||
|
||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put a newline before this # if |
||
BUILTIN (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
float64array_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_FLOAT64ARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
float64array) | ||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */ | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE, | ||
ECMA_OBJECT_TYPE_GENERAL, | ||
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, | ||
true, | ||
true, | ||
uint8clampedarray_prototype) | ||
|
||
BUILTIN (ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY, | ||
ECMA_OBJECT_TYPE_FUNCTION, | ||
ECMA_BUILTIN_ID_TYPEDARRAY, | ||
true, | ||
true, | ||
uint8clampedarray) | ||
|
||
#endif /* !CONFIG_DISABLE_TYPEDARRAY_BUILTIN */ | ||
|
||
/* The Global object (15.1) */ | ||
|
43 changes: 43 additions & 0 deletions
43
jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* Copyright JS Foundation and other contributors, http://js.foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "ecma-builtins.h" | ||
|
||
#ifndef CONFIG_DISABLE_TYPEDARRAY_BUILTIN | ||
|
||
#define ECMA_BUILTINS_INTERNAL | ||
#include "ecma-builtins-internal.h" | ||
|
||
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-float32array-prototype.inc.h" | ||
#define BUILTIN_UNDERSCORED_ID float32array_prototype | ||
#include "ecma-builtin-internal-routines-template.inc.h" | ||
|
||
/** \addtogroup ecma ECMA | ||
* @{ | ||
* | ||
* \addtogroup ecmabuiltins | ||
* @{ | ||
* | ||
* \addtogroup float32arrayprototype ECMA Float32Array.prototype object built-in | ||
* @{ | ||
*/ | ||
|
||
/** | ||
* @} | ||
* @} | ||
* @} | ||
*/ | ||
|
||
#endif /* !CONFIG_DISABLE_TYPEDARRAY_BUILTIN */ |
51 changes: 51 additions & 0 deletions
51
jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float32array-prototype.inc.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* Copyright JS Foundation and other contributors, http://js.foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Float32Array prototype description | ||
*/ | ||
#ifndef NUMBER_VALUE | ||
# define NUMBER_VALUE(name, number_value, prop_attributes) | ||
#endif /* !NUMBER_VALUE */ | ||
|
||
#ifndef STRING_VALUE | ||
# define STRING_VALUE(name, magic_string_id, prop_attributes) | ||
#endif /* !STRING_VALUE */ | ||
|
||
#ifndef OBJECT_VALUE | ||
# define OBJECT_VALUE(name, obj_builtin_id, prop_attributes) | ||
#endif /* !OBJECT_VALUE */ | ||
|
||
#ifndef ROUTINE | ||
# define ROUTINE(name, c_function_name, args_number, length_prop_value) | ||
#endif /* !ROUTINE */ | ||
|
||
/* ES2015 22.2.3.4 */ | ||
OBJECT_VALUE (LIT_MAGIC_STRING_CONSTRUCTOR, | ||
ECMA_BUILTIN_ID_FLOAT32ARRAY, | ||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE) | ||
|
||
/* ES2015 22.2.6.1 */ | ||
NUMBER_VALUE (LIT_MAGIC_STRING_BYTES_PER_ELEMENT_U, | ||
4, | ||
ECMA_PROPERTY_FIXED) | ||
|
||
#undef SIMPLE_VALUE | ||
#undef NUMBER_VALUE | ||
#undef STRING_VALUE | ||
#undef OBJECT_VALUE | ||
#undef ROUTINE | ||
#undef ACCESSOR_READ_WRITE | ||
#undef ACCESSOR_READ_ONLY |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because now the longest class name is Uint8ClampedArray, and 19 is not enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the comment.