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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 Register buffer, Register index1, int32_t index2, \ | 347 Register buffer, Register index1, int32_t index2, \ |
348 int32_t length) \ | 348 int32_t length) \ |
349 : OutOfLineCode(gen), \ | 349 : OutOfLineCode(gen), \ |
350 result_(result), \ | 350 result_(result), \ |
351 buffer_(buffer), \ | 351 buffer_(buffer), \ |
352 index1_(index1), \ | 352 index1_(index1), \ |
353 index2_(index2), \ | 353 index2_(index2), \ |
354 length_(length) {} \ | 354 length_(length) {} \ |
355 \ | 355 \ |
356 void Generate() FINAL { \ | 356 void Generate() FINAL { \ |
| 357 Label oob; \ |
357 __ leal(kScratchRegister, Operand(index1_, index2_)); \ | 358 __ leal(kScratchRegister, Operand(index1_, index2_)); \ |
358 __ xorl(result_, result_); \ | |
359 __ cmpl(kScratchRegister, Immediate(length_)); \ | 359 __ cmpl(kScratchRegister, Immediate(length_)); \ |
360 __ j(above_equal, exit()); \ | 360 __ j(above_equal, &oob, Label::kNear); \ |
361 __ asm_instr(result_, \ | 361 __ asm_instr(result_, \ |
362 Operand(buffer_, kScratchRegister, times_1, 0)); \ | 362 Operand(buffer_, kScratchRegister, times_1, 0)); \ |
| 363 __ jmp(exit()); \ |
| 364 __ bind(&oob); \ |
| 365 __ xorl(result_, result_); \ |
363 } \ | 366 } \ |
364 \ | 367 \ |
365 private: \ | 368 private: \ |
366 Register const result_; \ | 369 Register const result_; \ |
367 Register const buffer_; \ | 370 Register const buffer_; \ |
368 Register const index1_; \ | 371 Register const index1_; \ |
369 int32_t const index2_; \ | 372 int32_t const index2_; \ |
370 int32_t const length_; \ | 373 int32_t const length_; \ |
371 }; \ | 374 }; \ |
372 ool = new (zone()) \ | 375 ool = new (zone()) \ |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 } | 1414 } |
1412 } | 1415 } |
1413 MarkLazyDeoptSite(); | 1416 MarkLazyDeoptSite(); |
1414 } | 1417 } |
1415 | 1418 |
1416 #undef __ | 1419 #undef __ |
1417 | 1420 |
1418 } // namespace internal | 1421 } // namespace internal |
1419 } // namespace compiler | 1422 } // namespace compiler |
1420 } // namespace v8 | 1423 } // namespace v8 |
OLD | NEW |