| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 Heap* heap = CcTest::heap(); | 76 Heap* heap = CcTest::heap(); |
| 77 CheckMap(heap->meta_map(), MAP_TYPE, Map::kSize); | 77 CheckMap(heap->meta_map(), MAP_TYPE, Map::kSize); |
| 78 CheckMap(heap->heap_number_map(), HEAP_NUMBER_TYPE, HeapNumber::kSize); | 78 CheckMap(heap->heap_number_map(), HEAP_NUMBER_TYPE, HeapNumber::kSize); |
| 79 CheckMap(heap->fixed_array_map(), FIXED_ARRAY_TYPE, kVariableSizeSentinel); | 79 CheckMap(heap->fixed_array_map(), FIXED_ARRAY_TYPE, kVariableSizeSentinel); |
| 80 CheckMap(heap->string_map(), STRING_TYPE, kVariableSizeSentinel); | 80 CheckMap(heap->string_map(), STRING_TYPE, kVariableSizeSentinel); |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 static void CheckOddball(Isolate* isolate, Object* obj, const char* string) { | 84 static void CheckOddball(Isolate* isolate, Object* obj, const char* string) { |
| 85 CHECK(obj->IsOddball()); | 85 CHECK(obj->IsOddball()); |
| 86 bool exc; | |
| 87 Handle<Object> handle(obj, isolate); | 86 Handle<Object> handle(obj, isolate); |
| 88 Object* print_string = | 87 Object* print_string = |
| 89 *Execution::ToString(isolate, handle, &exc); | 88 *Execution::ToString(isolate, handle).ToHandleChecked(); |
| 90 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 89 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
| 91 } | 90 } |
| 92 | 91 |
| 93 | 92 |
| 94 static void CheckSmi(Isolate* isolate, int value, const char* string) { | 93 static void CheckSmi(Isolate* isolate, int value, const char* string) { |
| 95 bool exc; | |
| 96 Handle<Object> handle(Smi::FromInt(value), isolate); | 94 Handle<Object> handle(Smi::FromInt(value), isolate); |
| 97 Object* print_string = | 95 Object* print_string = |
| 98 *Execution::ToString(isolate, handle, &exc); | 96 *Execution::ToString(isolate, handle).ToHandleChecked(); |
| 99 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 97 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
| 100 } | 98 } |
| 101 | 99 |
| 102 | 100 |
| 103 static void CheckNumber(Isolate* isolate, double value, const char* string) { | 101 static void CheckNumber(Isolate* isolate, double value, const char* string) { |
| 104 Object* obj = CcTest::heap()->NumberFromDouble(value)->ToObjectChecked(); | 102 Object* obj = CcTest::heap()->NumberFromDouble(value)->ToObjectChecked(); |
| 105 CHECK(obj->IsNumber()); | 103 CHECK(obj->IsNumber()); |
| 106 bool exc; | |
| 107 Handle<Object> handle(obj, isolate); | 104 Handle<Object> handle(obj, isolate); |
| 108 Object* print_string = | 105 Object* print_string = |
| 109 *Execution::ToString(isolate, handle, &exc); | 106 *Execution::ToString(isolate, handle).ToHandleChecked(); |
| 110 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 107 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
| 111 } | 108 } |
| 112 | 109 |
| 113 | 110 |
| 114 static void CheckFindCodeObject(Isolate* isolate) { | 111 static void CheckFindCodeObject(Isolate* isolate) { |
| 115 // Test FindCodeObject | 112 // Test FindCodeObject |
| 116 #define __ assm. | 113 #define __ assm. |
| 117 | 114 |
| 118 Assembler assm(isolate, NULL, 0); | 115 Assembler assm(isolate, NULL, 0); |
| 119 | 116 |
| (...skipping 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3935 v8::Context::Scope cscope(context); | 3932 v8::Context::Scope cscope(context); |
| 3936 | 3933 |
| 3937 v8::Local<v8::Value> result = CompileRun( | 3934 v8::Local<v8::Value> result = CompileRun( |
| 3938 "var locals = '';" | 3935 "var locals = '';" |
| 3939 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';" | 3936 "for (var i = 0; i < 512; i++) locals += 'var v' + i + '= 42;';" |
| 3940 "eval('function f() {' + locals + 'return function() { return v0; }; }');" | 3937 "eval('function f() {' + locals + 'return function() { return v0; }; }');" |
| 3941 "interrupt();" // This triggers a fake stack overflow in f. | 3938 "interrupt();" // This triggers a fake stack overflow in f. |
| 3942 "f()()"); | 3939 "f()()"); |
| 3943 CHECK_EQ(42.0, result->ToNumber()->Value()); | 3940 CHECK_EQ(42.0, result->ToNumber()->Value()); |
| 3944 } | 3941 } |
| OLD | NEW |