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

Side by Side Diff: test/cctest/test-strings.cc

Issue 2796233003: [heap] Evacuation for young generation (Closed)
Patch Set: Disable flag Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/cctest/heap/test-spaces.cc ('k') | test/unittests/heap/spaces-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 explicit OneByteVectorResource(i::Vector<const char> vector) 1183 explicit OneByteVectorResource(i::Vector<const char> vector)
1184 : data_(vector) {} 1184 : data_(vector) {}
1185 virtual ~OneByteVectorResource() {} 1185 virtual ~OneByteVectorResource() {}
1186 virtual size_t length() const { return data_.length(); } 1186 virtual size_t length() const { return data_.length(); }
1187 virtual const char* data() const { return data_.start(); } 1187 virtual const char* data() const { return data_.start(); }
1188 private: 1188 private:
1189 i::Vector<const char> data_; 1189 i::Vector<const char> data_;
1190 }; 1190 };
1191 1191
1192 TEST(InternalizeExternal) { 1192 TEST(InternalizeExternal) {
1193 // TODO(mlippautz): Remove once we add support for forwarding ThinStrings in
1194 // minor MC.
1195 if (FLAG_minor_mc) return;
1193 FLAG_thin_strings = true; 1196 FLAG_thin_strings = true;
1194 CcTest::InitializeVM(); 1197 CcTest::InitializeVM();
1195 i::Isolate* isolate = CcTest::i_isolate(); 1198 i::Isolate* isolate = CcTest::i_isolate();
1196 Factory* factory = isolate->factory(); 1199 Factory* factory = isolate->factory();
1197 // This won't leak; the external string mechanism will call Dispose() on it. 1200 // This won't leak; the external string mechanism will call Dispose() on it.
1198 OneByteVectorResource* resource = 1201 OneByteVectorResource* resource =
1199 new OneByteVectorResource(i::Vector<const char>("prop", 4)); 1202 new OneByteVectorResource(i::Vector<const char>("prop", 4));
1200 { 1203 {
1201 v8::HandleScope scope(CcTest::isolate()); 1204 v8::HandleScope scope(CcTest::isolate());
1202 v8::Local<v8::String> ext_string = 1205 v8::Local<v8::String> ext_string =
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 CHECK_EQ(1, CompileRun("external.indexOf('', 1)") 1660 CHECK_EQ(1, CompileRun("external.indexOf('', 1)")
1658 ->Int32Value(context.local()) 1661 ->Int32Value(context.local())
1659 .FromJust()); 1662 .FromJust());
1660 CHECK_EQ(-1, CompileRun("external.indexOf('a', 1)") 1663 CHECK_EQ(-1, CompileRun("external.indexOf('a', 1)")
1661 ->Int32Value(context.local()) 1664 ->Int32Value(context.local())
1662 .FromJust()); 1665 .FromJust());
1663 CHECK_EQ(-1, CompileRun("external.indexOf('$')") 1666 CHECK_EQ(-1, CompileRun("external.indexOf('$')")
1664 ->Int32Value(context.local()) 1667 ->Int32Value(context.local())
1665 .FromJust()); 1668 .FromJust());
1666 } 1669 }
OLDNEW
« no previous file with comments | « test/cctest/heap/test-spaces.cc ('k') | test/unittests/heap/spaces-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698