Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: test/cctest/test-api.cc

Issue 131363008: A64: Synchronize with r15922. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.status ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index fa671dc66173057586d78c2f1b6faf22627b6393..7cb3c04087b69d5238b904861e20d4aaf75fc3fa 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -49,6 +49,7 @@
#include "snapshot.h"
#include "unicode-inl.h"
#include "utils.h"
+#include "vm-state.h"
static const bool kLogThreading = false;
@@ -620,6 +621,41 @@ TEST(MakingExternalAsciiStringConditions) {
}
+TEST(MakingExternalUnalignedAsciiString) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+
+ CompileRun("function cons(a, b) { return a + b; }"
+ "function slice(a) { return a.substring(1); }");
+ // Create a cons string that will land in old pointer space.
+ Local<String> cons = Local<String>::Cast(CompileRun(
+ "cons('abcdefghijklm', 'nopqrstuvwxyz');"));
+ // Create a sliced string that will land in old pointer space.
+ Local<String> slice = Local<String>::Cast(CompileRun(
+ "slice('abcdefghijklmnopqrstuvwxyz');"));
+
+ // Trigger GCs so that the newly allocated string moves to old gen.
+ SimulateFullSpace(HEAP->old_pointer_space());
+ HEAP->CollectGarbage(i::NEW_SPACE); // in survivor space now
+ HEAP->CollectGarbage(i::NEW_SPACE); // in old gen now
+
+ // Turn into external string with unaligned resource data.
+ int dispose_count = 0;
+ const char* c_cons = "_abcdefghijklmnopqrstuvwxyz";
+ bool success = cons->MakeExternal(
+ new TestAsciiResource(i::StrDup(c_cons) + 1, &dispose_count));
+ CHECK(success);
+ const char* c_slice = "_bcdefghijklmnopqrstuvwxyz";
+ success = slice->MakeExternal(
+ new TestAsciiResource(i::StrDup(c_slice) + 1, &dispose_count));
+ CHECK(success);
+
+ // Trigger GCs and force evacuation.
+ HEAP->CollectAllGarbage(i::Heap::kNoGCFlags);
+ HEAP->CollectAllGarbage(i::Heap::kReduceMemoryFootprintMask);
+}
+
+
THREADED_TEST(UsingExternalString) {
i::Factory* factory = i::Isolate::Current()->factory();
{
@@ -848,8 +884,8 @@ static void CheckReturnValue(const T& t, i::Address callback) {
// VMState is set to EXTERNAL.
if (isolate->cpu_profiler()->is_profiling()) {
CHECK_EQ(i::EXTERNAL, isolate->current_vm_state());
- CHECK(isolate->external_callback());
- CHECK_EQ(callback, isolate->external_callback());
+ CHECK(isolate->external_callback_scope());
+ CHECK_EQ(callback, isolate->external_callback_scope()->callback());
}
}
« no previous file with comments | « test/cctest/cctest.status ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698