| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 02b6be4d3b7a4622a423d2232b9620796177afa7..e2229e3a392862cab548f4b7156dfe5842f0397f 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -472,11 +472,6 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
|
| }
|
|
|
|
|
| -v8::Handle<Value> ThrowException(v8::Handle<v8::Value> value) {
|
| - return v8::Isolate::GetCurrent()->ThrowException(value);
|
| -}
|
| -
|
| -
|
| RegisteredExtension* RegisteredExtension::first_extension_ = NULL;
|
|
|
|
|
| @@ -523,42 +518,6 @@ Extension::Extension(const char* name,
|
| }
|
|
|
|
|
| -v8::Handle<Primitive> Undefined() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) {
|
| - return v8::Handle<v8::Primitive>();
|
| - }
|
| - return ToApiHandle<Primitive>(isolate->factory()->undefined_value());
|
| -}
|
| -
|
| -
|
| -v8::Handle<Primitive> Null() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (!EnsureInitializedForIsolate(isolate, "v8::Null()")) {
|
| - return v8::Handle<v8::Primitive>();
|
| - }
|
| - return ToApiHandle<Primitive>(isolate->factory()->null_value());
|
| -}
|
| -
|
| -
|
| -v8::Handle<Boolean> True() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (!EnsureInitializedForIsolate(isolate, "v8::True()")) {
|
| - return v8::Handle<Boolean>();
|
| - }
|
| - return ToApiHandle<Boolean>(isolate->factory()->true_value());
|
| -}
|
| -
|
| -
|
| -v8::Handle<Boolean> False() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (!EnsureInitializedForIsolate(isolate, "v8::False()")) {
|
| - return v8::Handle<Boolean>();
|
| - }
|
| - return ToApiHandle<Boolean>(isolate->factory()->false_value());
|
| -}
|
| -
|
| -
|
| ResourceConstraints::ResourceConstraints()
|
| : max_young_space_size_(0),
|
| max_old_space_size_(0),
|
| @@ -605,11 +564,6 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
|
| }
|
|
|
|
|
| -void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory) {
|
| - ConfigureDefaults(physical_memory, i::CPU::NumberOfProcessorsOnline());
|
| -}
|
| -
|
| -
|
| bool SetResourceConstraints(Isolate* v8_isolate,
|
| ResourceConstraints* constraints) {
|
| i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
| @@ -655,12 +609,8 @@ i::Object** V8::CopyPersistent(i::Object** obj) {
|
|
|
| void V8::MakeWeak(i::Object** object,
|
| void* parameters,
|
| - WeakCallback weak_callback,
|
| - RevivableCallback weak_reference_callback) {
|
| - i::GlobalHandles::MakeWeak(object,
|
| - parameters,
|
| - weak_callback,
|
| - weak_reference_callback);
|
| + WeakCallback weak_callback) {
|
| + i::GlobalHandles::MakeWeak(object, parameters, weak_callback);
|
| }
|
|
|
|
|
| @@ -703,20 +653,12 @@ void HandleScope::Initialize(Isolate* isolate) {
|
| isolate_ = internal_isolate;
|
| prev_next_ = current->next;
|
| prev_limit_ = current->limit;
|
| - is_closed_ = false;
|
| current->level++;
|
| }
|
|
|
|
|
| HandleScope::~HandleScope() {
|
| - if (!is_closed_) {
|
| - Leave();
|
| - }
|
| -}
|
| -
|
| -
|
| -void HandleScope::Leave() {
|
| - return i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_);
|
| + i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_);
|
| }
|
|
|
|
|
| @@ -859,32 +801,6 @@ void Context::SetAlignedPointerInEmbedderData(int index, void* value) {
|
| }
|
|
|
|
|
| -i::Object** v8::HandleScope::RawClose(i::Object** value) {
|
| - if (!ApiCheck(!is_closed_,
|
| - "v8::HandleScope::Close()",
|
| - "Local scope has already been closed")) {
|
| - return 0;
|
| - }
|
| - LOG_API(isolate_, "CloseHandleScope");
|
| -
|
| - // Read the result before popping the handle block.
|
| - i::Object* result = NULL;
|
| - if (value != NULL) {
|
| - result = *value;
|
| - }
|
| - is_closed_ = true;
|
| - Leave();
|
| -
|
| - if (value == NULL) {
|
| - return NULL;
|
| - }
|
| -
|
| - // Allocate a new handle on the previous handle block.
|
| - i::Handle<i::Object> handle(result, isolate_);
|
| - return handle.location();
|
| -}
|
| -
|
| -
|
| // --- N e a n d e r ---
|
|
|
|
|
| @@ -1124,12 +1040,6 @@ Local<Signature> Signature::New(Isolate* isolate,
|
| }
|
|
|
|
|
| -Local<Signature> Signature::New(Handle<FunctionTemplate> receiver,
|
| - int argc, Handle<FunctionTemplate> argv[]) {
|
| - return New(Isolate::GetCurrent(), receiver, argc, argv);
|
| -}
|
| -
|
| -
|
| Local<AccessorSignature> AccessorSignature::New(
|
| Isolate* isolate,
|
| Handle<FunctionTemplate> receiver) {
|
| @@ -1137,13 +1047,6 @@ Local<AccessorSignature> AccessorSignature::New(
|
| }
|
|
|
|
|
| -// While this is just a cast, it's lame not to use an Isolate parameter.
|
| -Local<AccessorSignature> AccessorSignature::New(
|
| - Handle<FunctionTemplate> receiver) {
|
| - return Utils::AccessorSignatureToLocal(Utils::OpenHandle(*receiver));
|
| -}
|
| -
|
| -
|
| template<typename Operation>
|
| static Local<Operation> NewDescriptor(
|
| Isolate* isolate,
|
| @@ -1920,25 +1823,6 @@ static i::Handle<i::SharedFunctionInfo> OpenScript(Script* script) {
|
| }
|
|
|
|
|
| -Local<Value> Script::Id() {
|
| - i::Handle<i::HeapObject> obj =
|
| - i::Handle<i::HeapObject>::cast(Utils::OpenHandle(this));
|
| - i::Isolate* isolate = obj->GetIsolate();
|
| - ON_BAILOUT(isolate, "v8::Script::Id()", return Local<Value>());
|
| - LOG_API(isolate, "Script::Id");
|
| - i::Object* raw_id = NULL;
|
| - {
|
| - i::HandleScope scope(isolate);
|
| - i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this);
|
| - i::Handle<i::Script> script(i::Script::cast(function_info->script()));
|
| - i::Handle<i::Object> id(script->id(), isolate);
|
| - raw_id = *id;
|
| - }
|
| - i::Handle<i::Object> id(raw_id, isolate);
|
| - return Utils::ToLocal(id);
|
| -}
|
| -
|
| -
|
| int Script::GetId() {
|
| i::Handle<i::HeapObject> obj =
|
| i::Handle<i::HeapObject>::cast(Utils::OpenHandle(this));
|
| @@ -2321,11 +2205,6 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
| }
|
|
|
|
|
| -void Message::PrintCurrentStackTrace(FILE* out) {
|
| - PrintCurrentStackTrace(Isolate::GetCurrent(), out);
|
| -}
|
| -
|
| -
|
| // --- S t a c k T r a c e ---
|
|
|
| Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
|
| @@ -2365,12 +2244,6 @@ Local<StackTrace> StackTrace::CurrentStackTrace(
|
| }
|
|
|
|
|
| -Local<StackTrace> StackTrace::CurrentStackTrace(int frame_limit,
|
| - StackTraceOptions options) {
|
| - return CurrentStackTrace(Isolate::GetCurrent(), frame_limit, options);
|
| -}
|
| -
|
| -
|
| // --- S t a c k F r a m e ---
|
|
|
| int StackFrame::GetLineNumber() const {
|
| @@ -4286,17 +4159,6 @@ bool Function::IsBuiltin() const {
|
| }
|
|
|
|
|
| -Handle<Value> Function::GetScriptId() const {
|
| - i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
|
| - i::Isolate* isolate = func->GetIsolate();
|
| - if (!func->shared()->script()->IsScript()) {
|
| - return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
|
| - }
|
| - i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
|
| - return Utils::ToLocal(i::Handle<i::Object>(script->id(), isolate));
|
| -}
|
| -
|
| -
|
| int Function::ScriptId() const {
|
| i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
|
| if (!func->shared()->script()->IsScript()) return v8::Script::kNoScriptId;
|
| @@ -5373,38 +5235,12 @@ bool Context::HasOutOfMemoryException() {
|
| }
|
|
|
|
|
| -bool Context::InContext() {
|
| - return i::Isolate::Current()->context() != NULL;
|
| -}
|
| -
|
| -
|
| v8::Isolate* Context::GetIsolate() {
|
| i::Handle<i::Context> env = Utils::OpenHandle(this);
|
| return reinterpret_cast<Isolate*>(env->GetIsolate());
|
| }
|
|
|
|
|
| -v8::Local<v8::Context> Context::GetEntered() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (!EnsureInitializedForIsolate(isolate, "v8::Context::GetEntered()")) {
|
| - return Local<Context>();
|
| - }
|
| - return reinterpret_cast<Isolate*>(isolate)->GetEnteredContext();
|
| -}
|
| -
|
| -
|
| -v8::Local<v8::Context> Context::GetCurrent() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - return reinterpret_cast<Isolate*>(isolate)->GetCurrentContext();
|
| -}
|
| -
|
| -
|
| -v8::Local<v8::Context> Context::GetCalling() {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - return reinterpret_cast<Isolate*>(isolate)->GetCallingContext();
|
| -}
|
| -
|
| -
|
| v8::Local<v8::Object> Context::Global() {
|
| i::Handle<i::Context> context = Utils::OpenHandle(this);
|
| i::Isolate* isolate = context->GetIsolate();
|
| @@ -5499,11 +5335,6 @@ Local<External> v8::External::New(Isolate* isolate, void* value) {
|
| }
|
|
|
|
|
| -Local<External> v8::External::New(void* value) {
|
| - return v8::External::New(Isolate::GetCurrent(), value);
|
| -}
|
| -
|
| -
|
| void* External::Value() const {
|
| return ExternalValue(*Utils::OpenHandle(this));
|
| }
|
| @@ -5695,12 +5526,6 @@ Local<String> v8::String::NewExternal(
|
| }
|
|
|
|
|
| -Local<String> v8::String::NewExternal(
|
| - v8::String::ExternalStringResource* resource) {
|
| - return NewExternal(Isolate::GetCurrent(), resource);
|
| -}
|
| -
|
| -
|
| bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
|
| i::Handle<i::String> obj = Utils::OpenHandle(this);
|
| i::Isolate* isolate = obj->GetIsolate();
|
| @@ -5752,12 +5577,6 @@ Local<String> v8::String::NewExternal(
|
| }
|
|
|
|
|
| -Local<String> v8::String::NewExternal(
|
| - v8::String::ExternalAsciiStringResource* resource) {
|
| - return NewExternal(Isolate::GetCurrent(), resource);
|
| -}
|
| -
|
| -
|
| bool v8::String::MakeExternal(
|
| v8::String::ExternalAsciiStringResource* resource) {
|
| i::Handle<i::String> obj = Utils::OpenHandle(this);
|
| @@ -5840,11 +5659,6 @@ Local<v8::Value> v8::NumberObject::New(Isolate* isolate, double value) {
|
| }
|
|
|
|
|
| -Local<v8::Value> v8::NumberObject::New(double value) {
|
| - return New(Isolate::GetCurrent(), value);
|
| -}
|
| -
|
| -
|
| double v8::NumberObject::ValueOf() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| LOG_API(isolate, "NumberObject::NumberValue");
|
| @@ -5936,11 +5750,6 @@ Local<v8::Value> v8::Date::New(Isolate* isolate, double time) {
|
| }
|
|
|
|
|
| -Local<v8::Value> v8::Date::New(double time) {
|
| - return New(Isolate::GetCurrent(), time);
|
| -}
|
| -
|
| -
|
| double v8::Date::ValueOf() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| LOG_API(isolate, "Date::NumberValue");
|
| @@ -5986,11 +5795,6 @@ void v8::Date::DateTimeConfigurationChangeNotification(Isolate* isolate) {
|
| }
|
|
|
|
|
| -void v8::Date::DateTimeConfigurationChangeNotification() {
|
| - DateTimeConfigurationChangeNotification(Isolate::GetCurrent());
|
| -}
|
| -
|
| -
|
| static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| uint8_t flags_buf[3];
|
| @@ -6056,11 +5860,6 @@ Local<v8::Array> v8::Array::New(Isolate* isolate, int length) {
|
| }
|
|
|
|
|
| -Local<v8::Array> v8::Array::New(int length) {
|
| - return New(Isolate::GetCurrent(), length);
|
| -}
|
| -
|
| -
|
| uint32_t v8::Array::Length() const {
|
| i::Handle<i::JSArray> obj = Utils::OpenHandle(this);
|
| i::Object* length = obj->length();
|
| @@ -6156,11 +5955,6 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, size_t byte_length) {
|
| }
|
|
|
|
|
| -Local<ArrayBuffer> v8::ArrayBuffer::New(size_t byte_length) {
|
| - return New(Isolate::GetCurrent(), byte_length);
|
| -}
|
| -
|
| -
|
| Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, void* data,
|
| size_t byte_length) {
|
| i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
| @@ -6174,11 +5968,6 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, void* data,
|
| }
|
|
|
|
|
| -Local<ArrayBuffer> v8::ArrayBuffer::New(void* data, size_t byte_length) {
|
| - return New(Isolate::GetCurrent(), data, byte_length);
|
| -}
|
| -
|
| -
|
| Local<ArrayBuffer> v8::ArrayBufferView::Buffer() {
|
| i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
|
| ASSERT(obj->buffer()->IsJSArrayBuffer());
|
| @@ -6511,16 +6300,6 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
|
| }
|
|
|
|
|
| -int64_t V8::AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes) {
|
| - i::Isolate* isolate = i::Isolate::UncheckedCurrent();
|
| - if (isolate == NULL || !isolate->IsInitialized()) {
|
| - return 0;
|
| - }
|
| - Isolate* isolate_ext = reinterpret_cast<Isolate*>(isolate);
|
| - return isolate_ext->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
|
| -}
|
| -
|
| -
|
| HeapProfiler* Isolate::GetHeapProfiler() {
|
| i::HeapProfiler* heap_profiler =
|
| reinterpret_cast<i::Isolate*>(this)->heap_profiler();
|
| @@ -6793,27 +6572,6 @@ String::Utf8Value::~Utf8Value() {
|
| }
|
|
|
|
|
| -String::AsciiValue::AsciiValue(v8::Handle<v8::Value> obj)
|
| - : str_(NULL), length_(0) {
|
| - i::Isolate* isolate = i::Isolate::Current();
|
| - if (obj.IsEmpty()) return;
|
| - ENTER_V8(isolate);
|
| - i::HandleScope scope(isolate);
|
| - TryCatch try_catch;
|
| - Handle<String> str = obj->ToString();
|
| - if (str.IsEmpty()) return;
|
| - length_ = str->Utf8Length();
|
| - str_ = i::NewArray<char>(length_ + 1);
|
| - str->WriteUtf8(str_);
|
| - ASSERT(i::String::NonAsciiStart(str_, length_) >= length_);
|
| -}
|
| -
|
| -
|
| -String::AsciiValue::~AsciiValue() {
|
| - i::DeleteArray(str_);
|
| -}
|
| -
|
| -
|
| String::Value::Value(v8::Handle<v8::Value> obj)
|
| : str_(NULL), length_(0) {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| @@ -7527,16 +7285,6 @@ void HeapProfiler::SetRetainedObjectInfo(UniqueId id,
|
| }
|
|
|
|
|
| -void HeapProfiler::StartRecordingHeapAllocations() {
|
| - reinterpret_cast<i::HeapProfiler*>(this)->StartHeapObjectsTracking(true);
|
| -}
|
| -
|
| -
|
| -void HeapProfiler::StopRecordingHeapAllocations() {
|
| - reinterpret_cast<i::HeapProfiler*>(this)->StopHeapObjectsTracking();
|
| -}
|
| -
|
| -
|
| v8::Testing::StressType internal::Testing::stress_type_ =
|
| v8::Testing::kStressTypeOpt;
|
|
|
|
|