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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 754863002: Optimize testing for an index's existence in packed Arrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: All fixed Created 6 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 | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | src/runtime/runtime.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after
4371 DCHECK(expr->arguments()->length() == 0); 4371 DCHECK(expr->arguments()->length() == 0);
4372 ExternalReference debug_is_active = 4372 ExternalReference debug_is_active =
4373 ExternalReference::debug_is_active_address(isolate()); 4373 ExternalReference::debug_is_active_address(isolate());
4374 __ mov(ip, Operand(debug_is_active)); 4374 __ mov(ip, Operand(debug_is_active));
4375 __ ldrb(r0, MemOperand(ip)); 4375 __ ldrb(r0, MemOperand(ip));
4376 __ SmiTag(r0); 4376 __ SmiTag(r0);
4377 context()->Plug(r0); 4377 context()->Plug(r0);
4378 } 4378 }
4379 4379
4380 4380
4381 void FullCodeGenerator::EmitHasFastPackedElements(CallRuntime* expr) {
4382 ZoneList<Expression*>* args = expr->arguments();
4383 DCHECK(args->length() == 1);
4384
4385 VisitForAccumulatorValue(args->at(0));
4386
4387 Label materialize_true, materialize_false;
4388 Label* if_true = NULL;
4389 Label* if_false = NULL;
4390 Label* fall_through = NULL;
4391 context()->PrepareTest(&materialize_true, &materialize_false, &if_true,
4392 &if_false, &fall_through);
4393
4394 Register object = r0;
4395 Register map = r1;
4396 Register elements_kind = r2;
4397
4398 __ JumpIfSmi(object, if_false);
4399 __ ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
4400 __ ldrb(elements_kind, FieldMemOperand(map, Map::kBitField2Offset));
4401 __ mov(elements_kind,
4402 Operand(elements_kind, LSR, Map::ElementsKindBits::kShift));
4403 __ cmp(elements_kind, Operand(FAST_SMI_ELEMENTS));
4404 __ b(eq, if_true);
4405 __ cmp(elements_kind, Operand(FAST_ELEMENTS));
4406 __ b(eq, if_true);
4407 __ cmp(elements_kind, Operand(FAST_DOUBLE_ELEMENTS));
4408 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4409 Split(eq, if_true, if_false, fall_through);
4410
4411 context()->Plug(if_true, if_false);
4412 }
4413
4414
4381 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 4415 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
4382 if (expr->function() != NULL && 4416 if (expr->function() != NULL &&
4383 expr->function()->intrinsic_type == Runtime::INLINE) { 4417 expr->function()->intrinsic_type == Runtime::INLINE) {
4384 Comment cmnt(masm_, "[ InlineRuntimeCall"); 4418 Comment cmnt(masm_, "[ InlineRuntimeCall");
4385 EmitInlineRuntimeCall(expr); 4419 EmitInlineRuntimeCall(expr);
4386 return; 4420 return;
4387 } 4421 }
4388 4422
4389 Comment cmnt(masm_, "[ CallRuntime"); 4423 Comment cmnt(masm_, "[ CallRuntime");
4390 ZoneList<Expression*>* args = expr->arguments(); 4424 ZoneList<Expression*>* args = expr->arguments();
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
5298 5332
5299 DCHECK(interrupt_address == 5333 DCHECK(interrupt_address ==
5300 isolate->builtins()->OsrAfterStackCheck()->entry()); 5334 isolate->builtins()->OsrAfterStackCheck()->entry());
5301 return OSR_AFTER_STACK_CHECK; 5335 return OSR_AFTER_STACK_CHECK;
5302 } 5336 }
5303 5337
5304 5338
5305 } } // namespace v8::internal 5339 } } // namespace v8::internal
5306 5340
5307 #endif // V8_TARGET_ARCH_ARM 5341 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | src/runtime/runtime.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698