Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: src/messages.cc

Issue 6461022: Merge a number of assertion failure fixes to the 3.0 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.0/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 // Copyright 2006-2008 the V8 project authors. All rights reserved. 2 // Copyright 2006-2008 the V8 project authors. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 64
65 Handle<JSMessageObject> MessageHandler::MakeMessageObject( 65 Handle<JSMessageObject> MessageHandler::MakeMessageObject(
66 const char* type, 66 const char* type,
67 MessageLocation* loc, 67 MessageLocation* loc,
68 Vector< Handle<Object> > args, 68 Vector< Handle<Object> > args,
69 Handle<String> stack_trace, 69 Handle<String> stack_trace,
70 Handle<JSArray> stack_frames) { 70 Handle<JSArray> stack_frames) {
71 Handle<String> type_handle = Factory::LookupAsciiSymbol(type); 71 Handle<String> type_handle = Factory::LookupAsciiSymbol(type);
72 Handle<JSArray> arguments_handle = Factory::NewJSArray(args.length()); 72 Handle<FixedArray> arguments_elements =
73 Factory::NewFixedArray(args.length());
73 for (int i = 0; i < args.length(); i++) { 74 for (int i = 0; i < args.length(); i++) {
74 SetElement(arguments_handle, i, args[i]); 75 arguments_elements->set(i, *args[i]);
75 } 76 }
77 Handle<JSArray> arguments_handle =
78 Factory::NewJSArrayWithElements(arguments_elements);
76 79
77 int start = 0; 80 int start = 0;
78 int end = 0; 81 int end = 0;
79 Handle<Object> script_handle = Factory::undefined_value(); 82 Handle<Object> script_handle = Factory::undefined_value();
80 if (loc) { 83 if (loc) {
81 start = loc->start_pos(); 84 start = loc->start_pos();
82 end = loc->end_pos(); 85 end = loc->end_pos();
83 script_handle = GetScriptWrapper(loc->script()); 86 script_handle = GetScriptWrapper(loc->script());
84 } 87 }
85 88
86 Handle<Object> stack_trace_handle = stack_trace.is_null() 89 Handle<Object> stack_trace_handle = stack_trace.is_null()
87 ? Factory::undefined_value() 90 ? Factory::undefined_value()
88 : Handle<Object>::cast(stack_trace); 91 : Handle<Object>::cast(stack_trace);
89 92
90 Handle<Object> stack_frames_handle = stack_frames.is_null() 93 Handle<Object> stack_frames_handle = stack_frames.is_null()
91 ? Factory::undefined_value() 94 ? Factory::undefined_value()
92 : Handle<Object>::cast(stack_frames); 95 : Handle<Object>::cast(stack_frames);
93 96
94 Handle<JSMessageObject> message = 97 Handle<JSMessageObject> message =
95 Factory::NewJSMessageObject(type_handle, 98 Factory::NewJSMessageObject(type_handle,
96 arguments_handle, 99 arguments_handle,
97 start, 100 start,
98 end, 101 end,
99 script_handle, 102 script_handle,
100 stack_trace_handle, 103 stack_trace_handle,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 155 }
153 156
154 157
155 SmartPointer<char> MessageHandler::GetLocalizedMessage(Handle<Object> data) { 158 SmartPointer<char> MessageHandler::GetLocalizedMessage(Handle<Object> data) {
156 HandleScope scope; 159 HandleScope scope;
157 return GetMessage(data)->ToCString(DISALLOW_NULLS); 160 return GetMessage(data)->ToCString(DISALLOW_NULLS);
158 } 161 }
159 162
160 163
161 } } // namespace v8::internal 164 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698