Commit 1f7feb96 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Remove obsolete stack trace string in a message object.

The stack trace string is an ancient relic that is no longer being used.
We use the structured stack trace object instead.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/159013002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19264 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 21cdcf34
...@@ -792,7 +792,7 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) { ...@@ -792,7 +792,7 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) {
isolate->ComputeLocation(&computed_location); isolate->ComputeLocation(&computed_location);
Handle<Object> message = MessageHandler::MakeMessageObject( Handle<Object> message = MessageHandler::MakeMessageObject(
isolate, "error_loading_debugger", &computed_location, isolate, "error_loading_debugger", &computed_location,
Vector<Handle<Object> >::empty(), Handle<String>(), Handle<JSArray>()); Vector<Handle<Object> >::empty(), Handle<JSArray>());
ASSERT(!isolate->has_pending_exception()); ASSERT(!isolate->has_pending_exception());
if (!exception.is_null()) { if (!exception.is_null()) {
isolate->set_pending_exception(*exception); isolate->set_pending_exception(*exception);
......
...@@ -1572,7 +1572,6 @@ Handle<JSMessageObject> Factory::NewJSMessageObject( ...@@ -1572,7 +1572,6 @@ Handle<JSMessageObject> Factory::NewJSMessageObject(
int start_position, int start_position,
int end_position, int end_position,
Handle<Object> script, Handle<Object> script,
Handle<Object> stack_trace,
Handle<Object> stack_frames) { Handle<Object> stack_frames) {
CALL_HEAP_FUNCTION(isolate(), CALL_HEAP_FUNCTION(isolate(),
isolate()->heap()->AllocateJSMessageObject(*type, isolate()->heap()->AllocateJSMessageObject(*type,
...@@ -1580,7 +1579,6 @@ Handle<JSMessageObject> Factory::NewJSMessageObject( ...@@ -1580,7 +1579,6 @@ Handle<JSMessageObject> Factory::NewJSMessageObject(
start_position, start_position,
end_position, end_position,
*script, *script,
*stack_trace,
*stack_frames), *stack_frames),
JSMessageObject); JSMessageObject);
} }
......
...@@ -528,7 +528,6 @@ class Factory { ...@@ -528,7 +528,6 @@ class Factory {
int start_position, int start_position,
int end_position, int end_position,
Handle<Object> script, Handle<Object> script,
Handle<Object> stack_trace,
Handle<Object> stack_frames); Handle<Object> stack_frames);
Handle<SeededNumberDictionary> DictionaryAtNumberPut( Handle<SeededNumberDictionary> DictionaryAtNumberPut(
......
...@@ -591,8 +591,6 @@ DEFINE_bool(stack_trace_on_illegal, false, ...@@ -591,8 +591,6 @@ DEFINE_bool(stack_trace_on_illegal, false,
"print stack trace when an illegal exception is thrown") "print stack trace when an illegal exception is thrown")
DEFINE_bool(abort_on_uncaught_exception, false, DEFINE_bool(abort_on_uncaught_exception, false,
"abort program (dump core) when an uncaught exception is thrown") "abort program (dump core) when an uncaught exception is thrown")
DEFINE_bool(trace_exception, false,
"print stack trace when throwing exceptions")
DEFINE_bool(randomize_hashes, true, DEFINE_bool(randomize_hashes, true,
"randomize hashes to avoid predictable hash collisions " "randomize hashes to avoid predictable hash collisions "
"(with snapshots this option cannot override the baked-in seed)") "(with snapshots this option cannot override the baked-in seed)")
......
...@@ -3769,7 +3769,6 @@ MaybeObject* Heap::AllocateJSMessageObject(String* type, ...@@ -3769,7 +3769,6 @@ MaybeObject* Heap::AllocateJSMessageObject(String* type,
int start_position, int start_position,
int end_position, int end_position,
Object* script, Object* script,
Object* stack_trace,
Object* stack_frames) { Object* stack_frames) {
Object* result; Object* result;
{ MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE); { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE);
...@@ -3784,7 +3783,6 @@ MaybeObject* Heap::AllocateJSMessageObject(String* type, ...@@ -3784,7 +3783,6 @@ MaybeObject* Heap::AllocateJSMessageObject(String* type,
message->set_start_position(start_position); message->set_start_position(start_position);
message->set_end_position(end_position); message->set_end_position(end_position);
message->set_script(script); message->set_script(script);
message->set_stack_trace(stack_trace);
message->set_stack_frames(stack_frames); message->set_stack_frames(stack_frames);
return result; return result;
} }
......
...@@ -1134,7 +1134,6 @@ class Heap { ...@@ -1134,7 +1134,6 @@ class Heap {
int start_position, int start_position,
int end_position, int end_position,
Object* script, Object* script,
Object* stack_trace,
Object* stack_frames); Object* stack_frames);
// Allocate a new external string object, which is backed by a string // Allocate a new external string object, which is backed by a string
......
...@@ -1123,8 +1123,6 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) { ...@@ -1123,8 +1123,6 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
// while the bootstrapper is active since the infrastructure may not have // while the bootstrapper is active since the infrastructure may not have
// been properly initialized. // been properly initialized.
if (!bootstrapping) { if (!bootstrapping) {
Handle<String> stack_trace;
if (FLAG_trace_exception) stack_trace = StackTraceString();
Handle<JSArray> stack_trace_object; Handle<JSArray> stack_trace_object;
if (capture_stack_trace_for_uncaught_exceptions_) { if (capture_stack_trace_for_uncaught_exceptions_) {
if (IsErrorObject(exception_handle)) { if (IsErrorObject(exception_handle)) {
...@@ -1164,7 +1162,6 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) { ...@@ -1164,7 +1162,6 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
"uncaught_exception", "uncaught_exception",
location, location,
HandleVector<Object>(&exception_arg, 1), HandleVector<Object>(&exception_arg, 1),
stack_trace,
stack_trace_object); stack_trace_object);
thread_local_top()->pending_message_obj_ = *message_obj; thread_local_top()->pending_message_obj_ = *message_obj;
if (location != NULL) { if (location != NULL) {
......
...@@ -61,7 +61,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject( ...@@ -61,7 +61,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject(
const char* type, const char* type,
MessageLocation* loc, MessageLocation* loc,
Vector< Handle<Object> > args, Vector< Handle<Object> > args,
Handle<String> stack_trace,
Handle<JSArray> stack_frames) { Handle<JSArray> stack_frames) {
Factory* factory = isolate->factory(); Factory* factory = isolate->factory();
Handle<String> type_handle = factory->InternalizeUtf8String(type); Handle<String> type_handle = factory->InternalizeUtf8String(type);
...@@ -82,10 +81,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject( ...@@ -82,10 +81,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject(
script_handle = GetScriptWrapper(loc->script()); script_handle = GetScriptWrapper(loc->script());
} }
Handle<Object> stack_trace_handle = stack_trace.is_null()
? Handle<Object>::cast(factory->undefined_value())
: Handle<Object>::cast(stack_trace);
Handle<Object> stack_frames_handle = stack_frames.is_null() Handle<Object> stack_frames_handle = stack_frames.is_null()
? Handle<Object>::cast(factory->undefined_value()) ? Handle<Object>::cast(factory->undefined_value())
: Handle<Object>::cast(stack_frames); : Handle<Object>::cast(stack_frames);
...@@ -96,7 +91,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject( ...@@ -96,7 +91,6 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject(
start, start,
end, end,
script_handle, script_handle,
stack_trace_handle,
stack_frames_handle); stack_frames_handle);
return message; return message;
......
...@@ -95,7 +95,6 @@ class MessageHandler { ...@@ -95,7 +95,6 @@ class MessageHandler {
const char* type, const char* type,
MessageLocation* loc, MessageLocation* loc,
Vector< Handle<Object> > args, Vector< Handle<Object> > args,
Handle<String> stack_trace,
Handle<JSArray> stack_frames); Handle<JSArray> stack_frames);
// Report a formatted message (needs JS allocation). // Report a formatted message (needs JS allocation).
......
...@@ -490,7 +490,6 @@ void JSMessageObject::JSMessageObjectVerify() { ...@@ -490,7 +490,6 @@ void JSMessageObject::JSMessageObjectVerify() {
VerifyObjectField(kEndPositionOffset); VerifyObjectField(kEndPositionOffset);
VerifyObjectField(kArgumentsOffset); VerifyObjectField(kArgumentsOffset);
VerifyObjectField(kScriptOffset); VerifyObjectField(kScriptOffset);
VerifyObjectField(kStackTraceOffset);
VerifyObjectField(kStackFramesOffset); VerifyObjectField(kStackFramesOffset);
} }
......
...@@ -5669,7 +5669,6 @@ JSDate* JSDate::cast(Object* obj) { ...@@ -5669,7 +5669,6 @@ JSDate* JSDate::cast(Object* obj) {
ACCESSORS(JSMessageObject, type, String, kTypeOffset) ACCESSORS(JSMessageObject, type, String, kTypeOffset)
ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset) ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset)
ACCESSORS(JSMessageObject, script, Object, kScriptOffset) ACCESSORS(JSMessageObject, script, Object, kScriptOffset)
ACCESSORS(JSMessageObject, stack_trace, Object, kStackTraceOffset)
ACCESSORS(JSMessageObject, stack_frames, Object, kStackFramesOffset) ACCESSORS(JSMessageObject, stack_frames, Object, kStackFramesOffset)
SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset) SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset)
SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset) SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset)
......
...@@ -624,8 +624,6 @@ void JSMessageObject::JSMessageObjectPrint(FILE* out) { ...@@ -624,8 +624,6 @@ void JSMessageObject::JSMessageObjectPrint(FILE* out) {
PrintF(out, "\n - end_position: %d", end_position()); PrintF(out, "\n - end_position: %d", end_position());
PrintF(out, "\n - script: "); PrintF(out, "\n - script: ");
script()->ShortPrint(out); script()->ShortPrint(out);
PrintF(out, "\n - stack_trace: ");
stack_trace()->ShortPrint(out);
PrintF(out, "\n - stack_frames: "); PrintF(out, "\n - stack_frames: ");
stack_frames()->ShortPrint(out); stack_frames()->ShortPrint(out);
PrintF(out, "\n"); PrintF(out, "\n");
......
...@@ -7759,9 +7759,6 @@ class JSMessageObject: public JSObject { ...@@ -7759,9 +7759,6 @@ class JSMessageObject: public JSObject {
// [script]: the script from which the error message originated. // [script]: the script from which the error message originated.
DECL_ACCESSORS(script, Object) DECL_ACCESSORS(script, Object)
// [stack_trace]: the stack trace for this error message.
DECL_ACCESSORS(stack_trace, Object)
// [stack_frames]: an array of stack frames for this error object. // [stack_frames]: an array of stack frames for this error object.
DECL_ACCESSORS(stack_frames, Object) DECL_ACCESSORS(stack_frames, Object)
...@@ -7784,8 +7781,7 @@ class JSMessageObject: public JSObject { ...@@ -7784,8 +7781,7 @@ class JSMessageObject: public JSObject {
static const int kTypeOffset = JSObject::kHeaderSize; static const int kTypeOffset = JSObject::kHeaderSize;
static const int kArgumentsOffset = kTypeOffset + kPointerSize; static const int kArgumentsOffset = kTypeOffset + kPointerSize;
static const int kScriptOffset = kArgumentsOffset + kPointerSize; static const int kScriptOffset = kArgumentsOffset + kPointerSize;
static const int kStackTraceOffset = kScriptOffset + kPointerSize; static const int kStackFramesOffset = kScriptOffset + kPointerSize;
static const int kStackFramesOffset = kStackTraceOffset + kPointerSize;
static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; static const int kStartPositionOffset = kStackFramesOffset + kPointerSize;
static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; static const int kEndPositionOffset = kStartPositionOffset + kPointerSize;
static const int kSize = kEndPositionOffset + kPointerSize; static const int kSize = kEndPositionOffset + kPointerSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment