OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/compilation-cache.h" | 5 #include "src/compilation-cache.h" |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/counters.h" | 8 #include "src/counters.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 int column_offset, | 117 int column_offset, |
118 ScriptOriginOptions resource_options) { | 118 ScriptOriginOptions resource_options) { |
119 Handle<Script> script = | 119 Handle<Script> script = |
120 Handle<Script>(Script::cast(function_info->script()), isolate()); | 120 Handle<Script>(Script::cast(function_info->script()), isolate()); |
121 // If the script name isn't set, the boilerplate script should have | 121 // If the script name isn't set, the boilerplate script should have |
122 // an undefined name to have the same origin. | 122 // an undefined name to have the same origin. |
123 if (name.is_null()) { | 123 if (name.is_null()) { |
124 return script->name()->IsUndefined(); | 124 return script->name()->IsUndefined(); |
125 } | 125 } |
126 // Do the fast bailout checks first. | 126 // Do the fast bailout checks first. |
127 if (line_offset != script->line_offset()->value()) return false; | 127 if (line_offset != script->line_offset()) return false; |
128 if (column_offset != script->column_offset()->value()) return false; | 128 if (column_offset != script->column_offset()) return false; |
129 // Check that both names are strings. If not, no match. | 129 // Check that both names are strings. If not, no match. |
130 if (!name->IsString() || !script->name()->IsString()) return false; | 130 if (!name->IsString() || !script->name()->IsString()) return false; |
131 // Are the origin_options same? | 131 // Are the origin_options same? |
132 if (resource_options.Flags() != script->origin_options().Flags()) | 132 if (resource_options.Flags() != script->origin_options().Flags()) |
133 return false; | 133 return false; |
134 // Compare the two name strings for equality. | 134 // Compare the two name strings for equality. |
135 return String::Equals(Handle<String>::cast(name), | 135 return String::Equals(Handle<String>::cast(name), |
136 Handle<String>(String::cast(script->name()))); | 136 Handle<String>(String::cast(script->name()))); |
137 } | 137 } |
138 | 138 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 397 |
398 | 398 |
399 void CompilationCache::Disable() { | 399 void CompilationCache::Disable() { |
400 enabled_ = false; | 400 enabled_ = false; |
401 Clear(); | 401 Clear(); |
402 } | 402 } |
403 | 403 |
404 | 404 |
405 } // namespace internal | 405 } // namespace internal |
406 } // namespace v8 | 406 } // namespace v8 |
OLD | NEW |