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

Side by Side Diff: src/messages.cc

Issue 1106633002: Wrap messages implementation in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@messages_5
Patch Set: fix and rebase Created 5 years, 7 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
« no previous file with comments | « src/heap/heap.h ('k') | src/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/execution.h" 8 #include "src/execution.h"
9 #include "src/heap/spaces-inl.h" 9 #include "src/heap/spaces-inl.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 } 125 }
126 } 126 }
127 } 127 }
128 128
129 129
130 Handle<String> MessageHandler::GetMessage(Isolate* isolate, 130 Handle<String> MessageHandler::GetMessage(Isolate* isolate,
131 Handle<Object> data) { 131 Handle<Object> data) {
132 Factory* factory = isolate->factory(); 132 Factory* factory = isolate->factory();
133 Handle<String> fmt_str = 133 Handle<String> fmt_str =
134 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("FormatMessage")); 134 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("$formatMessage"));
135 Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty( 135 Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty(
136 isolate->js_builtins_object(), fmt_str).ToHandleChecked()); 136 isolate->js_builtins_object(), fmt_str).ToHandleChecked());
137 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data); 137 Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data);
138 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate), 138 Handle<Object> argv[] = { Handle<Object>(message->type(), isolate),
139 Handle<Object>(message->arguments(), isolate) }; 139 Handle<Object>(message->arguments(), isolate) };
140 140
141 MaybeHandle<Object> maybe_result = Execution::TryCall( 141 MaybeHandle<Object> maybe_result = Execution::TryCall(
142 fun, isolate->js_builtins_object(), arraysize(argv), argv); 142 fun, isolate->js_builtins_object(), arraysize(argv), argv);
143 Handle<Object> result; 143 Handle<Object> result;
144 if (!maybe_result.ToHandle(&result) || !result->IsString()) { 144 if (!maybe_result.ToHandle(&result) || !result->IsString()) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 DCHECK(i < arraysize(args)); 192 DCHECK(i < arraysize(args));
193 builder.AppendString(args[i++]); 193 builder.AppendString(args[i++]);
194 } else { 194 } else {
195 builder.AppendCharacter(*c); 195 builder.AppendCharacter(*c);
196 } 196 }
197 } 197 }
198 198
199 return builder.Finish(); 199 return builder.Finish();
200 } 200 }
201 } } // namespace v8::internal 201 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698