Revision: 17983
Author: [email protected]
Date: Thu Nov 21 17:55:03 2013 UTC
Log: Use %_IsSmi instead of %MaxSmi.
ToPositiveInteger already makes sure that if l can be represented as a
smi, it will be represented as a smi. This way we can avoid doing a
runtime call to retrieve a constant.
[email protected]
Review URL: https://codereview.chromium.org/81063002
http://code.google.com/p/v8/source/detail?r=17983
Modified:
/branches/bleeding_edge/src/typedarray.js
=======================================
--- /branches/bleeding_edge/src/typedarray.js Mon Nov 18 13:57:49 2013 UTC
+++ /branches/bleeding_edge/src/typedarray.js Thu Nov 21 17:55:03 2013 UTC
@@ -86,8 +86,8 @@
function NAMEConstructByLength(obj, length) {
var l = IS_UNDEFINED(length) ?
- 0 : ToPositiveInteger(length, "invalid_typed_array_length");
- if (l > %MaxSmi()) {
+ 0 : ToPositiveInteger(length, "invalid_typed_array_length");
+ if (!%_IsSmi(l)) {
throw MakeRangeError("invalid_typed_array_length");
}
var byteLength = l * ELEMENT_SIZE;
@@ -98,7 +98,7 @@
function NAMEConstructByArrayLike(obj, arrayLike) {
var length = arrayLike.length;
var l = ToPositiveInteger(length, "invalid_typed_array_length");
- if(!%TypedArrayInitializeFromArrayLike(obj, ARRAY_ID, arrayLike, l)) {
+ if (!%TypedArrayInitializeFromArrayLike(obj, ARRAY_ID, arrayLike, l)) {
for (var i = 0; i < l; i++) {
// It is crucial that we let any execptions from arrayLike[i]
// propagate outside the function.
@@ -108,7 +108,6 @@
}
function NAMEConstructor(arg1, arg2, arg3) {
-
if (%_IsConstructCall()) {
if (IS_ARRAYBUFFER(arg1)) {
NAMEConstructByArrayBuffer(this, arg1, arg2, arg3);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.