OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1597 kind == JSSetIterator::kKindEntries); | 1597 kind == JSSetIterator::kKindEntries); |
1598 Handle<OrderedHashSet> table(OrderedHashSet::cast(set->table())); | 1598 Handle<OrderedHashSet> table(OrderedHashSet::cast(set->table())); |
1599 holder->set_table(*table); | 1599 holder->set_table(*table); |
1600 holder->set_index(Smi::FromInt(0)); | 1600 holder->set_index(Smi::FromInt(0)); |
1601 holder->set_kind(Smi::FromInt(kind)); | 1601 holder->set_kind(Smi::FromInt(kind)); |
1602 return isolate->heap()->undefined_value(); | 1602 return isolate->heap()->undefined_value(); |
1603 } | 1603 } |
1604 | 1604 |
1605 | 1605 |
1606 RUNTIME_FUNCTION(Runtime_SetIteratorNext) { | 1606 RUNTIME_FUNCTION(Runtime_SetIteratorNext) { |
1607 HandleScope scope(isolate); | 1607 SealHandleScope shs(isolate); |
Jakob Kummerow
2014/06/27 15:37:51
no
danno
2014/06/27 17:43:28
Done.
| |
1608 ASSERT(args.length() == 1); | 1608 ASSERT(args.length() == 2); |
1609 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0); | 1609 CONVERT_ARG_CHECKED(JSSetIterator, holder, 0); |
1610 return *JSSetIterator::Next(holder); | 1610 CONVERT_ARG_CHECKED(JSArray, value_array, 1); |
1611 return holder->Next(value_array); | |
1611 } | 1612 } |
1612 | 1613 |
1613 | 1614 |
1614 RUNTIME_FUNCTION(Runtime_MapInitialize) { | 1615 RUNTIME_FUNCTION(Runtime_MapInitialize) { |
1615 HandleScope scope(isolate); | 1616 HandleScope scope(isolate); |
1616 ASSERT(args.length() == 1); | 1617 ASSERT(args.length() == 1); |
1617 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); | 1618 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); |
1618 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap(); | 1619 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap(); |
1619 holder->set_table(*table); | 1620 holder->set_table(*table); |
1620 return *holder; | 1621 return *holder; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1701 || kind == JSMapIterator::kKindEntries); | 1702 || kind == JSMapIterator::kKindEntries); |
1702 Handle<OrderedHashMap> table(OrderedHashMap::cast(map->table())); | 1703 Handle<OrderedHashMap> table(OrderedHashMap::cast(map->table())); |
1703 holder->set_table(*table); | 1704 holder->set_table(*table); |
1704 holder->set_index(Smi::FromInt(0)); | 1705 holder->set_index(Smi::FromInt(0)); |
1705 holder->set_kind(Smi::FromInt(kind)); | 1706 holder->set_kind(Smi::FromInt(kind)); |
1706 return isolate->heap()->undefined_value(); | 1707 return isolate->heap()->undefined_value(); |
1707 } | 1708 } |
1708 | 1709 |
1709 | 1710 |
1710 RUNTIME_FUNCTION(Runtime_MapIteratorNext) { | 1711 RUNTIME_FUNCTION(Runtime_MapIteratorNext) { |
1711 HandleScope scope(isolate); | 1712 SealHandleScope shs(isolate); |
1712 ASSERT(args.length() == 1); | 1713 ASSERT(args.length() == 2); |
1713 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0); | 1714 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0); |
1714 return *JSMapIterator::Next(holder); | 1715 CONVERT_ARG_CHECKED(JSArray, value_array, 1); |
1716 return holder->Next(value_array); | |
1715 } | 1717 } |
1716 | 1718 |
1717 | 1719 |
1718 static Handle<JSWeakCollection> WeakCollectionInitialize( | 1720 static Handle<JSWeakCollection> WeakCollectionInitialize( |
1719 Isolate* isolate, | 1721 Isolate* isolate, |
1720 Handle<JSWeakCollection> weak_collection) { | 1722 Handle<JSWeakCollection> weak_collection) { |
1721 ASSERT(weak_collection->map()->inobject_properties() == 0); | 1723 ASSERT(weak_collection->map()->inobject_properties() == 0); |
1722 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); | 1724 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); |
1723 weak_collection->set_table(*table); | 1725 weak_collection->set_table(*table); |
1724 return weak_collection; | 1726 return weak_collection; |
(...skipping 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4469 } | 4471 } |
4470 RUNTIME_ASSERT(end >= start); | 4472 RUNTIME_ASSERT(end >= start); |
4471 RUNTIME_ASSERT(start >= 0); | 4473 RUNTIME_ASSERT(start >= 0); |
4472 RUNTIME_ASSERT(end <= string->length()); | 4474 RUNTIME_ASSERT(end <= string->length()); |
4473 isolate->counters()->sub_string_runtime()->Increment(); | 4475 isolate->counters()->sub_string_runtime()->Increment(); |
4474 | 4476 |
4475 return *isolate->factory()->NewSubString(string, start, end); | 4477 return *isolate->factory()->NewSubString(string, start, end); |
4476 } | 4478 } |
4477 | 4479 |
4478 | 4480 |
4481 RUNTIME_FUNCTION(Runtime_InternalizeString) { | |
4482 HandleScope handles(isolate); | |
4483 RUNTIME_ASSERT(args.length() == 1); | |
4484 CONVERT_ARG_HANDLE_CHECKED(String, string, 0); | |
4485 return *isolate->factory()->InternalizeString(string); | |
4486 } | |
4487 | |
4488 | |
4479 RUNTIME_FUNCTION(Runtime_StringMatch) { | 4489 RUNTIME_FUNCTION(Runtime_StringMatch) { |
4480 HandleScope handles(isolate); | 4490 HandleScope handles(isolate); |
4481 ASSERT(args.length() == 3); | 4491 ASSERT(args.length() == 3); |
4482 | 4492 |
4483 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); | 4493 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); |
4484 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); | 4494 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); |
4485 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); | 4495 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); |
4486 | 4496 |
4487 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); | 4497 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); |
4488 | 4498 |
(...skipping 10622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15111 } | 15121 } |
15112 return NULL; | 15122 return NULL; |
15113 } | 15123 } |
15114 | 15124 |
15115 | 15125 |
15116 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15126 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15117 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15127 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15118 } | 15128 } |
15119 | 15129 |
15120 } } // namespace v8::internal | 15130 } } // namespace v8::internal |
OLD | NEW |