i::Isolate* isolate = self->GetIsolate();
LOG_API(isolate, "Map::Clear");
ENTER_V8(isolate);
- i::Runtime::JSMapClear(isolate, self);
+ i::JSMap::Clear(self);
}
i::Isolate* isolate = self->GetIsolate();
LOG_API(isolate, "Set::Clear");
ENTER_V8(isolate);
- i::Runtime::JSSetClear(isolate, self);
+ i::JSSet::Clear(self);
}
"Only neuterable ArrayBuffers can be neutered");
LOG_API(obj->GetIsolate(), "v8::ArrayBuffer::Neuter()");
ENTER_V8(isolate);
- i::Runtime::NeuterArrayBuffer(obj);
+ obj->Neuter();
}
Handle<JSMap> Factory::NewJSMap() {
Handle<Map> map(isolate()->native_context()->js_map_map());
Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map));
- Runtime::JSMapInitialize(isolate(), js_map);
+ JSMap::Initialize(js_map, isolate());
return js_map;
}
Handle<JSSet> Factory::NewJSSet() {
Handle<Map> map(isolate()->native_context()->js_set_map());
Handle<JSSet> js_set = Handle<JSSet>::cast(NewJSObjectFromMap(map));
- Runtime::JSSetInitialize(isolate(), js_set);
+ JSSet::Initialize(js_set, isolate());
return js_set;
}
OrderedHashTableIterator<JSMapIterator, OrderedHashMap>::Transition();
+void JSSet::Initialize(Handle<JSSet> set, Isolate* isolate) {
+ Handle<OrderedHashSet> table = isolate->factory()->NewOrderedHashSet();
+ set->set_table(*table);
+}
+
+
+void JSSet::Clear(Handle<JSSet> set) {
+ Handle<OrderedHashSet> table(OrderedHashSet::cast(set->table()));
+ table = OrderedHashSet::Clear(table);
+ set->set_table(*table);
+}
+
+
+void JSMap::Initialize(Handle<JSMap> map, Isolate* isolate) {
+ Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap();
+ map->set_table(*table);
+}
+
+
+void JSMap::Clear(Handle<JSMap> map) {
+ Handle<OrderedHashMap> table(OrderedHashMap::cast(map->table()));
+ table = OrderedHashMap::Clear(table);
+ map->set_table(*table);
+}
+
+
// Check if there is a break point at this code position.
bool DebugInfo::HasBreakPoint(int code_position) {
// Get the break point info object for this code position.
public:
DECLARE_CAST(JSSet)
+ static void Initialize(Handle<JSSet> set, Isolate* isolate);
+ static void Clear(Handle<JSSet> set);
+
// Dispatched behavior.
DECLARE_PRINTER(JSSet)
DECLARE_VERIFIER(JSSet)
public:
DECLARE_CAST(JSMap)
+ static void Initialize(Handle<JSMap> map, Isolate* isolate);
+ static void Clear(Handle<JSMap> map);
+
// Dispatched behavior.
DECLARE_PRINTER(JSMap)
DECLARE_VERIFIER(JSMap)
}
-void Runtime::JSSetInitialize(Isolate* isolate, Handle<JSSet> set) {
- Handle<OrderedHashSet> table = isolate->factory()->NewOrderedHashSet();
- set->set_table(*table);
-}
-
-
RUNTIME_FUNCTION(Runtime_SetInitialize) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSSet, holder, 0);
- Runtime::JSSetInitialize(isolate, holder);
+ JSSet::Initialize(holder, isolate);
return *holder;
}
}
-void Runtime::JSSetClear(Isolate* isolate, Handle<JSSet> set) {
- Handle<OrderedHashSet> table(OrderedHashSet::cast(set->table()));
- table = OrderedHashSet::Clear(table);
- set->set_table(*table);
-}
-
-
RUNTIME_FUNCTION(Runtime_SetClear) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSSet, holder, 0);
- Runtime::JSSetClear(isolate, holder);
+ JSSet::Clear(holder);
return isolate->heap()->undefined_value();
}
}
-void Runtime::JSMapInitialize(Isolate* isolate, Handle<JSMap> map) {
- Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap();
- map->set_table(*table);
-}
-
-
RUNTIME_FUNCTION(Runtime_MapInitialize) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0);
- Runtime::JSMapInitialize(isolate, holder);
+ JSMap::Initialize(holder, isolate);
return *holder;
}
}
-void Runtime::JSMapClear(Isolate* isolate, Handle<JSMap> map) {
- Handle<OrderedHashMap> table(OrderedHashMap::cast(map->table()));
- table = OrderedHashMap::Clear(table);
- map->set_table(*table);
-}
-
-
RUNTIME_FUNCTION(Runtime_MapClear) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0);
- Runtime::JSMapClear(isolate, holder);
+ JSMap::Clear(holder);
return isolate->heap()->undefined_value();
}
}
-void Runtime::NeuterArrayBuffer(Handle<JSArrayBuffer> array_buffer) {
- array_buffer->Neuter();
-}
-
-
RUNTIME_FUNCTION(Runtime_ArrayBufferInitialize) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
void* backing_store = array_buffer->backing_store();
size_t byte_length = NumberToSize(isolate, array_buffer->byte_length());
array_buffer->set_is_external(true);
- Runtime::NeuterArrayBuffer(array_buffer);
+ array_buffer->Neuter();
isolate->heap()->UnregisterArrayBuffer(
isolate->heap()->InNewSpace(*array_buffer), backing_store);
isolate->array_buffer_allocator()->Free(backing_store, byte_length);
size_t allocated_length, bool initialize = true,
SharedFlag shared = SharedFlag::kNotShared);
- static void NeuterArrayBuffer(Handle<JSArrayBuffer> array_buffer);
-
enum TypedArrayId {
// arrayIds below should be synchromized with typedarray.js natives.
ARRAY_ID_UINT8 = 1,
Isolate* isolate, Handle<FixedArray> literals,
Handle<FixedArray> elements, bool is_strong);
-
- static void JSMapInitialize(Isolate* isolate, Handle<JSMap> map);
- static void JSMapClear(Isolate* isolate, Handle<JSMap> map);
- static void JSSetInitialize(Isolate* isolate, Handle<JSSet> set);
- static void JSSetClear(Isolate* isolate, Handle<JSSet> set);
-
static void WeakCollectionInitialize(
Isolate* isolate, Handle<JSWeakCollection> weak_collection);
static void WeakCollectionSet(Handle<JSWeakCollection> weak_collection,