OLD | NEW |
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 "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
(...skipping 3409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3420 return builder()->Add<HLoadNamedField>(constructor_function_, nullptr, | 3420 return builder()->Add<HLoadNamedField>(constructor_function_, nullptr, |
3421 access); | 3421 access); |
3422 } | 3422 } |
3423 | 3423 |
3424 // TODO(mvstanton): we should always have a constructor function if we | 3424 // TODO(mvstanton): we should always have a constructor function if we |
3425 // are creating a stub. | 3425 // are creating a stub. |
3426 HInstruction* native_context = constructor_function_ != NULL | 3426 HInstruction* native_context = constructor_function_ != NULL |
3427 ? builder()->BuildGetNativeContext(constructor_function_) | 3427 ? builder()->BuildGetNativeContext(constructor_function_) |
3428 : builder()->BuildGetNativeContext(); | 3428 : builder()->BuildGetNativeContext(); |
3429 | 3429 |
3430 HInstruction* index = builder()->Add<HConstant>( | 3430 HObjectAccess access = |
3431 static_cast<int32_t>(Context::JS_ARRAY_MAPS_INDEX)); | 3431 HObjectAccess::ForContextSlot(Context::ArrayMapIndex(kind_)); |
3432 | 3432 return builder()->Add<HLoadNamedField>(native_context, nullptr, access); |
3433 HInstruction* map_array = builder()->Add<HLoadKeyed>( | |
3434 native_context, index, nullptr, nullptr, FAST_ELEMENTS); | |
3435 | |
3436 HInstruction* kind_index = builder()->Add<HConstant>(kind_); | |
3437 | |
3438 return builder()->Add<HLoadKeyed>(map_array, kind_index, nullptr, nullptr, | |
3439 FAST_ELEMENTS); | |
3440 } | 3433 } |
3441 | 3434 |
3442 | 3435 |
3443 HValue* HGraphBuilder::JSArrayBuilder::EmitInternalMapCode() { | 3436 HValue* HGraphBuilder::JSArrayBuilder::EmitInternalMapCode() { |
3444 // Find the map near the constructor function | 3437 // Find the map near the constructor function |
3445 HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap(); | 3438 HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap(); |
3446 return builder()->Add<HLoadNamedField>(constructor_function_, nullptr, | 3439 return builder()->Add<HLoadNamedField>(constructor_function_, nullptr, |
3447 access); | 3440 access); |
3448 } | 3441 } |
3449 | 3442 |
(...skipping 10172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13622 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13615 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13623 } | 13616 } |
13624 | 13617 |
13625 #ifdef DEBUG | 13618 #ifdef DEBUG |
13626 graph_->Verify(false); // No full verify. | 13619 graph_->Verify(false); // No full verify. |
13627 #endif | 13620 #endif |
13628 } | 13621 } |
13629 | 13622 |
13630 } // namespace internal | 13623 } // namespace internal |
13631 } // namespace v8 | 13624 } // namespace v8 |
OLD | NEW |