OLD | NEW |
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 5071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5082 Handle<GlobalObject> global(CcTest::i_isolate()->context()->global_object()); | 5082 Handle<GlobalObject> global(CcTest::i_isolate()->context()->global_object()); |
5083 Handle<JSArray> array = factory->NewJSArray(2); | 5083 Handle<JSArray> array = factory->NewJSArray(2); |
5084 | 5084 |
5085 Handle<String> name = factory->InternalizeUtf8String("testArray"); | 5085 Handle<String> name = factory->InternalizeUtf8String("testArray"); |
5086 JSReceiver::SetProperty(global, name, array, SLOPPY).Check(); | 5086 JSReceiver::SetProperty(global, name, array, SLOPPY).Check(); |
5087 CompileRun("testArray[0] = 1; testArray[1] = 2; testArray.shift();"); | 5087 CompileRun("testArray[0] = 1; testArray[1] = 2; testArray.shift();"); |
5088 heap->CollectGarbage(OLD_POINTER_SPACE); | 5088 heap->CollectGarbage(OLD_POINTER_SPACE); |
5089 } | 5089 } |
5090 | 5090 |
5091 | 5091 |
| 5092 TEST(NumberStringCacheSize) { |
| 5093 CcTest::InitializeVM(); |
| 5094 Isolate* isolate = CcTest::i_isolate(); |
| 5095 Heap* heap = isolate->heap(); |
| 5096 // Test that the number-string cache has not been resized. |
| 5097 CHECK_EQ(TestHeap::kInitialNumberStringCacheSize * 2, |
| 5098 heap->number_string_cache()->length()); |
| 5099 } |
| 5100 |
| 5101 |
5092 #ifdef DEBUG | 5102 #ifdef DEBUG |
5093 TEST(PathTracer) { | 5103 TEST(PathTracer) { |
5094 CcTest::InitializeVM(); | 5104 CcTest::InitializeVM(); |
5095 v8::HandleScope scope(CcTest::isolate()); | 5105 v8::HandleScope scope(CcTest::isolate()); |
5096 | 5106 |
5097 v8::Local<v8::Value> result = CompileRun("'abc'"); | 5107 v8::Local<v8::Value> result = CompileRun("'abc'"); |
5098 Handle<Object> o = v8::Utils::OpenHandle(*result); | 5108 Handle<Object> o = v8::Utils::OpenHandle(*result); |
5099 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 5109 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
5100 } | 5110 } |
5101 #endif // DEBUG | 5111 #endif // DEBUG |
OLD | NEW |