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

Side by Side Diff: src/bootstrapper.cc

Issue 639723002: Avoid unnecessary data race on FLAG_track_double_fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/extensions/externalize-string-extension.h" 9 #include "src/extensions/externalize-string-extension.h"
10 #include "src/extensions/free-buffer-extension.h" 10 #include "src/extensions/free-buffer-extension.h"
(...skipping 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 native_context()->set_sloppy_function_map( 2583 native_context()->set_sloppy_function_map(
2584 *sloppy_function_map_writable_prototype_); 2584 *sloppy_function_map_writable_prototype_);
2585 native_context()->set_strict_function_map( 2585 native_context()->set_strict_function_map(
2586 *strict_function_map_writable_prototype_); 2586 *strict_function_map_writable_prototype_);
2587 } 2587 }
2588 2588
2589 2589
2590 class NoTrackDoubleFieldsForSerializerScope { 2590 class NoTrackDoubleFieldsForSerializerScope {
2591 public: 2591 public:
2592 explicit NoTrackDoubleFieldsForSerializerScope(Isolate* isolate) 2592 explicit NoTrackDoubleFieldsForSerializerScope(Isolate* isolate)
2593 : flag_(FLAG_track_double_fields) { 2593 : flag_(FLAG_track_double_fields), enabled_(false) {
2594 if (isolate->serializer_enabled()) { 2594 if (isolate->serializer_enabled()) {
2595 // Disable tracking double fields because heap numbers treated as 2595 // Disable tracking double fields because heap numbers treated as
2596 // immutable by the serializer. 2596 // immutable by the serializer.
2597 FLAG_track_double_fields = false; 2597 FLAG_track_double_fields = false;
2598 enabled_ = true;
2598 } 2599 }
2599 } 2600 }
2600 2601
2601 ~NoTrackDoubleFieldsForSerializerScope() { 2602 ~NoTrackDoubleFieldsForSerializerScope() {
2602 FLAG_track_double_fields = flag_; 2603 if (enabled_) {
2604 FLAG_track_double_fields = flag_;
2605 }
2603 } 2606 }
2604 2607
2605 private: 2608 private:
2606 bool flag_; 2609 bool flag_;
2610 bool enabled_;
2607 }; 2611 };
2608 2612
2609 2613
2610 Genesis::Genesis(Isolate* isolate, 2614 Genesis::Genesis(Isolate* isolate,
2611 MaybeHandle<JSGlobalProxy> maybe_global_proxy, 2615 MaybeHandle<JSGlobalProxy> maybe_global_proxy,
2612 v8::Handle<v8::ObjectTemplate> global_proxy_template, 2616 v8::Handle<v8::ObjectTemplate> global_proxy_template,
2613 v8::ExtensionConfiguration* extensions) 2617 v8::ExtensionConfiguration* extensions)
2614 : isolate_(isolate), 2618 : isolate_(isolate),
2615 active_(isolate->bootstrapper()) { 2619 active_(isolate->bootstrapper()) {
2616 NoTrackDoubleFieldsForSerializerScope disable_scope(isolate); 2620 NoTrackDoubleFieldsForSerializerScope disable_scope(isolate);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 return from + sizeof(NestingCounterType); 2739 return from + sizeof(NestingCounterType);
2736 } 2740 }
2737 2741
2738 2742
2739 // Called when the top-level V8 mutex is destroyed. 2743 // Called when the top-level V8 mutex is destroyed.
2740 void Bootstrapper::FreeThreadResources() { 2744 void Bootstrapper::FreeThreadResources() {
2741 DCHECK(!IsActive()); 2745 DCHECK(!IsActive());
2742 } 2746 }
2743 2747
2744 } } // namespace v8::internal 2748 } } // 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