| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/isolate.h" | 5 #include "src/isolate.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2378 } | 2378 } |
| 2379 | 2379 |
| 2380 | 2380 |
| 2381 CodeTracer* Isolate::GetCodeTracer() { | 2381 CodeTracer* Isolate::GetCodeTracer() { |
| 2382 if (code_tracer() == NULL) set_code_tracer(new CodeTracer(id())); | 2382 if (code_tracer() == NULL) set_code_tracer(new CodeTracer(id())); |
| 2383 return code_tracer(); | 2383 return code_tracer(); |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 | 2386 |
| 2387 Map* Isolate::get_initial_js_array_map(ElementsKind kind, Strength strength) { | 2387 Map* Isolate::get_initial_js_array_map(ElementsKind kind, Strength strength) { |
| 2388 Context* native_context = context()->native_context(); | 2388 if (IsFastElementsKind(kind)) { |
| 2389 Object* maybe_map_array = is_strong(strength) | 2389 DisallowHeapAllocation no_gc; |
| 2390 ? native_context->js_array_strong_maps() | 2390 Object* const initial_js_array_map = context()->native_context()->get( |
| 2391 : native_context->js_array_maps(); | 2391 Context::ArrayMapIndex(kind, strength)); |
| 2392 if (!maybe_map_array->IsUndefined()) { | 2392 if (!initial_js_array_map->IsUndefined()) { |
| 2393 Object* maybe_transitioned_map = | 2393 return Map::cast(initial_js_array_map); |
| 2394 FixedArray::cast(maybe_map_array)->get(kind); | |
| 2395 if (!maybe_transitioned_map->IsUndefined()) { | |
| 2396 return Map::cast(maybe_transitioned_map); | |
| 2397 } | 2394 } |
| 2398 } | 2395 } |
| 2399 return NULL; | 2396 return nullptr; |
| 2400 } | 2397 } |
| 2401 | 2398 |
| 2402 | 2399 |
| 2403 bool Isolate::use_crankshaft() const { | 2400 bool Isolate::use_crankshaft() const { |
| 2404 return FLAG_crankshaft && | 2401 return FLAG_crankshaft && |
| 2405 !serializer_enabled_ && | 2402 !serializer_enabled_ && |
| 2406 CpuFeatures::SupportsCrankshaft(); | 2403 CpuFeatures::SupportsCrankshaft(); |
| 2407 } | 2404 } |
| 2408 | 2405 |
| 2409 | 2406 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2812 // Then check whether this scope intercepts. | 2809 // Then check whether this scope intercepts. |
| 2813 if ((flag & intercept_mask_)) { | 2810 if ((flag & intercept_mask_)) { |
| 2814 intercepted_flags_ |= flag; | 2811 intercepted_flags_ |= flag; |
| 2815 return true; | 2812 return true; |
| 2816 } | 2813 } |
| 2817 return false; | 2814 return false; |
| 2818 } | 2815 } |
| 2819 | 2816 |
| 2820 } // namespace internal | 2817 } // namespace internal |
| 2821 } // namespace v8 | 2818 } // namespace v8 |
| OLD | NEW |