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

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

Issue 14425011: api: Object::CachedProperty Base URL: gh:v8/v8.git@master
Patch Set: globalize reference Created 7 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 | « 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 6386 matching lines...) Expand 10 before | Expand all | Expand 10 after
6397 CHECK_NE(obj, context->Global()->Get(v8_str("o"))); 6397 CHECK_NE(obj, context->Global()->Get(v8_str("o")));
6398 context->Global()->Set(v8_str("o2"), obj); 6398 context->Global()->Set(v8_str("o2"), obj);
6399 v8::Handle<Value> value = 6399 v8::Handle<Value> value =
6400 Script::Compile(v8_str("o.__proto__ === o2.__proto__"))->Run(); 6400 Script::Compile(v8_str("o.__proto__ === o2.__proto__"))->Run();
6401 CHECK_EQ(v8::True(), value); 6401 CHECK_EQ(v8::True(), value);
6402 context->Global()->Set(v8_str("o"), obj); 6402 context->Global()->Set(v8_str("o"), obj);
6403 } 6403 }
6404 } 6404 }
6405 6405
6406 6406
6407 THREADED_TEST(ObjectPropertyCache) {
6408 v8::HandleScope scope(v8::Isolate::GetCurrent());
6409 const char* extension_list[] = { "v8/gc" };
6410 v8::ExtensionConfiguration extensions(1, extension_list);
6411 LocalContext context(&extensions);
6412
6413 v8::Handle<v8::Object> obj = v8::Object::New();
6414 Handle<String> symbol = String::NewSymbol("key");
6415 Handle<v8::Number> num = v8::Number::New(42);
6416 static v8::Object::CachedProperty property(symbol);
6417 for (int i = 0; i < 100; i++) {
6418 obj->Set(property, num);
6419 CHECK_EQ(obj->Get(property)->Int32Value(), 42);
6420 if (i % 10 == 0) v8_compile("gc();")->Run();
6421 }
6422 }
6423
6424
6407 static int StrCmp16(uint16_t* a, uint16_t* b) { 6425 static int StrCmp16(uint16_t* a, uint16_t* b) {
6408 while (true) { 6426 while (true) {
6409 if (*a == 0 && *b == 0) return 0; 6427 if (*a == 0 && *b == 0) return 0;
6410 if (*a != *b) return 0 + *a - *b; 6428 if (*a != *b) return 0 + *a - *b;
6411 a++; 6429 a++;
6412 b++; 6430 b++;
6413 } 6431 }
6414 } 6432 }
6415 6433
6416 6434
(...skipping 12340 matching lines...) Expand 10 before | Expand all | Expand 10 after
18757 i::Semaphore* sem_; 18775 i::Semaphore* sem_;
18758 volatile int sem_value_; 18776 volatile int sem_value_;
18759 }; 18777 };
18760 18778
18761 18779
18762 THREADED_TEST(SemaphoreInterruption) { 18780 THREADED_TEST(SemaphoreInterruption) {
18763 ThreadInterruptTest().RunTest(); 18781 ThreadInterruptTest().RunTest();
18764 } 18782 }
18765 18783
18766 #endif // WIN32 18784 #endif // WIN32
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