OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 __ bind(&L); | 130 __ bind(&L); |
131 __ imul(eax, edx); | 131 __ imul(eax, edx); |
132 __ sub(edx, Immediate(1)); | 132 __ sub(edx, Immediate(1)); |
133 | 133 |
134 __ bind(&C); | 134 __ bind(&C); |
135 __ test(edx, edx); | 135 __ test(edx, edx); |
136 __ j(not_zero, &L); | 136 __ j(not_zero, &L); |
137 __ ret(0); | 137 __ ret(0); |
138 | 138 |
139 // some relocated stuff here, not executed | 139 // some relocated stuff here, not executed |
140 __ mov(eax, FACTORY->true_value()); | 140 __ mov(eax, isolate->factory()->true_value()); |
141 __ jmp(NULL, RelocInfo::RUNTIME_ENTRY); | 141 __ jmp(NULL, RelocInfo::RUNTIME_ENTRY); |
142 | 142 |
143 CodeDesc desc; | 143 CodeDesc desc; |
144 assm.GetCode(&desc); | 144 assm.GetCode(&desc); |
145 Object* code = isolate->heap()->CreateCode( | 145 Object* code = isolate->heap()->CreateCode( |
146 desc, | 146 desc, |
147 Code::ComputeFlags(Code::STUB), | 147 Code::ComputeFlags(Code::STUB), |
148 Handle<Code>())->ToObjectChecked(); | 148 Handle<Code>())->ToObjectChecked(); |
149 CHECK(code->IsCode()); | 149 CHECK(code->IsCode()); |
150 #ifdef OBJECT_PRINT | 150 #ifdef OBJECT_PRINT |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 F0 f = FUNCTION_CAST<F0>(code->entry()); | 470 F0 f = FUNCTION_CAST<F0>(code->entry()); |
471 int res = f(); | 471 int res = f(); |
472 CHECK_EQ(42, res); | 472 CHECK_EQ(42, res); |
473 } | 473 } |
474 | 474 |
475 | 475 |
476 | 476 |
477 | 477 |
478 #undef __ | 478 #undef __ |
OLD | NEW |