| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 LocalContext env(NULL, global_template); | 438 LocalContext env(NULL, global_template); |
| 439 v8::Handle<v8::Object> global_proxy = env->Global(); | 439 v8::Handle<v8::Object> global_proxy = env->Global(); |
| 440 v8::Handle<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>(); | 440 v8::Handle<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>(); |
| 441 CHECK_EQ(1, global->InternalFieldCount()); | 441 CHECK_EQ(1, global->InternalFieldCount()); |
| 442 | 442 |
| 443 i::Factory* factory = CcTest::i_isolate()->factory(); | 443 i::Factory* factory = CcTest::i_isolate()->factory(); |
| 444 i::Handle<i::String> first = | 444 i::Handle<i::String> first = |
| 445 factory->NewStringFromAscii(i::CStrVector("0123456789")); | 445 factory->NewStringFromAscii(i::CStrVector("0123456789")); |
| 446 i::Handle<i::String> second = | 446 i::Handle<i::String> second = |
| 447 factory->NewStringFromAscii(i::CStrVector("0123456789")); | 447 factory->NewStringFromAscii(i::CStrVector("0123456789")); |
| 448 i::Handle<i::String> cons_string = factory->NewConsString(first, second); | 448 i::Handle<i::String> cons_string = |
| 449 factory->NewConsString(first, second).ToHandleChecked(); |
| 449 | 450 |
| 450 global->SetInternalField(0, v8::ToApiHandle<v8::String>(cons_string)); | 451 global->SetInternalField(0, v8::ToApiHandle<v8::String>(cons_string)); |
| 451 | 452 |
| 452 v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler(); | 453 v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler(); |
| 453 const v8::HeapSnapshot* snapshot = | 454 const v8::HeapSnapshot* snapshot = |
| 454 heap_profiler->TakeHeapSnapshot(v8_str("cons_strings")); | 455 heap_profiler->TakeHeapSnapshot(v8_str("cons_strings")); |
| 455 CHECK(ValidateSnapshot(snapshot)); | 456 CHECK(ValidateSnapshot(snapshot)); |
| 456 const v8::HeapGraphNode* global_node = GetGlobalObject(snapshot); | 457 const v8::HeapGraphNode* global_node = GetGlobalObject(snapshot); |
| 457 | 458 |
| 458 const v8::HeapGraphNode* string_node = | 459 const v8::HeapGraphNode* string_node = |
| (...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2594 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2595 map.AddRange(ToAddress(0x180), 0x80, 6U); |
| 2595 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2596 map.AddRange(ToAddress(0x180), 0x80, 7U); |
| 2596 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); | 2597 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); |
| 2597 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); | 2598 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); |
| 2598 CHECK_EQ(3, static_cast<int>(map.size())); | 2599 CHECK_EQ(3, static_cast<int>(map.size())); |
| 2599 | 2600 |
| 2600 map.Clear(); | 2601 map.Clear(); |
| 2601 CHECK_EQ(0, static_cast<int>(map.size())); | 2602 CHECK_EQ(0, static_cast<int>(map.size())); |
| 2602 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); | 2603 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); |
| 2603 } | 2604 } |
| OLD | NEW |