Token::BIT_AND,
instance_type,
Add<HConstant>(static_cast<int>(kIsNotInternalizedMask)));
- DeoptimizeIf<HCompareNumericAndBranch>(
- not_internalized_bit,
- graph()->GetConstant0(),
- Token::NE,
- "BuildKeyedIndexCheck: string isn't internalized");
- // Key guaranteed to be a unqiue string
+
+ IfBuilder internalized(this);
+ internalized.If<HCompareNumericAndBranch>(not_internalized_bit,
+ graph()->GetConstant0(),
+ Token::EQ);
+ internalized.Then();
Push(key);
+
+ internalized.Else();
+ Add<HPushArguments>(key);
+ HValue* intern_key = Add<HCallRuntime>(
+ isolate()->factory()->empty_string(),
+ Runtime::FunctionForId(Runtime::kInternalizeString), 1);
+ Push(intern_key);
+
+ internalized.End();
+ // Key guaranteed to be a unique string
}
string_index_if.JoinContinuation(join_continuation);
}
}
+RUNTIME_FUNCTION(Runtime_InternalizeString) {
+ HandleScope handles(isolate);
+ RUNTIME_ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(String, string, 0);
+ return *isolate->factory()->InternalizeString(string);
+}
+
+
RUNTIME_FUNCTION(Runtime_StringMatch) {
HandleScope handles(isolate);
ASSERT(args.length() == 3);
F(RegExpExecRT, 4, 1) \
F(StringAdd, 2, 1) \
F(SubString, 3, 1) \
+ F(InternalizeString, 1, 1) \
F(StringCompare, 2, 1) \
F(StringCharCodeAtRT, 2, 1) \
F(GetFromCache, 2, 1) \
--- /dev/null
+// Copyright 2014 the V8 project authors. All rights reserved.
+// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
+// Flags: --allow-natives-syntax --harmony
+var _string = "foo";
+%InternalizeString(_string);
# that the parser doesn't bit-rot. Change the values as needed when you add,
# remove or change runtime functions, but make sure we don't lose our ability
# to parse them!
-EXPECTED_FUNCTION_COUNT = 414
-EXPECTED_FUZZABLE_COUNT = 329
+EXPECTED_FUNCTION_COUNT = 415
+EXPECTED_FUZZABLE_COUNT = 330
EXPECTED_CCTEST_COUNT = 6
EXPECTED_UNKNOWN_COUNT = 4
EXPECTED_BUILTINS_COUNT = 806