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

Side by Side Diff: src/objects.cc

Issue 898983002: Add strong mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code review + fixes Created 5 years, 10 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 | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 14026 matching lines...) Expand 10 before | Expand all | Expand 10 after
14037 int scope_position) { 14037 int scope_position) {
14038 uint32_t hash = source->Hash(); 14038 uint32_t hash = source->Hash();
14039 if (shared->HasSourceCode()) { 14039 if (shared->HasSourceCode()) {
14040 // Instead of using the SharedFunctionInfo pointer in the hash 14040 // Instead of using the SharedFunctionInfo pointer in the hash
14041 // code computation, we use a combination of the hash of the 14041 // code computation, we use a combination of the hash of the
14042 // script source code and the start position of the calling scope. 14042 // script source code and the start position of the calling scope.
14043 // We do this to ensure that the cache entries can survive garbage 14043 // We do this to ensure that the cache entries can survive garbage
14044 // collection. 14044 // collection.
14045 Script* script(Script::cast(shared->script())); 14045 Script* script(Script::cast(shared->script()));
14046 hash ^= String::cast(script->source())->Hash(); 14046 hash ^= String::cast(script->source())->Hash();
14047 STATIC_ASSERT(LANGUAGE_END == 2); 14047 STATIC_ASSERT(LANGUAGE_END == 3);
14048 if (is_strict(language_mode)) hash ^= 0x8000; 14048 if (is_strict(language_mode)) hash ^= 0x8000;
14049 if (is_strong(language_mode)) hash ^= 0x10000;
14049 hash += scope_position; 14050 hash += scope_position;
14050 } 14051 }
14051 return hash; 14052 return hash;
14052 } 14053 }
14053 14054
14054 uint32_t Hash() OVERRIDE { 14055 uint32_t Hash() OVERRIDE {
14055 return StringSharedHashHelper(*source_, *shared_, language_mode_, 14056 return StringSharedHashHelper(*source_, *shared_, language_mode_,
14056 scope_position_); 14057 scope_position_);
14057 } 14058 }
14058 14059
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
16880 Handle<DependentCode> codes = 16881 Handle<DependentCode> codes =
16881 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16882 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16882 DependentCode::kPropertyCellChangedGroup, 16883 DependentCode::kPropertyCellChangedGroup,
16883 info->object_wrapper()); 16884 info->object_wrapper());
16884 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16885 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16885 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16886 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16886 cell, info->zone()); 16887 cell, info->zone());
16887 } 16888 }
16888 16889
16889 } } // namespace v8::internal 16890 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698