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

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

Issue 2475433008: Set global proxy internal field count based on the global object template. (Closed)
Patch Set: oops Created 4 years, 1 month 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
« src/objects.h ('K') | « test/cctest/test-api.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 2007-2010 the V8 project authors. All rights reserved. 1 // Copyright 2007-2010 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob); 409 v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob);
410 CHECK(v8_isolate); 410 CHECK(v8_isolate);
411 startup_blob.Dispose(); 411 startup_blob.Dispose();
412 { 412 {
413 v8::Isolate::Scope isolate_scope(v8_isolate); 413 v8::Isolate::Scope isolate_scope(v8_isolate);
414 414
415 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); 415 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
416 HandleScope handle_scope(isolate); 416 HandleScope handle_scope(isolate);
417 Handle<Object> root; 417 Handle<Object> root;
418 Handle<JSGlobalProxy> global_proxy = 418 Handle<JSGlobalProxy> global_proxy =
419 isolate->factory()->NewUninitializedJSGlobalProxy(); 419 isolate->factory()->NewUninitializedJSGlobalProxy(
420 JSGlobalProxy::SizeFor(0));
420 { 421 {
421 SnapshotData snapshot_data(partial_blob); 422 SnapshotData snapshot_data(partial_blob);
422 Deserializer deserializer(&snapshot_data); 423 Deserializer deserializer(&snapshot_data);
423 root = deserializer.DeserializePartial(isolate, global_proxy) 424 root = deserializer.DeserializePartial(isolate, global_proxy)
424 .ToHandleChecked(); 425 .ToHandleChecked();
425 CHECK(root->IsContext()); 426 CHECK(root->IsContext());
426 CHECK(Handle<Context>::cast(root)->global_proxy() == *global_proxy); 427 CHECK(Handle<Context>::cast(root)->global_proxy() == *global_proxy);
427 } 428 }
428 429
429 Handle<Object> root2; 430 Handle<Object> root2;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob); 529 v8::Isolate* v8_isolate = InitializeFromBlob(startup_blob);
529 CHECK(v8_isolate); 530 CHECK(v8_isolate);
530 startup_blob.Dispose(); 531 startup_blob.Dispose();
531 { 532 {
532 v8::Isolate::Scope isolate_scope(v8_isolate); 533 v8::Isolate::Scope isolate_scope(v8_isolate);
533 534
534 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); 535 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
535 HandleScope handle_scope(isolate); 536 HandleScope handle_scope(isolate);
536 Handle<Object> root; 537 Handle<Object> root;
537 Handle<JSGlobalProxy> global_proxy = 538 Handle<JSGlobalProxy> global_proxy =
538 isolate->factory()->NewUninitializedJSGlobalProxy(); 539 isolate->factory()->NewUninitializedJSGlobalProxy(
540 JSGlobalProxy::SizeFor(0));
539 { 541 {
540 SnapshotData snapshot_data(partial_blob); 542 SnapshotData snapshot_data(partial_blob);
541 Deserializer deserializer(&snapshot_data); 543 Deserializer deserializer(&snapshot_data);
542 root = deserializer.DeserializePartial(isolate, global_proxy) 544 root = deserializer.DeserializePartial(isolate, global_proxy)
543 .ToHandleChecked(); 545 .ToHandleChecked();
544 CHECK(root->IsContext()); 546 CHECK(root->IsContext());
545 Handle<Context> context = Handle<Context>::cast(root); 547 Handle<Context> context = Handle<Context>::cast(root);
546 548
547 // Add context to the weak native context list 549 // Add context to the weak native context list
548 context->set(Context::NEXT_CONTEXT_LINK, 550 context->set(Context::NEXT_CONTEXT_LINK,
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 } 2285 }
2284 delete[] blob.data; 2286 delete[] blob.data;
2285 } 2287 }
2286 2288
2287 TEST(SerializationMemoryStats) { 2289 TEST(SerializationMemoryStats) {
2288 FLAG_profile_deserialization = true; 2290 FLAG_profile_deserialization = true;
2289 FLAG_always_opt = false; 2291 FLAG_always_opt = false;
2290 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); 2292 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob();
2291 delete[] blob.data; 2293 delete[] blob.data;
2292 } 2294 }
OLDNEW
« src/objects.h ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698