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

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

Issue 189913023: Use a per-isolate cache for the date object JS bits (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | no next file » | 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 CheckDST(TimeFromYearMonthDay(date_cache, year, 5, 5)); 160 CheckDST(TimeFromYearMonthDay(date_cache, year, 5, 5));
161 } 161 }
162 CheckDST((august_20 + september_10) / 2); 162 CheckDST((august_20 + september_10) / 2);
163 CheckDST(september_10); 163 CheckDST(september_10);
164 CheckDST(september_10 + 2 * 3600); 164 CheckDST(september_10 + 2 * 3600);
165 CheckDST(september_10 + 2 * 3600 - 1000); 165 CheckDST(september_10 + 2 * 3600 - 1000);
166 CheckDST(august_20 + 2 * 3600); 166 CheckDST(august_20 + 2 * 3600);
167 CheckDST(august_20 + 2 * 3600 - 1000); 167 CheckDST(august_20 + 2 * 3600 - 1000);
168 CheckDST(august_20); 168 CheckDST(august_20);
169 } 169 }
170
171
172 TEST(DateCacheVersion) {
173 FLAG_allow_natives_syntax = true;
174 v8::Isolate* isolate = CcTest::isolate();
175 v8::Isolate::Scope isolate_scope(isolate);
176 v8::HandleScope scope(isolate);
177 v8::Handle<v8::Context> context = v8::Context::New(isolate);
178 v8::Context::Scope context_scope(context);
179 v8::Handle<v8::Array> date_cache_version =
180 v8::Handle<v8::Array>::Cast(CompileRun("%DateCacheVersion()"));
181
182 CHECK_EQ(1, static_cast<int32_t>(date_cache_version->Length()));
183 CHECK(date_cache_version->Get(0)->IsNumber());
184 CHECK_EQ(0.0, date_cache_version->Get(0)->NumberValue());
185
186 v8::Date::DateTimeConfigurationChangeNotification(isolate);
187
188 CHECK_EQ(1, static_cast<int32_t>(date_cache_version->Length()));
189 CHECK(date_cache_version->Get(0)->IsNumber());
190 CHECK_EQ(1.0, date_cache_version->Get(0)->NumberValue());
191 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698