Commit 77e37028 authored by yangguo's avatar yangguo Committed by Commit bot

Wrap messages implementation in a function.

R=jkummerow@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28074}
parent 6e82fbfb
......@@ -2271,8 +2271,8 @@ Maybe<int> Message::GetLineNumber(Local<Context> context) const {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Message::GetLineNumber()", int);
i::Handle<i::Object> result;
has_pending_exception =
!CallV8HeapFunction(isolate, "GetLineNumber", Utils::OpenHandle(this))
.ToHandle(&result);
!CallV8HeapFunction(isolate, "$messageGetLineNumber",
Utils::OpenHandle(this)).ToHandle(&result);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(int);
return Just(static_cast<int>(result->Number()));
}
......@@ -2301,8 +2301,9 @@ Maybe<int> Message::GetStartColumn(Local<Context> context) const {
int);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> start_col_obj;
has_pending_exception = !CallV8HeapFunction(isolate, "GetPositionInLine",
self).ToHandle(&start_col_obj);
has_pending_exception =
!CallV8HeapFunction(isolate, "$messageGetPositionInLine", self)
.ToHandle(&start_col_obj);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(int);
return Just(static_cast<int>(start_col_obj->Number()));
}
......@@ -2319,8 +2320,9 @@ Maybe<int> Message::GetEndColumn(Local<Context> context) const {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Message::GetEndColumn()", int);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> start_col_obj;
has_pending_exception = !CallV8HeapFunction(isolate, "GetPositionInLine",
self).ToHandle(&start_col_obj);
has_pending_exception =
!CallV8HeapFunction(isolate, "$messageGetPositionInLine", self)
.ToHandle(&start_col_obj);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(int);
int start = self->start_position();
int end = self->end_position();
......@@ -2349,8 +2351,8 @@ MaybeLocal<String> Message::GetSourceLine(Local<Context> context) const {
PREPARE_FOR_EXECUTION(context, "v8::Message::GetSourceLine()", String);
i::Handle<i::Object> result;
has_pending_exception =
!CallV8HeapFunction(isolate, "GetSourceLine", Utils::OpenHandle(this))
.ToHandle(&result);
!CallV8HeapFunction(isolate, "$messageGetSourceLine",
Utils::OpenHandle(this)).ToHandle(&result);
RETURN_ON_FAILED_EXECUTION(String);
Local<String> str;
if (result->IsString()) {
......
......@@ -1544,7 +1544,7 @@ void Genesis::InstallNativeFunctions() {
INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun);
INSTALL_NATIVE(JSFunction, "ToString", to_string_fun);
INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun);
INSTALL_NATIVE(JSFunction, "$toDetailString", to_detail_string_fun);
INSTALL_NATIVE(JSFunction, "ToObject", to_object_fun);
INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun);
INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun);
......@@ -1552,7 +1552,7 @@ void Genesis::InstallNativeFunctions() {
INSTALL_NATIVE(JSFunction, "ToLength", to_length_fun);
INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun);
INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun);
INSTALL_NATIVE(JSFunction, "$getStackTraceLine", get_stack_trace_line_fun);
INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor",
to_complete_property_descriptor);
......@@ -2475,7 +2475,7 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) {
JSObject::SetOwnPropertyIgnoreAttributes(
handle(native_context->builtins(), isolate),
factory->InternalizeOneByteString(
STATIC_CHAR_VECTOR("stack_trace_symbol")),
STATIC_CHAR_VECTOR("$stackTraceSymbol")),
factory->stack_trace_symbol(), NONE),
false);
......
......@@ -261,7 +261,7 @@ namespace internal {
V(toJSON_string, "toJSON") \
V(KeyedLoadMonomorphic_string, "KeyedLoadMonomorphic") \
V(KeyedStoreMonomorphic_string, "KeyedStoreMonomorphic") \
V(stack_overflow_string, "kStackOverflowBoilerplate") \
V(stack_overflow_string, "$stackOverflowBoilerplate") \
V(illegal_access_string, "illegal access") \
V(cell_value_string, "%cell_value") \
V(illegal_argument_string, "illegal argument") \
......
......@@ -131,7 +131,7 @@ Handle<String> MessageHandler::GetMessage(Isolate* isolate,
Handle<Object> data) {
Factory* factory = isolate->factory();
Handle<String> fmt_str =
factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("FormatMessage"));
factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("$formatMessage"));
Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty(
isolate->js_builtins_object(), fmt_str).ToHandleChecked());
Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data);
......
This diff is collapsed.
......@@ -1314,7 +1314,7 @@ ErrorMirror.prototype.toText = function() {
// Use the same text representation as in messages.js.
var text;
try {
text = %_CallFunction(this.value_, builtins.ErrorToString);
text = %_CallFunction(this.value_, builtins.$errorToString);
} catch (e) {
text = '#<Error>';
}
......
......@@ -1356,8 +1356,9 @@ i::Handle<i::String> FormatMessage(i::Vector<unsigned> data) {
}
i::Handle<i::JSObject> builtins(isolate->js_builtins_object());
i::Handle<i::Object> format_fun = i::Object::GetProperty(
isolate, builtins, "FormatMessage").ToHandleChecked();
i::Handle<i::Object> format_fun =
i::Object::GetProperty(isolate, builtins, "$formatMessage")
.ToHandleChecked();
i::Handle<i::Object> arg_handles[] = { format, args_array };
i::Handle<i::Object> result = i::Execution::Call(
isolate, format_fun, builtins, 2, arg_handles).ToHandleChecked();
......
......@@ -69,8 +69,9 @@ def ReadFile(filename):
EVAL_PATTERN = re.compile(r'\beval\s*\(')
WITH_PATTERN = re.compile(r'\bwith\s*\(')
INVALID_ERROR_MESSAGE_PATTERN = re.compile(r'Make\w*Error\(([kA-Z]\w+)')
NEW_ERROR_PATTERN = re.compile(r'new \$\w*Error\((?!\))');
INVALID_ERROR_MESSAGE_PATTERN = re.compile(
r'Make(?!Generic)\w*Error\(([kA-Z]\w+)')
NEW_ERROR_PATTERN = re.compile(r'new \$\w*Error\((?!\))')
def Validate(lines):
# Because of simplified context setup, eval and with is not
......
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