summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'js/src')
-rw-r--r--js/src/frontend/BytecodeEmitter.cpp32
-rw-r--r--js/src/frontend/BytecodeEmitter.h2
2 files changed, 18 insertions, 16 deletions
diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
index 7b8b41727..c15d67b7c 100644
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -3539,9 +3539,10 @@ BytecodeEmitter::needsImplicitThis()
bool
BytecodeEmitter::maybeSetDisplayURL()
{
- if (tokenStream()->hasDisplayURL()) {
- if (!parser->ss->setDisplayURL(cx, tokenStream()->displayURL()))
+ if (tokenStream().hasDisplayURL()) {
+ if (!parser->ss->setDisplayURL(cx, tokenStream().displayURL())) {
return false;
+ }
}
return true;
}
@@ -3549,10 +3550,11 @@ BytecodeEmitter::maybeSetDisplayURL()
bool
BytecodeEmitter::maybeSetSourceMap()
{
- if (tokenStream()->hasSourceMapURL()) {
+ if (tokenStream().hasSourceMapURL()) {
MOZ_ASSERT(!parser->ss->hasSourceMapURL());
- if (!parser->ss->setSourceMapURL(cx, tokenStream()->sourceMapURL()))
+ if (!parser->ss->setSourceMapURL(cx, tokenStream().sourceMapURL())) {
return false;
+ }
}
/*
@@ -3591,21 +3593,21 @@ BytecodeEmitter::tellDebuggerAboutCompiledScript(ExclusiveContext* cx)
}
}
-inline TokenStream*
+inline TokenStream&
BytecodeEmitter::tokenStream()
{
- return &parser->tokenStream;
+ return parser->tokenStream;
}
bool
BytecodeEmitter::reportError(ParseNode* pn, unsigned errorNumber, ...)
{
- TokenPos pos = pn ? pn->pn_pos : tokenStream()->currentToken().pos;
+ TokenPos pos = pn ? pn->pn_pos : tokenStream().currentToken().pos;
va_list args;
va_start(args, errorNumber);
- bool result = tokenStream()->reportCompileErrorNumberVA(nullptr, pos.begin, JSREPORT_ERROR,
- errorNumber, args);
+ bool result = tokenStream().reportCompileErrorNumberVA(nullptr, pos.begin, JSREPORT_ERROR,
+ errorNumber, args);
va_end(args);
return result;
}
@@ -3613,12 +3615,12 @@ BytecodeEmitter::reportError(ParseNode* pn, unsigned errorNumber, ...)
bool
BytecodeEmitter::reportExtraWarning(ParseNode* pn, unsigned errorNumber, ...)
{
- TokenPos pos = pn ? pn->pn_pos : tokenStream()->currentToken().pos;
+ TokenPos pos = pn ? pn->pn_pos : tokenStream().currentToken().pos;
va_list args;
va_start(args, errorNumber);
- bool result = tokenStream()->reportExtraWarningErrorNumberVA(nullptr, pos.begin,
- errorNumber, args);
+ bool result = tokenStream().reportExtraWarningErrorNumberVA(nullptr, pos.begin,
+ errorNumber, args);
va_end(args);
return result;
}
@@ -3626,12 +3628,12 @@ BytecodeEmitter::reportExtraWarning(ParseNode* pn, unsigned errorNumber, ...)
bool
BytecodeEmitter::reportStrictModeError(ParseNode* pn, unsigned errorNumber, ...)
{
- TokenPos pos = pn ? pn->pn_pos : tokenStream()->currentToken().pos;
+ TokenPos pos = pn ? pn->pn_pos : tokenStream().currentToken().pos;
va_list args;
va_start(args, errorNumber);
- bool result = tokenStream()->reportStrictModeErrorNumberVA(nullptr, pos.begin, sc->strict(),
- errorNumber, args);
+ bool result = tokenStream().reportStrictModeErrorNumberVA(nullptr, pos.begin, sc->strict(),
+ errorNumber, args);
va_end(args);
return result;
}
diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h
index 29050c846..4e5209593 100644
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -356,7 +356,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
MOZ_MUST_USE bool maybeSetSourceMap();
void tellDebuggerAboutCompiledScript(ExclusiveContext* cx);
- inline TokenStream* tokenStream();
+ inline TokenStream& tokenStream();
BytecodeVector& code() const { return current->code; }
jsbytecode* code(ptrdiff_t offset) const { return current->code.begin() + offset; }