| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 __ mov(edx, Operand(esp, 4)); | 95 __ mov(edx, Operand(esp, 4)); |
| 96 __ xor_(eax, Operand(eax)); // clear eax | 96 __ xor_(eax, Operand(eax)); // clear eax |
| 97 __ jmp(&C); | 97 __ jmp(&C); |
| 98 | 98 |
| 99 __ bind(&L); | 99 __ bind(&L); |
| 100 __ add(eax, Operand(edx)); | 100 __ add(eax, Operand(edx)); |
| 101 __ sub(Operand(edx), Immediate(1)); | 101 __ sub(Operand(edx), Immediate(1)); |
| 102 | 102 |
| 103 __ bind(&C); | 103 __ bind(&C); |
| 104 __ test(edx, Operand(edx)); | 104 __ test(edx, Operand(edx)); |
| 105 __ j(not_zero, &L, taken); | 105 __ j(not_zero, &L); |
| 106 __ ret(0); | 106 __ ret(0); |
| 107 | 107 |
| 108 CodeDesc desc; | 108 CodeDesc desc; |
| 109 assm.GetCode(&desc); | 109 assm.GetCode(&desc); |
| 110 Object* code = HEAP->CreateCode( | 110 Object* code = HEAP->CreateCode( |
| 111 desc, | 111 desc, |
| 112 Code::ComputeFlags(Code::STUB), | 112 Code::ComputeFlags(Code::STUB), |
| 113 Handle<Object>(HEAP->undefined_value()))->ToObjectChecked(); | 113 Handle<Object>(HEAP->undefined_value()))->ToObjectChecked(); |
| 114 CHECK(code->IsCode()); | 114 CHECK(code->IsCode()); |
| 115 #ifdef OBJECT_PRINT | 115 #ifdef OBJECT_PRINT |
| (...skipping 17 matching lines...) Expand all Loading... |
| 133 __ mov(edx, Operand(esp, 4)); | 133 __ mov(edx, Operand(esp, 4)); |
| 134 __ mov(eax, 1); | 134 __ mov(eax, 1); |
| 135 __ jmp(&C); | 135 __ jmp(&C); |
| 136 | 136 |
| 137 __ bind(&L); | 137 __ bind(&L); |
| 138 __ imul(eax, Operand(edx)); | 138 __ imul(eax, Operand(edx)); |
| 139 __ sub(Operand(edx), Immediate(1)); | 139 __ sub(Operand(edx), Immediate(1)); |
| 140 | 140 |
| 141 __ bind(&C); | 141 __ bind(&C); |
| 142 __ test(edx, Operand(edx)); | 142 __ test(edx, Operand(edx)); |
| 143 __ j(not_zero, &L, taken); | 143 __ j(not_zero, &L); |
| 144 __ ret(0); | 144 __ ret(0); |
| 145 | 145 |
| 146 // some relocated stuff here, not executed | 146 // some relocated stuff here, not executed |
| 147 __ mov(eax, FACTORY->true_value()); | 147 __ mov(eax, FACTORY->true_value()); |
| 148 __ jmp(NULL, RelocInfo::RUNTIME_ENTRY); | 148 __ jmp(NULL, RelocInfo::RUNTIME_ENTRY); |
| 149 | 149 |
| 150 CodeDesc desc; | 150 CodeDesc desc; |
| 151 assm.GetCode(&desc); | 151 assm.GetCode(&desc); |
| 152 Object* code = HEAP->CreateCode( | 152 Object* code = HEAP->CreateCode( |
| 153 desc, | 153 desc, |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 TEST(AssemblerIa329) { | 344 TEST(AssemblerIa329) { |
| 345 InitializeVM(); | 345 InitializeVM(); |
| 346 v8::HandleScope scope; | 346 v8::HandleScope scope; |
| 347 v8::internal::byte buffer[256]; | 347 v8::internal::byte buffer[256]; |
| 348 MacroAssembler assm(Isolate::Current(), buffer, sizeof buffer); | 348 MacroAssembler assm(Isolate::Current(), buffer, sizeof buffer); |
| 349 enum { kEqual = 0, kGreater = 1, kLess = 2, kNaN = 3, kUndefined = 4 }; | 349 enum { kEqual = 0, kGreater = 1, kLess = 2, kNaN = 3, kUndefined = 4 }; |
| 350 Label equal_l, less_l, greater_l, nan_l; | 350 Label equal_l, less_l, greater_l, nan_l; |
| 351 __ fld_d(Operand(esp, 3 * kPointerSize)); | 351 __ fld_d(Operand(esp, 3 * kPointerSize)); |
| 352 __ fld_d(Operand(esp, 1 * kPointerSize)); | 352 __ fld_d(Operand(esp, 1 * kPointerSize)); |
| 353 __ FCmp(); | 353 __ FCmp(); |
| 354 __ j(parity_even, &nan_l, taken); | 354 __ j(parity_even, &nan_l); |
| 355 __ j(equal, &equal_l, taken); | 355 __ j(equal, &equal_l); |
| 356 __ j(below, &less_l, taken); | 356 __ j(below, &less_l); |
| 357 __ j(above, &greater_l, taken); | 357 __ j(above, &greater_l); |
| 358 | 358 |
| 359 __ mov(eax, kUndefined); | 359 __ mov(eax, kUndefined); |
| 360 __ ret(0); | 360 __ ret(0); |
| 361 | 361 |
| 362 __ bind(&equal_l); | 362 __ bind(&equal_l); |
| 363 __ mov(eax, kEqual); | 363 __ mov(eax, kEqual); |
| 364 __ ret(0); | 364 __ ret(0); |
| 365 | 365 |
| 366 __ bind(&greater_l); | 366 __ bind(&greater_l); |
| 367 __ mov(eax, kGreater); | 367 __ mov(eax, kGreater); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 388 #endif | 388 #endif |
| 389 | 389 |
| 390 F7 f = FUNCTION_CAST<F7>(Code::cast(code)->entry()); | 390 F7 f = FUNCTION_CAST<F7>(Code::cast(code)->entry()); |
| 391 CHECK_EQ(kLess, f(1.1, 2.2)); | 391 CHECK_EQ(kLess, f(1.1, 2.2)); |
| 392 CHECK_EQ(kEqual, f(2.2, 2.2)); | 392 CHECK_EQ(kEqual, f(2.2, 2.2)); |
| 393 CHECK_EQ(kGreater, f(3.3, 2.2)); | 393 CHECK_EQ(kGreater, f(3.3, 2.2)); |
| 394 CHECK_EQ(kNaN, f(OS::nan_value(), 1.1)); | 394 CHECK_EQ(kNaN, f(OS::nan_value(), 1.1)); |
| 395 } | 395 } |
| 396 | 396 |
| 397 #undef __ | 397 #undef __ |
| OLD | NEW |