| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 CheckMap(HEAP->meta_map(), MAP_TYPE, Map::kSize); | 75 CheckMap(HEAP->meta_map(), MAP_TYPE, Map::kSize); |
| 76 CheckMap(HEAP->heap_number_map(), HEAP_NUMBER_TYPE, HeapNumber::kSize); | 76 CheckMap(HEAP->heap_number_map(), HEAP_NUMBER_TYPE, HeapNumber::kSize); |
| 77 CheckMap(HEAP->fixed_array_map(), FIXED_ARRAY_TYPE, kVariableSizeSentinel); | 77 CheckMap(HEAP->fixed_array_map(), FIXED_ARRAY_TYPE, kVariableSizeSentinel); |
| 78 CheckMap(HEAP->string_map(), STRING_TYPE, kVariableSizeSentinel); | 78 CheckMap(HEAP->string_map(), STRING_TYPE, kVariableSizeSentinel); |
| 79 } | 79 } |
| 80 | 80 |
| 81 | 81 |
| 82 static void CheckOddball(Isolate* isolate, Object* obj, const char* string) { | 82 static void CheckOddball(Isolate* isolate, Object* obj, const char* string) { |
| 83 CHECK(obj->IsOddball()); | 83 CHECK(obj->IsOddball()); |
| 84 bool exc; | 84 bool exc; |
| 85 Handle<Object> handle(obj, isolate); |
| 85 Object* print_string = | 86 Object* print_string = |
| 86 *Execution::ToString(Handle<Object>(obj, isolate), &exc); | 87 *Execution::ToString(isolate, handle, &exc); |
| 87 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 88 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
| 88 } | 89 } |
| 89 | 90 |
| 90 | 91 |
| 91 static void CheckSmi(Isolate* isolate, int value, const char* string) { | 92 static void CheckSmi(Isolate* isolate, int value, const char* string) { |
| 92 bool exc; | 93 bool exc; |
| 94 Handle<Object> handle(Smi::FromInt(value), isolate); |
| 93 Object* print_string = | 95 Object* print_string = |
| 94 *Execution::ToString(Handle<Object>(Smi::FromInt(value), isolate), &exc); | 96 *Execution::ToString(isolate, handle, &exc); |
| 95 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 97 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
| 96 } | 98 } |
| 97 | 99 |
| 98 | 100 |
| 99 static void CheckNumber(Isolate* isolate, double value, const char* string) { | 101 static void CheckNumber(Isolate* isolate, double value, const char* string) { |
| 100 Object* obj = HEAP->NumberFromDouble(value)->ToObjectChecked(); | 102 Object* obj = HEAP->NumberFromDouble(value)->ToObjectChecked(); |
| 101 CHECK(obj->IsNumber()); | 103 CHECK(obj->IsNumber()); |
| 102 bool exc; | 104 bool exc; |
| 105 Handle<Object> handle(obj, isolate); |
| 103 Object* print_string = | 106 Object* print_string = |
| 104 *Execution::ToString(Handle<Object>(obj, isolate), &exc); | 107 *Execution::ToString(isolate, handle, &exc); |
| 105 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 108 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
| 106 } | 109 } |
| 107 | 110 |
| 108 | 111 |
| 109 static void CheckFindCodeObject(Isolate* isolate) { | 112 static void CheckFindCodeObject(Isolate* isolate) { |
| 110 // Test FindCodeObject | 113 // Test FindCodeObject |
| 111 #define __ assm. | 114 #define __ assm. |
| 112 | 115 |
| 113 Assembler assm(isolate, NULL, 0); | 116 Assembler assm(isolate, NULL, 0); |
| 114 | 117 |
| (...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3444 " var a = new Array(n);" | 3447 " var a = new Array(n);" |
| 3445 " for (var i = 0; i < n; i += 100) a[i] = i;" | 3448 " for (var i = 0; i < n; i += 100) a[i] = i;" |
| 3446 "};" | 3449 "};" |
| 3447 "f(10 * 1024 * 1024);"); | 3450 "f(10 * 1024 * 1024);"); |
| 3448 IncrementalMarking* marking = HEAP->incremental_marking(); | 3451 IncrementalMarking* marking = HEAP->incremental_marking(); |
| 3449 if (marking->IsStopped()) marking->Start(); | 3452 if (marking->IsStopped()) marking->Start(); |
| 3450 // This big step should be sufficient to mark the whole array. | 3453 // This big step should be sufficient to mark the whole array. |
| 3451 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 3454 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
| 3452 ASSERT(marking->IsComplete()); | 3455 ASSERT(marking->IsComplete()); |
| 3453 } | 3456 } |
| OLD | NEW |