Skip to content

Commit a96f39f

Browse files
clover2123bbrto21
authored andcommitted
Unify regular expression notation as RegExp
Signed-off-by: HyukWoo Park <[email protected]>
1 parent dbe6cd0 commit a96f39f

File tree

11 files changed

+28
-28
lines changed

11 files changed

+28
-28
lines changed

src/codecache/CodeCacheReaderWriter.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ void CodeCacheWriter::storeByteCodeStream(ByteCodeBlock* block)
433433
STORE_ATOMICSTRING_RELOC(m_propertyName);
434434
break;
435435
}
436-
case LoadRegexpOpcode: {
437-
LoadRegexp* bc = (LoadRegexp*)currentCode;
436+
case LoadRegExpOpcode: {
437+
LoadRegExp* bc = (LoadRegExp*)currentCode;
438438

439439
String* bodyString = bc->m_body;
440440
String* optionString = bc->m_option;
@@ -785,8 +785,8 @@ void CodeCacheReader::loadByteCodeStream(Context* context, ByteCodeBlock* block)
785785

786786
InterpretedCodeBlock* codeBlock = block->codeBlock();
787787

788-
// mark for LoadRegexp bytecode
789-
bool bodyStringForLoadRegexp = true;
788+
// mark for LoadRegExp bytecode
789+
bool bodyStringForLoadRegExp = true;
790790

791791
for (size_t i = 0; i < relocInfoVector.size(); i++) {
792792
ByteCodeRelocInfo& info = relocInfoVector[i];
@@ -890,20 +890,20 @@ void CodeCacheReader::loadByteCodeStream(Context* context, ByteCodeBlock* block)
890890
LOAD_ATOMICSTRING_RELOC(m_propertyName);
891891
break;
892892
}
893-
case LoadRegexpOpcode: {
894-
LoadRegexp* bc = (LoadRegexp*)currentCode;
893+
case LoadRegExpOpcode: {
894+
LoadRegExp* bc = (LoadRegExp*)currentCode;
895895

896896
String* bodyString = bc->m_body;
897897
String* optionString = bc->m_option;
898898

899-
if (bodyStringForLoadRegexp) {
899+
if (bodyStringForLoadRegExp) {
900900
ASSERT(info.dataOffset < stringLiteralData.size());
901901
bc->m_body = stringLiteralData[info.dataOffset];
902-
bodyStringForLoadRegexp = false;
902+
bodyStringForLoadRegExp = false;
903903
} else {
904904
ASSERT(info.dataOffset < stringLiteralData.size());
905905
bc->m_option = stringLiteralData[info.dataOffset];
906-
bodyStringForLoadRegexp = true;
906+
bodyStringForLoadRegExp = true;
907907
}
908908
break;
909909
}

src/interpreter/ByteCode.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct GlobalVariableAccessCacheItem;
118118
F(MarkEnumerateKey, 2, 0) \
119119
F(IteratorOperation, 0, 0) \
120120
F(GetMethod, 0, 0) \
121-
F(LoadRegexp, 1, 0) \
121+
F(LoadRegExp, 1, 0) \
122122
F(WithOperation, 0, 0) \
123123
F(ObjectDefineGetterSetter, 0, 0) \
124124
F(CallFunctionComplexCase, 0, 0) \
@@ -2231,10 +2231,10 @@ class GetMethod : public ByteCode {
22312231
#endif
22322232
};
22332233

2234-
class LoadRegexp : public ByteCode {
2234+
class LoadRegExp : public ByteCode {
22352235
public:
2236-
LoadRegexp(const ByteCodeLOC& loc, const size_t registerIndex, String* body, String* opt)
2237-
: ByteCode(Opcode::LoadRegexpOpcode, loc)
2236+
LoadRegExp(const ByteCodeLOC& loc, const size_t registerIndex, String* body, String* opt)
2237+
: ByteCode(Opcode::LoadRegExpOpcode, loc)
22382238
, m_registerIndex(registerIndex)
22392239
, m_body(body)
22402240
, m_option(opt)

src/interpreter/ByteCodeGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ void ByteCodeGenerator::relocateByteCode(ByteCodeBlock* block)
342342
ASSIGN_STACKINDEX_IF_NEEDED(cd->m_registerIndex, stackBase, stackBaseWillBe, stackVariableSize);
343343
break;
344344
}
345-
case LoadRegexpOpcode: {
346-
LoadRegexp* cd = (LoadRegexp*)currentCode;
345+
case LoadRegExpOpcode: {
346+
LoadRegExp* cd = (LoadRegExp*)currentCode;
347347
ASSIGN_STACKINDEX_IF_NEEDED(cd->m_registerIndex, stackBase, stackBaseWillBe, stackVariableSize);
348348
break;
349349
}

src/interpreter/ByteCodeInterpreter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,12 +1148,12 @@ Value ByteCodeInterpreter::interpret(ExecutionState* state, ByteCodeBlock* byteC
11481148
NEXT_INSTRUCTION();
11491149
}
11501150

1151-
DEFINE_OPCODE(LoadRegexp)
1151+
DEFINE_OPCODE(LoadRegExp)
11521152
:
11531153
{
1154-
LoadRegexp* code = (LoadRegexp*)programCounter;
1154+
LoadRegExp* code = (LoadRegExp*)programCounter;
11551155
registerFile[code->m_registerIndex] = new RegExpObject(*state, code->m_body, code->m_option);
1156-
ADD_PROGRAM_COUNTER(LoadRegexp);
1156+
ADD_PROGRAM_COUNTER(LoadRegExp);
11571157
NEXT_INSTRUCTION();
11581158
}
11591159

src/parser/Lexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ void Scanner::scanRegExp(Scanner::ScannerResult* token)
17211721
result.body = body;
17221722
result.flags = flags;
17231723
token->setResult(Token::RegularExpressionToken, this->lineNumber, this->lineStart, start, this->index);
1724-
token->valueRegexp = result;
1724+
token->valueRegExp = result;
17251725
}
17261726

17271727
// ECMA-262 11.6.2.1 Keywords

src/parser/Lexer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class Scanner {
260260
, lineStart(0)
261261
, start(0)
262262
, end(0)
263-
, valueRegexp()
263+
, valueRegExp()
264264
{
265265
}
266266

@@ -286,7 +286,7 @@ class Scanner {
286286
ScannerSourceStringView valueStringLiteralData;
287287
double valueNumber;
288288
ScanTemplateResult* valueTemplate;
289-
ScanRegExpResult valueRegexp;
289+
ScanRegExpResult valueRegExp;
290290
KeywordKind valueKeywordKind;
291291
};
292292

src/parser/ast/RegExpLiteralNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RegExpLiteralNode : public Node {
4141
{
4242
codeBlock->m_stringLiteralData.pushBack(m_body);
4343
codeBlock->m_stringLiteralData.pushBack(m_flag);
44-
codeBlock->pushCode(LoadRegexp(ByteCodeLOC(m_loc.index), dstRegister, m_body, m_flag), context, this);
44+
codeBlock->pushCode(LoadRegExp(ByteCodeLOC(m_loc.index), dstRegister, m_body, m_flag), context, this);
4545
}
4646

4747
private:

src/parser/esprima_cpp/esprima.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ class Parser {
10971097
ALLOC_TOKEN(token);
10981098
this->nextRegexToken(token);
10991099
// raw = this->getTokenRaw(token);
1100-
return this->finalize(node, builder.createRegExpLiteralNode(token->valueRegexp.body, token->valueRegexp.flags));
1100+
return this->finalize(node, builder.createRegExpLiteralNode(token->valueRegExp.body, token->valueRegExp.flags));
11011101
}
11021102
default: {
11031103
ALLOC_TOKEN(token);

src/runtime/Object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ ObjectRareData::ObjectRareData(Object* obj)
9393
m_isArrayObjectLengthWritable = true;
9494
m_isSpreadArrayObject = false;
9595
m_shouldUpdateEnumerateObject = false;
96-
m_hasNonWritableLastIndexRegexpObject = false;
96+
m_hasNonWritableLastIndexRegExpObject = false;
9797
m_arrayObjectFastModeBufferExpandCount = 0;
9898
m_extraData = nullptr;
9999
m_internalSlot = nullptr;

src/runtime/Object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct ObjectRareData : public PointerValue {
4949
bool m_isArrayObjectLengthWritable : 1;
5050
bool m_isSpreadArrayObject : 1;
5151
bool m_shouldUpdateEnumerateObject : 1; // used only for Array Object when ArrayObject::deleteOwnProperty called
52-
bool m_hasNonWritableLastIndexRegexpObject : 1;
52+
bool m_hasNonWritableLastIndexRegExpObject : 1;
5353
uint8_t m_arrayObjectFastModeBufferExpandCount : 8;
5454
void* m_extraData;
5555
Object* m_prototype;

src/runtime/RegExpObject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void RegExpObject::initWithOption(ExecutionState& state, String* source, Option
195195

196196
void RegExpObject::setLastIndex(ExecutionState& state, const Value& v)
197197
{
198-
if (UNLIKELY(hasRareData() && rareData()->m_hasNonWritableLastIndexRegexpObject && (m_option & (Option::Sticky | Option::Global)))) {
198+
if (UNLIKELY(hasRareData() && rareData()->m_hasNonWritableLastIndexRegExpObject && (m_option & (Option::Sticky | Option::Global)))) {
199199
Object::throwCannotWriteError(state, ObjectStructurePropertyName(state.context()->staticStrings().lastIndex));
200200
}
201201
m_lastIndex = v;
@@ -206,9 +206,9 @@ bool RegExpObject::defineOwnProperty(ExecutionState& state, const ObjectProperty
206206
bool returnValue = Object::defineOwnProperty(state, P, desc);
207207
if (!P.isUIntType() && returnValue && P.objectStructurePropertyName() == ObjectStructurePropertyName(state.context()->staticStrings().lastIndex)) {
208208
if (!structure()->readProperty((size_t)ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER).m_descriptor.isWritable()) {
209-
ensureRareData()->m_hasNonWritableLastIndexRegexpObject = true;
209+
ensureRareData()->m_hasNonWritableLastIndexRegExpObject = true;
210210
} else {
211-
ensureRareData()->m_hasNonWritableLastIndexRegexpObject = false;
211+
ensureRareData()->m_hasNonWritableLastIndexRegExpObject = false;
212212
}
213213
}
214214
return returnValue;

0 commit comments

Comments
 (0)