OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 7987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7998 (first_block_limit_ <= &(blocks_.first())[kHandleBlockSize])); | 7998 (first_block_limit_ <= &(blocks_.first())[kHandleBlockSize])); |
7999 | 7999 |
8000 v->VisitPointers(blocks_.first(), first_block_limit_); | 8000 v->VisitPointers(blocks_.first(), first_block_limit_); |
8001 | 8001 |
8002 for (int i = 1; i < blocks_.length(); i++) { | 8002 for (int i = 1; i < blocks_.length(); i++) { |
8003 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 8003 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
8004 } | 8004 } |
8005 } | 8005 } |
8006 | 8006 |
8007 | 8007 |
8008 v8::Handle<v8::Value> InvokeAccessorGetter( | |
8009 v8::Local<v8::String> property, | |
8010 const v8::AccessorInfo& info, | |
8011 v8::AccessorGetter getter) { | |
8012 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | |
8013 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( | |
8014 getter)); | |
8015 // Leaving JavaScript. | |
8016 VMState<EXTERNAL> state(isolate); | |
8017 ExternalCallbackScope call_scope(isolate, getter_address); | |
8018 return getter(property, info); | |
8019 } | |
8020 | |
8021 | |
8022 void InvokeAccessorGetterCallback( | |
8023 v8::Local<v8::String> property, | |
8024 const v8::PropertyCallbackInfo<v8::Value>& info, | |
8025 v8::AccessorGetterCallback getter) { | |
8026 // Leaving JavaScript. | |
8027 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | |
8028 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( | |
8029 getter)); | |
8030 VMState<EXTERNAL> state(isolate); | |
8031 ExternalCallbackScope call_scope(isolate, getter_address); | |
8032 return getter(property, info); | |
8033 } | |
8034 | |
8035 | |
8036 v8::Handle<v8::Value> InvokeInvocationCallback( | |
8037 const v8::Arguments& args, | |
8038 v8::InvocationCallback callback) { | |
8039 Isolate* isolate = reinterpret_cast<Isolate*>(args.GetIsolate()); | |
8040 Address callback_address = | |
8041 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | |
8042 VMState<EXTERNAL> state(isolate); | |
8043 ExternalCallbackScope call_scope(isolate, callback_address); | |
8044 return callback(args); | |
8045 } | |
8046 | |
8047 | |
8048 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, | |
8049 v8::FunctionCallback callback) { | |
8050 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | |
8051 Address callback_address = | |
8052 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | |
8053 VMState<EXTERNAL> state(isolate); | |
8054 ExternalCallbackScope call_scope(isolate, callback_address); | |
8055 return callback(info); | |
8056 } | |
8057 | |
8058 | |
8059 } } // namespace v8::internal | 8008 } } // namespace v8::internal |
OLD | NEW |