| Index: src/top.cc
|
| ===================================================================
|
| --- src/top.cc (revision 4205)
|
| +++ src/top.cc (working copy)
|
| @@ -88,19 +88,30 @@
|
| }
|
|
|
|
|
| +void Top::IterateThread(ThreadVisitor* v) {
|
| + v->VisitThread(&thread_local_);
|
| +}
|
| +
|
| +
|
| +void Top::IterateThread(ThreadVisitor* v, char* t) {
|
| + ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(t);
|
| + v->VisitThread(thread);
|
| +}
|
| +
|
| +
|
| void Top::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) {
|
| v->VisitPointer(&(thread->pending_exception_));
|
| v->VisitPointer(&(thread->pending_message_obj_));
|
| v->VisitPointer(
|
| - bit_cast<Object**, Script**>(&(thread->pending_message_script_)));
|
| - v->VisitPointer(bit_cast<Object**, Context**>(&(thread->context_)));
|
| + BitCast<Object**, Script**>(&(thread->pending_message_script_)));
|
| + v->VisitPointer(BitCast<Object**, Context**>(&(thread->context_)));
|
| v->VisitPointer(&(thread->scheduled_exception_));
|
|
|
| for (v8::TryCatch* block = thread->TryCatchHandler();
|
| block != NULL;
|
| block = TRY_CATCH_FROM_ADDRESS(block->next_)) {
|
| - v->VisitPointer(bit_cast<Object**, void**>(&(block->exception_)));
|
| - v->VisitPointer(bit_cast<Object**, void**>(&(block->message_)));
|
| + v->VisitPointer(BitCast<Object**, void**>(&(block->exception_)));
|
| + v->VisitPointer(BitCast<Object**, void**>(&(block->message_)));
|
| }
|
|
|
| // Iterate over pointers on native execution stack.
|
| @@ -439,10 +450,9 @@
|
|
|
| // Get the data object from access check info.
|
| JSFunction* constructor = JSFunction::cast(receiver->map()->constructor());
|
| - Object* info = constructor->shared()->function_data();
|
| - if (info == Heap::undefined_value()) return;
|
| -
|
| - Object* data_obj = FunctionTemplateInfo::cast(info)->access_check_info();
|
| + if (!constructor->shared()->IsApiFunction()) return;
|
| + Object* data_obj =
|
| + constructor->shared()->get_api_func_data()->access_check_info();
|
| if (data_obj == Heap::undefined_value()) return;
|
|
|
| HandleScope scope;
|
| @@ -502,10 +512,10 @@
|
|
|
| // Get named access check callback
|
| JSFunction* constructor = JSFunction::cast(receiver->map()->constructor());
|
| - Object* info = constructor->shared()->function_data();
|
| - if (info == Heap::undefined_value()) return false;
|
| + if (!constructor->shared()->IsApiFunction()) return false;
|
|
|
| - Object* data_obj = FunctionTemplateInfo::cast(info)->access_check_info();
|
| + Object* data_obj =
|
| + constructor->shared()->get_api_func_data()->access_check_info();
|
| if (data_obj == Heap::undefined_value()) return false;
|
|
|
| Object* fun_obj = AccessCheckInfo::cast(data_obj)->named_callback();
|
| @@ -547,10 +557,10 @@
|
|
|
| // Get indexed access check callback
|
| JSFunction* constructor = JSFunction::cast(receiver->map()->constructor());
|
| - Object* info = constructor->shared()->function_data();
|
| - if (info == Heap::undefined_value()) return false;
|
| + if (!constructor->shared()->IsApiFunction()) return false;
|
|
|
| - Object* data_obj = FunctionTemplateInfo::cast(info)->access_check_info();
|
| + Object* data_obj =
|
| + constructor->shared()->get_api_func_data()->access_check_info();
|
| if (data_obj == Heap::undefined_value()) return false;
|
|
|
| Object* fun_obj = AccessCheckInfo::cast(data_obj)->indexed_callback();
|
| @@ -950,27 +960,6 @@
|
| }
|
|
|
|
|
| -bool Top::CanHaveSpecialFunctions(JSObject* object) {
|
| - return object->IsJSArray();
|
| -}
|
| -
|
| -
|
| -Object* Top::LookupSpecialFunction(JSObject* receiver,
|
| - JSObject* prototype,
|
| - JSFunction* function) {
|
| - if (CanHaveSpecialFunctions(receiver)) {
|
| - FixedArray* table = context()->global_context()->special_function_table();
|
| - for (int index = 0; index < table->length(); index +=3) {
|
| - if ((prototype == table->get(index)) &&
|
| - (function == table->get(index+1))) {
|
| - return table->get(index+2);
|
| - }
|
| - }
|
| - }
|
| - return Heap::undefined_value();
|
| -}
|
| -
|
| -
|
| char* Top::ArchiveThread(char* to) {
|
| memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_));
|
| InitializeThreadLocal();
|
|
|