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

Unified Diff: src/messages.js

Issue 1293113002: Remove property loads from js builtins objects from runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix stack overflow during bootstrapping Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« 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 @@ function GetLineNumber(message) {
}
+//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) {
@@ -223,6 +228,7 @@ function GetSourceLine(message) {
return location.sourceText();
}
+
/**
* Find a line number given a specific source position.
* @param {number} position The source position.
@@ -556,17 +562,6 @@ utils.SetUpLockedPrototype(SourceSlice,
);
-// 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) {
return new CallSite(recv, fun, pos, false).toString();
}
@@ -1005,9 +1000,6 @@ utils.InstallFunctions(GlobalError.prototype, DONT_ENUM,
['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 @@ MakeURIError = function() {
// 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 @@ utils.ExportToRuntime(function(to) {
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
This is Rietveld 408576698