Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index e8dbe221b603e6185845fc9dd6299ca5e0ec37cb..185ff26bf047e0205dcc1886bccb047450f9b144 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -515,7 +515,7 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object, |
// we reuse the receiver field to pass along a special symbol. |
Handle<Object> recv; |
if (exit_frame->IsConstructor()) { |
- recv = handle(heap()->call_site_constructor_symbol(), this); |
+ recv = factory()->call_site_constructor_symbol(); |
} else { |
recv = handle(exit_frame->receiver(), this); |
} |
@@ -532,7 +532,7 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object, |
WasmFrame* wasm_frame = WasmFrame::cast(frame); |
Code* code = wasm_frame->unchecked_code(); |
Handle<AbstractCode> abstract_code = |
- Handle<AbstractCode>(AbstractCode::cast(code)); |
+ Handle<AbstractCode>(AbstractCode::cast(code), this); |
int offset = |
static_cast<int>(wasm_frame->pc() - code->instruction_start()); |
elements = MaybeGrow(this, elements, cursor, cursor + 4); |
@@ -642,7 +642,7 @@ class CaptureStackTraceHelper { |
bool is_constructor) { |
Handle<JSObject> stack_frame = |
factory()->NewJSObject(isolate_->object_function()); |
- Handle<Script> script(Script::cast(fun->shared()->script())); |
+ Handle<Script> script(Script::cast(fun->shared()->script()), isolate_); |
if (!line_key_.is_null()) { |
Script::PositionInfo info; |
@@ -1404,7 +1404,7 @@ void Isolate::PrintCurrentStackTrace(FILE* out) { |
JavaScriptFrame* js_frame = JavaScriptFrame::cast(frame); |
Handle<Object> pos_obj(Smi::FromInt(pos), this); |
// Fetch function and receiver. |
- Handle<JSFunction> fun(js_frame->function()); |
+ Handle<JSFunction> fun(js_frame->function(), this); |
Handle<Object> recv(js_frame->receiver(), this); |
// Advance to the next JavaScript frame and determine if the |
// current frame is the top-level frame. |
@@ -1432,7 +1432,7 @@ bool Isolate::ComputeLocation(MessageLocation* target) { |
(Script::cast(script)->source()->IsUndefined(this))) { |
return false; |
} |
- Handle<Script> casted_script(Script::cast(script)); |
+ Handle<Script> casted_script(Script::cast(script), this); |
// Compute the location from the function and the relocation info of the |
// baseline code. For optimized code this will use the deoptimization |
// information to get canonical location information. |
@@ -1440,7 +1440,7 @@ bool Isolate::ComputeLocation(MessageLocation* target) { |
JavaScriptFrame::cast(frame)->Summarize(&frames); |
FrameSummary& summary = frames.last(); |
int pos = summary.abstract_code()->SourcePosition(summary.code_offset()); |
- *target = MessageLocation(casted_script, pos, pos + 1, handle(fun)); |
+ *target = MessageLocation(casted_script, pos, pos + 1, handle(fun, this)); |
return true; |
} |
@@ -1620,9 +1620,9 @@ void Isolate::ReportPendingMessages() { |
// Actually report the pending message to all message handlers. |
if (!message_obj->IsTheHole(this) && should_report_exception) { |
HandleScope scope(this); |
- Handle<JSMessageObject> message(JSMessageObject::cast(message_obj)); |
- Handle<JSValue> script_wrapper(JSValue::cast(message->script())); |
- Handle<Script> script(Script::cast(script_wrapper->value())); |
+ Handle<JSMessageObject> message(JSMessageObject::cast(message_obj), this); |
+ Handle<JSValue> script_wrapper(JSValue::cast(message->script()), this); |
+ Handle<Script> script(Script::cast(script_wrapper->value()), this); |
int start_pos = message->start_position(); |
int end_pos = message->end_position(); |
MessageLocation location(script, start_pos, end_pos); |
@@ -1637,9 +1637,9 @@ MessageLocation Isolate::GetMessageLocation() { |
if (thread_local_top_.pending_exception_ != heap()->termination_exception() && |
!thread_local_top_.pending_message_obj_->IsTheHole(this)) { |
Handle<JSMessageObject> message_obj( |
- JSMessageObject::cast(thread_local_top_.pending_message_obj_)); |
- Handle<JSValue> script_wrapper(JSValue::cast(message_obj->script())); |
- Handle<Script> script(Script::cast(script_wrapper->value())); |
+ JSMessageObject::cast(thread_local_top_.pending_message_obj_), this); |
+ Handle<JSValue> script_wrapper(JSValue::cast(message_obj->script()), this); |
+ Handle<Script> script(Script::cast(script_wrapper->value()), this); |
int start_pos = message_obj->start_position(); |
int end_pos = message_obj->end_position(); |
return MessageLocation(script, start_pos, end_pos); |
@@ -1749,11 +1749,6 @@ void Isolate::SetAbortOnUncaughtExceptionCallback( |
} |
-Handle<Context> Isolate::native_context() { |
- return handle(context()->native_context()); |
-} |
- |
- |
Handle<Context> Isolate::GetCallingNativeContext() { |
JavaScriptFrameIterator it(this); |
if (debug_->in_debug_scope()) { |
@@ -1770,7 +1765,7 @@ Handle<Context> Isolate::GetCallingNativeContext() { |
if (it.done()) return Handle<Context>::null(); |
JavaScriptFrame* frame = it.frame(); |
Context* context = Context::cast(frame->context()); |
- return Handle<Context>(context->native_context()); |
+ return Handle<Context>(context->native_context(), this); |
} |
@@ -2808,13 +2803,6 @@ void Isolate::RemoveBeforeCallEnteredCallback( |
} |
-void Isolate::FireBeforeCallEnteredCallback() { |
- for (int i = 0; i < before_call_entered_callbacks_.length(); i++) { |
- before_call_entered_callbacks_.at(i)(reinterpret_cast<v8::Isolate*>(this)); |
- } |
-} |
- |
- |
void Isolate::AddCallCompletedCallback(CallCompletedCallback callback) { |
for (int i = 0; i < call_completed_callbacks_.length(); i++) { |
if (callback == call_completed_callbacks_.at(i)) return; |
@@ -3026,7 +3014,7 @@ void Isolate::SetTailCallEliminationEnabled(bool enabled) { |
void Isolate::AddDetachedContext(Handle<Context> context) { |
HandleScope scope(this); |
Handle<WeakCell> cell = factory()->NewWeakCell(context); |
- Handle<FixedArray> detached_contexts(heap()->detached_contexts()); |
+ Handle<FixedArray> detached_contexts = factory()->detached_contexts(); |
int length = detached_contexts->length(); |
detached_contexts = factory()->CopyFixedArrayAndGrow(detached_contexts, 2); |
detached_contexts->set(length, Smi::FromInt(0)); |
@@ -3037,7 +3025,7 @@ void Isolate::AddDetachedContext(Handle<Context> context) { |
void Isolate::CheckDetachedContextsAfterGC() { |
HandleScope scope(this); |
- Handle<FixedArray> detached_contexts(heap()->detached_contexts()); |
+ Handle<FixedArray> detached_contexts = factory()->detached_contexts(); |
int length = detached_contexts->length(); |
if (length == 0) return; |
int new_length = 0; |