summaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc')
-rw-r--r--deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc41
1 files changed, 21 insertions, 20 deletions
diff --git a/deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc b/deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc
index 225048de63..e3b783089c 100644
--- a/deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc
+++ b/deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc
@@ -51,7 +51,7 @@ TEST_F(TestWithNativeContext, AddCodeToEmptyCache) {
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(function->code(), isolate);
- BailoutId bailout_id(1);
+ BytecodeOffset bailout_id(1);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
bailout_id);
@@ -88,14 +88,14 @@ TEST_F(TestWithNativeContext, GrowCodeCache) {
int bailout_id = 0;
for (bailout_id = 0; bailout_id < kInitialEntries; bailout_id++) {
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
}
Handle<OSROptimizedCodeCache> osr_cache(
native_context->GetOSROptimizedCodeCache(), isolate);
EXPECT_EQ(osr_cache->length(), kInitialLength);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
native_context->GetOSROptimizedCodeCache(), isolate);
EXPECT_EQ(osr_cache->length(), kInitialLength * 2);
@@ -131,7 +131,7 @@ TEST_F(TestWithNativeContext, FindCachedEntry) {
int bailout_id = 0;
for (bailout_id = 0; bailout_id < kInitialEntries; bailout_id++) {
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
}
i::ScopedVector<char> source1(1024);
@@ -140,24 +140,25 @@ TEST_F(TestWithNativeContext, FindCachedEntry) {
Handle<SharedFunctionInfo> shared1(function1->shared(), isolate);
Handle<Code> code1(function1->code(), isolate);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared1, code1,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
Handle<OSROptimizedCodeCache> osr_cache(
native_context->GetOSROptimizedCodeCache(), isolate);
- EXPECT_EQ(osr_cache->GetOptimizedCode(shared, BailoutId(0), isolate), *code);
+ EXPECT_EQ(osr_cache->GetOptimizedCode(shared, BytecodeOffset(0), isolate),
+ *code);
EXPECT_EQ(
- osr_cache->GetOptimizedCode(shared1, BailoutId(bailout_id), isolate),
+ osr_cache->GetOptimizedCode(shared1, BytecodeOffset(bailout_id), isolate),
*code1);
RunJS("%DeoptimizeFunction(f1)");
EXPECT_TRUE(
- osr_cache->GetOptimizedCode(shared1, BailoutId(bailout_id), isolate)
+ osr_cache->GetOptimizedCode(shared1, BytecodeOffset(bailout_id), isolate)
.is_null());
osr_cache->Set(OSROptimizedCodeCache::kCachedCodeOffset,
HeapObjectReference::ClearedValue(isolate));
- EXPECT_TRUE(
- osr_cache->GetOptimizedCode(shared, BailoutId(0), isolate).is_null());
+ EXPECT_TRUE(osr_cache->GetOptimizedCode(shared, BytecodeOffset(0), isolate)
+ .is_null());
}
TEST_F(TestWithNativeContext, MaxCapacityCache) {
@@ -177,7 +178,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
// Add max_capacity - 1 entries.
for (bailout_id = 0; bailout_id < kMaxEntries - 1; bailout_id++) {
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
}
Handle<OSROptimizedCodeCache> osr_cache(
native_context->GetOSROptimizedCodeCache(), isolate);
@@ -190,7 +191,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
Handle<SharedFunctionInfo> shared1(function1->shared(), isolate);
Handle<Code> code1(function1->code(), isolate);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared1, code1,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
native_context->GetOSROptimizedCodeCache(), isolate);
EXPECT_EQ(osr_cache->length(), kMaxLength);
@@ -215,7 +216,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
Handle<Code> code2(function2->code(), isolate);
bailout_id++;
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared2, code2,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
native_context->GetOSROptimizedCodeCache(), isolate);
EXPECT_EQ(osr_cache->length(), kMaxLength);
@@ -249,7 +250,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
int bailout_id = 0;
for (bailout_id = 0; bailout_id < num_entries; bailout_id++) {
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
}
Handle<OSROptimizedCodeCache> osr_cache(
native_context->GetOSROptimizedCodeCache(), isolate);
@@ -268,7 +269,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
Handle<SharedFunctionInfo> shared1(function1->shared(), isolate);
Handle<Code> code1(function1->code(), isolate);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared1, code1,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
native_context->GetOSROptimizedCodeCache(), isolate);
EXPECT_EQ(osr_cache->length(), expected_length);
@@ -292,7 +293,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
Handle<Code> code2(function2->code(), isolate);
bailout_id++;
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared2, code2,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
native_context->GetOSROptimizedCodeCache(), isolate);
EXPECT_EQ(osr_cache->length(), expected_length);
@@ -335,10 +336,10 @@ TEST_F(TestWithNativeContext, EvictDeoptedEntriesNoCompact) {
for (bailout_id = 0; bailout_id < num_entries; bailout_id++) {
if (bailout_id == deopt_id1 || bailout_id == deopt_id2) {
OSROptimizedCodeCache::AddOptimizedCode(
- native_context, deopt_shared, deopt_code, BailoutId(bailout_id));
+ native_context, deopt_shared, deopt_code, BytecodeOffset(bailout_id));
} else {
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
}
}
Handle<OSROptimizedCodeCache> osr_cache(
@@ -392,10 +393,10 @@ TEST_F(TestWithNativeContext, EvictDeoptedEntriesCompact) {
for (bailout_id = 0; bailout_id < num_entries; bailout_id++) {
if (bailout_id % 2 == 0) {
OSROptimizedCodeCache::AddOptimizedCode(
- native_context, deopt_shared, deopt_code, BailoutId(bailout_id));
+ native_context, deopt_shared, deopt_code, BytecodeOffset(bailout_id));
} else {
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
- BailoutId(bailout_id));
+ BytecodeOffset(bailout_id));
}
}
Handle<OSROptimizedCodeCache> osr_cache(