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

Side by Side Diff: src/compiler.cc

Issue 3253003: Set the code pointer when compiling a function. (Closed)
Patch Set: Created 10 years, 3 months 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
« no previous file with comments | « no previous file | 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 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 info->script(), 409 info->script(),
410 code); 410 code);
411 411
412 // Update the shared function info with the compiled code and the scope info. 412 // Update the shared function info with the compiled code and the scope info.
413 // Please note, that the order of the sharedfunction initialization is 413 // Please note, that the order of the sharedfunction initialization is
414 // important since set_scope_info might trigger a GC, causing the ASSERT 414 // important since set_scope_info might trigger a GC, causing the ASSERT
415 // below to be invalid if the code was flushed. By settting the code 415 // below to be invalid if the code was flushed. By settting the code
416 // object last we avoid this. 416 // object last we avoid this.
417 shared->set_scope_info(*SerializedScopeInfo::Create(info->scope())); 417 shared->set_scope_info(*SerializedScopeInfo::Create(info->scope()));
418 shared->set_code(*code); 418 shared->set_code(*code);
419 if (!info->closure().is_null()) {
420 info->closure()->set_code(*code);
421 }
419 422
420 // Set the expected number of properties for instances. 423 // Set the expected number of properties for instances.
421 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 424 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
422 425
423 // Set the optimication hints after performing lazy compilation, as these are 426 // Set the optimication hints after performing lazy compilation, as these are
424 // not set when the function is set up as a lazily compiled function. 427 // not set when the function is set up as a lazily compiled function.
425 shared->SetThisPropertyAssignmentsInfo( 428 shared->SetThisPropertyAssignmentsInfo(
426 lit->has_only_simple_this_property_assignments(), 429 lit->has_only_simple_this_property_assignments(),
427 *lit->this_property_assignments()); 430 *lit->this_property_assignments());
428 431
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), 569 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script),
567 *code, *func_name)); 570 *code, *func_name));
568 OPROFILE(CreateNativeCodeRegion(*func_name, 571 OPROFILE(CreateNativeCodeRegion(*func_name,
569 code->instruction_start(), 572 code->instruction_start(),
570 code->instruction_size())); 573 code->instruction_size()));
571 } 574 }
572 } 575 }
573 } 576 }
574 577
575 } } // namespace v8::internal 578 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698