Chromium Code Reviews

Unified Diff: src/messages.js

Issue 1298733003: Reland of move property loads from js builtins objects from runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/isolate.cc ('k') | src/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 712dba428adc6b2c9c3750117a7bc87d62ff57a6..a111660bc44804d28d9700088fc45dd963396bc0 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -5,12 +5,7 @@
// -------------------------------------------------------------------
var $errorToString;
-var $getStackTraceLine;
var $internalErrorSymbol;
-var $messageGetPositionInLine;
-var $messageGetLineNumber;
-var $messageGetSourceLine;
-var $stackOverflowBoilerplate;
var $stackTraceSymbol;
var MakeError;
var MakeEvalError;
@@ -213,6 +208,16 @@
}
+//Returns the offset of the given position within the containing line.
+function GetColumnNumber(message) {
+ var script = %MessageGetScript(message);
+ var start_position = %MessageGetStartPosition(message);
+ var location = script.locationFromPosition(start_position, true);
+ if (location == null) return -1;
+ return location.column;
+}
+
+
// Returns the source code line containing the given source
// position, or the empty string if the position is invalid.
function GetSourceLine(message) {
@@ -222,6 +227,7 @@
if (location == null) return "";
return location.sourceText();
}
+
/**
* Find a line number given a specific source position.
@@ -554,17 +560,6 @@
["script", "from_line", "to_line", "from_position", "to_position"],
["sourceText", SourceSliceSourceText]
);
-
-
-// Returns the offset of the given position within the containing
-// line.
-function GetPositionInLine(message) {
- var script = %MessageGetScript(message);
- var start_position = %MessageGetStartPosition(message);
- var location = script.locationFromPosition(start_position, true);
- if (location == null) return -1;
- return location.column;
-}
function GetStackTraceLine(recv, fun, pos, isGlobal) {
@@ -1005,9 +1000,6 @@
['toString', ErrorToString]);
$errorToString = ErrorToString;
-$messageGetPositionInLine = GetPositionInLine;
-$messageGetLineNumber = GetLineNumber;
-$messageGetSourceLine = GetSourceLine;
MakeError = function(type, arg0, arg1, arg2) {
return MakeGenericError(GlobalError, type, arg0, arg1, arg2);
@@ -1031,8 +1023,8 @@
// Boilerplate for exceptions for stack overflows. Used from
// Isolate::StackOverflow().
-$stackOverflowBoilerplate = MakeRangeError(kStackOverflow);
-%DefineAccessorPropertyUnchecked($stackOverflowBoilerplate, 'stack',
+var StackOverflowBoilerplate = MakeRangeError(kStackOverflow);
+%DefineAccessorPropertyUnchecked(StackOverflowBoilerplate, 'stack',
StackTraceGetter, StackTraceSetter,
DONT_ENUM);
@@ -1059,6 +1051,10 @@
to.NoSideEffectToString = NoSideEffectToString;
to.ToDetailString = ToDetailString;
to.MakeError = MakeGenericError;
+ to.MessageGetLineNumber = GetLineNumber;
+ to.MessageGetColumnNumber = GetColumnNumber;
+ to.MessageGetSourceLine = GetSourceLine;
+ to.StackOverflowBoilerplate = StackOverflowBoilerplate;
});
});
« no previous file with comments | « src/isolate.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine