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

Side by Side Diff: src/ppc/lithium-codegen-ppc.cc

Issue 1108313003: Add HArrayBufferNotNeutered instruction (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 7 months 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 5407 matching lines...) Expand 10 before | Expand all | Expand 10 after
5418 5418
5419 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { 5419 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
5420 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 5420 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
5421 LOperand* input = instr->value(); 5421 LOperand* input = instr->value();
5422 __ TestIfSmi(ToRegister(input), r0); 5422 __ TestIfSmi(ToRegister(input), r0);
5423 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0); 5423 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0);
5424 } 5424 }
5425 } 5425 }
5426 5426
5427 5427
5428 void LCodeGen::DoCheckArrayBufferNotNeutered(
5429 LCheckArrayBufferNotNeutered* instr) {
5430 Register view = ToRegister(instr->view());
5431 Register scratch = scratch0();
5432
5433 Label has_no_buffer;
5434 __ LoadP(scratch, FieldMemOperand(view, JSArrayBufferView::kBufferOffset));
5435 __ JumpIfSmi(scratch, &has_no_buffer);
5436 __ LoadP(scratch, FieldMemOperand(scratch, JSArrayBuffer::kBitFieldOffset));
5437 __ andi(r0, scratch, Operand(1 << JSArrayBuffer::WasNeutered::kShift));
5438 DeoptimizeIf(ne, instr, Deoptimizer::kOutOfBounds);
5439
5440 __ bind(&has_no_buffer);
5441 }
5442
5443
5428 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { 5444 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
5429 Register input = ToRegister(instr->value()); 5445 Register input = ToRegister(instr->value());
5430 Register scratch = scratch0(); 5446 Register scratch = scratch0();
5431 5447
5432 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); 5448 __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5433 __ lbz(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); 5449 __ lbz(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
5434 5450
5435 if (instr->hydrogen()->is_interval_check()) { 5451 if (instr->hydrogen()->is_interval_check()) {
5436 InstanceType first; 5452 InstanceType first;
5437 InstanceType last; 5453 InstanceType last;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
6193 __ Push(scope_info); 6209 __ Push(scope_info);
6194 __ push(ToRegister(instr->function())); 6210 __ push(ToRegister(instr->function()));
6195 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6211 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6196 RecordSafepoint(Safepoint::kNoLazyDeopt); 6212 RecordSafepoint(Safepoint::kNoLazyDeopt);
6197 } 6213 }
6198 6214
6199 6215
6200 #undef __ 6216 #undef __
6201 } 6217 }
6202 } // namespace v8::internal 6218 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698