v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <stdlib.h>
#include "v8.h"
#include "api.h"
#include "factory.h"
#include "objects.h"
#include "cctest.h"
Go to the source code of this file.
Data Structures | |
class | MyRandomNumberGenerator |
class | Resource |
class | AsciiResource |
class | ConsStringStats |
class | ConsStringGenerationData |
class | AsciiVectorResource |
class | DummyResource |
class | DummyOneByteResource |
Macros | |
#define | INVALID_STRING_TEST(FUN, TYPE) |
Functions | |
void | AccumulateStats (ConsString *cons_string, ConsStringStats *stats) |
void | AccumulateStats (Handle< String > cons_string, ConsStringStats *stats) |
void | AccumulateStatsWithOperator (ConsString *cons_string, ConsStringStats *stats) |
void | VerifyConsString (Handle< String > root, ConsStringGenerationData *data) |
TEST (Traverse) | |
template<typename BuildString > | |
void | TestStringCharacterStream (BuildString build, int test_cases) |
TEST (StringCharacterStreamEdgeCases) | |
TEST (StringCharacterStreamRandom) | |
TEST (DeepAscii) | |
TEST (Utf8Conversion) | |
TEST (ExternalShortStringAdd) | |
TEST (JSONStringifySliceMadeExternal) | |
TEST (CachedHashOverflow) | |
TEST (SliceFromCons) | |
TEST (SliceFromExternal) | |
TEST (TrivialSlice) | |
TEST (SliceFromSlice) | |
TEST (AsciiArrayJoin) | |
TEST (RobustSubStringStub) | |
TEST (StringReplaceAtomTwoByteResult) | |
TEST (IsAscii) | |
TEST (Latin1IgnoreCase) | |
TEST (InvalidExternalString) | |
#define INVALID_STRING_TEST | ( | FUN, | |
TYPE | |||
) |
Definition at line 1391 of file test-strings.cc.
void AccumulateStats | ( | ConsString * | cons_string, |
ConsStringStats * | stats | ||
) |
Definition at line 318 of file test-strings.cc.
References ConsString::cast(), ConsStringStats::chars_, CHECK, CHECK_NE, ConsStringStats::empty_leaves_, ConsString::first(), ConsStringStats::leaves_, ConsStringStats::left_traversals_, String::length(), ConsStringStats::right_traversals_, and ConsString::second().
Referenced by AccumulateStats(), TestStringCharacterStream(), and VerifyConsString().
void AccumulateStats | ( | Handle< String > | cons_string, |
ConsStringStats * | stats | ||
) |
Definition at line 347 of file test-strings.cc.
References AccumulateStats(), ConsString::cast(), and ConsStringStats::chars_.
void AccumulateStatsWithOperator | ( | ConsString * | cons_string, |
ConsStringStats * | stats | ||
) |
Definition at line 357 of file test-strings.cc.
References ASSERT, ConsStringStats::chars_, CHECK, ConsStringIteratorOp::ContinueOperation(), ConsStringIteratorOp::HasMore(), Map::instance_type(), ConsStringStats::leaves_, String::length(), HeapObject::map(), v8::internal::NULL, and ConsStringIteratorOp::Operate().
Referenced by VerifyConsString().
TEST | ( | Traverse | ) |
Definition at line 567 of file test-strings.cc.
References v8::internal::FlattenString(), CcTest::InitializeVM(), and CcTest::isolate().
TEST | ( | StringCharacterStreamEdgeCases | ) |
Definition at line 765 of file test-strings.cc.
References TestStringCharacterStream().
TEST | ( | StringCharacterStreamRandom | ) |
Definition at line 846 of file test-strings.cc.
References TestStringCharacterStream().
TEST | ( | DeepAscii | ) |
Definition at line 855 of file test-strings.cc.
References v8::internal::CStrVector(), Isolate::factory(), v8::internal::FlattenString(), foo, CcTest::i_isolate(), CcTest::InitializeVM(), CcTest::isolate(), Factory::NewConsString(), and Factory::NewStringFromAscii().
TEST | ( | Utf8Conversion | ) |
Definition at line 881 of file test-strings.cc.
References CHECK_EQ, CcTest::InitializeVM(), CcTest::isolate(), String::kNormalString, String::NewFromTwoByte(), String::NewFromUtf8(), v8::internal::StrLength(), String::Utf8Length(), and String::WriteUtf8().
TEST | ( | ExternalShortStringAdd | ) |
Definition at line 928 of file test-strings.cc.
References CHECK_EQ, CHECK_GT, Context::Global(), CcTest::isolate(), ConsString::kMinLength, Integer::New(), Array::New(), String::NewExternal(), and Object::Set().
TEST | ( | JSONStringifySliceMadeExternal | ) |
Definition at line 1014 of file test-strings.cc.
References CHECK, CHECK_EQ, CcTest::InitializeVM(), CcTest::isolate(), String::Length(), String::MakeExternal(), Utils::OpenHandle(), Value::ToString(), and String::Write().
TEST | ( | CachedHashOverflow | ) |
Definition at line 1041 of file test-strings.cc.
References Smi::cast(), CHECK_EQ, Script::Compile(), Isolate::factory(), Smi::FromInt(), CcTest::i_isolate(), CcTest::InitializeVM(), CcTest::isolate(), String::NewFromUtf8(), and v8::internal::NULL.
TEST | ( | SliceFromCons | ) |
Definition at line 1088 of file test-strings.cc.
References ConsString::cast(), SlicedString::cast(), CHECK, CHECK_EQ, v8::internal::CStrVector(), Isolate::factory(), ConsString::first(), CcTest::i_isolate(), CcTest::InitializeVM(), CcTest::isolate(), Factory::NewConsString(), Factory::NewStringFromAscii(), Factory::NewSubString(), and SlicedString::parent().
TEST | ( | SliceFromExternal | ) |
Definition at line 1123 of file test-strings.cc.
References SlicedString::cast(), CHECK, CHECK_EQ, Isolate::factory(), CcTest::i_isolate(), CcTest::InitializeVM(), CcTest::isolate(), Factory::NewExternalStringFromAscii(), Factory::NewSubString(), and SlicedString::parent().
TEST | ( | TrivialSlice | ) |
Definition at line 1141 of file test-strings.cc.
References String::Cast(), CHECK, check(), CHECK_EQ, Isolate::factory(), CcTest::i_isolate(), CcTest::InitializeVM(), CcTest::isolate(), Factory::NewSubString(), and Utils::OpenHandle().
TEST | ( | SliceFromSlice | ) |
Definition at line 1171 of file test-strings.cc.
References String::Cast(), SlicedString::cast(), CHECK, CHECK_EQ, CcTest::InitializeVM(), CcTest::isolate(), Utils::OpenHandle(), and SlicedString::parent().
TEST | ( | AsciiArrayJoin | ) |
Definition at line 1200 of file test-strings.cc.
References CHECK, TryCatch::HasCaught(), CcTest::isolate(), ResourceConstraints::set_max_old_space_size(), ResourceConstraints::set_max_young_space_size(), and v8::SetResourceConstraints().
TEST | ( | RobustSubStringStub | ) |
Definition at line 1232 of file test-strings.cc.
References String::Cast(), CHECK_EQ, CcTest::InitializeVM(), CcTest::isolate(), and Utils::OpenHandle().
TEST | ( | StringReplaceAtomTwoByteResult | ) |
Definition at line 1278 of file test-strings.cc.
References String::Cast(), CHECK, CcTest::InitializeVM(), CcTest::isolate(), and Utils::OpenHandle().
TEST | ( | IsAscii | ) |
Definition at line 1295 of file test-strings.cc.
References CHECK, String::IsAscii(), String::IsOneByte(), and v8::internal::NULL.
TEST | ( | Latin1IgnoreCase | ) |
Definition at line 1323 of file test-strings.cc.
References CHECK_EQ, and v8::internal::Min().
TEST | ( | InvalidExternalString | ) |
Definition at line 1371 of file test-strings.cc.
References CHECK, Isolate::clear_pending_exception(), Isolate::factory(), Isolate::has_pending_exception(), CcTest::i_isolate(), CcTest::InitializeVM(), Handle< T >::is_null(), Factory::NewExternalStringFromAscii(), and Factory::NewExternalStringFromTwoByte().
void TestStringCharacterStream | ( | BuildString | build, |
int | test_cases | ||
) |
Definition at line 656 of file test-strings.cc.
References AccumulateStats(), ConsString::cast(), ConsString::first(), v8::internal::FlattenString(), CcTest::i_isolate(), CcTest::InitializeVM(), ConsStringGenerationData::stats_, VerifyConsString(), and ConsStringStats::VerifyEqual().
Referenced by TEST().
void VerifyConsString | ( | Handle< String > | root, |
ConsStringGenerationData * | data | ||
) |
Definition at line 380 of file test-strings.cc.
References AccumulateStats(), AccumulateStatsWithOperator(), ConsString::cast(), ConsStringStats::chars_, CHECK, ConsStringStats::empty_leaves_, ConsStringStats::leaves_, ConsStringStats::left_traversals_, ConsStringStats::Reset(), ConsStringStats::right_traversals_, ConsStringGenerationData::stats_, and ConsStringStats::VerifyEqual().
Referenced by TestStringCharacterStream().