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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/messages.h" | 8 #include "src/messages.h" |
9 #include "src/runtime/runtime-utils.h" | 9 #include "src/runtime/runtime-utils.h" |
10 | 10 |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 !array->HasFixedTypedArrayElements() && | 1234 !array->HasFixedTypedArrayElements() && |
1235 !array->IsJSGlobalProxy()); | 1235 !array->IsJSGlobalProxy()); |
1236 JSObject::NormalizeElements(array); | 1236 JSObject::NormalizeElements(array); |
1237 return *array; | 1237 return *array; |
1238 } | 1238 } |
1239 | 1239 |
1240 | 1240 |
1241 // GrowArrayElements returns a sentinel Smi if the object was normalized. | 1241 // GrowArrayElements returns a sentinel Smi if the object was normalized. |
1242 RUNTIME_FUNCTION(Runtime_GrowArrayElements) { | 1242 RUNTIME_FUNCTION(Runtime_GrowArrayElements) { |
1243 HandleScope scope(isolate); | 1243 HandleScope scope(isolate); |
1244 DCHECK(args.length() == 3); | 1244 DCHECK(args.length() == 2); |
1245 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 1245 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
1246 CONVERT_NUMBER_CHECKED(int, key, Int32, args[1]); | 1246 CONVERT_NUMBER_CHECKED(int, key, Int32, args[1]); |
1247 | 1247 |
1248 if (key < 0) { | 1248 if (key < 0) { |
1249 return object->elements(); | 1249 return object->elements(); |
1250 } | 1250 } |
1251 | 1251 |
1252 uint32_t capacity = static_cast<uint32_t>(object->elements()->length()); | 1252 uint32_t capacity = static_cast<uint32_t>(object->elements()->length()); |
1253 uint32_t index = static_cast<uint32_t>(key); | 1253 uint32_t index = static_cast<uint32_t>(key); |
1254 | 1254 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 | 1412 |
1413 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { | 1413 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { |
1414 SealHandleScope shs(isolate); | 1414 SealHandleScope shs(isolate); |
1415 DCHECK(args.length() == 2); | 1415 DCHECK(args.length() == 2); |
1416 // Returning undefined means that this fast path fails and one has to resort | 1416 // Returning undefined means that this fast path fails and one has to resort |
1417 // to a slow path. | 1417 // to a slow path. |
1418 return isolate->heap()->undefined_value(); | 1418 return isolate->heap()->undefined_value(); |
1419 } | 1419 } |
1420 } | 1420 } |
1421 } // namespace v8::internal | 1421 } // namespace v8::internal |
OLD | NEW |