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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 1516433005: [contexts] Place the initial JSArray maps on the native context directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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/contexts.h ('k') | src/factory.cc » ('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 "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
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
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
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698