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

Side by Side Diff: src/deoptimizer.cc

Issue 10443114: Progress towards making Zones independent of Isolates and Threads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nits and rebase on current bleeding_edge Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/deoptimizer.h ('k') | src/full-codegen.h » ('j') | no next file with comments »
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 // 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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 } 1283 }
1284 1284
1285 1285
1286 Object* FrameDescription::GetExpression(int index) { 1286 Object* FrameDescription::GetExpression(int index) {
1287 ASSERT_EQ(StackFrame::JAVA_SCRIPT, type_); 1287 ASSERT_EQ(StackFrame::JAVA_SCRIPT, type_);
1288 unsigned offset = GetOffsetFromSlotIndex(index); 1288 unsigned offset = GetOffsetFromSlotIndex(index);
1289 return reinterpret_cast<Object*>(*GetFrameSlotPointer(offset)); 1289 return reinterpret_cast<Object*>(*GetFrameSlotPointer(offset));
1290 } 1290 }
1291 1291
1292 1292
1293 void TranslationBuffer::Add(int32_t value) { 1293 void TranslationBuffer::Add(int32_t value, Zone* zone) {
1294 // Encode the sign bit in the least significant bit. 1294 // Encode the sign bit in the least significant bit.
1295 bool is_negative = (value < 0); 1295 bool is_negative = (value < 0);
1296 uint32_t bits = ((is_negative ? -value : value) << 1) | 1296 uint32_t bits = ((is_negative ? -value : value) << 1) |
1297 static_cast<int32_t>(is_negative); 1297 static_cast<int32_t>(is_negative);
1298 // Encode the individual bytes using the least significant bit of 1298 // Encode the individual bytes using the least significant bit of
1299 // each byte to indicate whether or not more bytes follow. 1299 // each byte to indicate whether or not more bytes follow.
1300 do { 1300 do {
1301 uint32_t next = bits >> 7; 1301 uint32_t next = bits >> 7;
1302 contents_.Add(((bits << 1) & 0xFF) | (next != 0)); 1302 contents_.Add(((bits << 1) & 0xFF) | (next != 0), zone);
1303 bits = next; 1303 bits = next;
1304 } while (bits != 0); 1304 } while (bits != 0);
1305 } 1305 }
1306 1306
1307 1307
1308 int32_t TranslationIterator::Next() { 1308 int32_t TranslationIterator::Next() {
1309 // Run through the bytes until we reach one with a least significant 1309 // Run through the bytes until we reach one with a least significant
1310 // bit of zero (marks the end). 1310 // bit of zero (marks the end).
1311 uint32_t bits = 0; 1311 uint32_t bits = 0;
1312 for (int i = 0; true; i += 7) { 1312 for (int i = 0; true; i += 7) {
(...skipping 12 matching lines...) Expand all
1325 Handle<ByteArray> TranslationBuffer::CreateByteArray() { 1325 Handle<ByteArray> TranslationBuffer::CreateByteArray() {
1326 int length = contents_.length(); 1326 int length = contents_.length();
1327 Handle<ByteArray> result = 1327 Handle<ByteArray> result =
1328 Isolate::Current()->factory()->NewByteArray(length, TENURED); 1328 Isolate::Current()->factory()->NewByteArray(length, TENURED);
1329 memcpy(result->GetDataStartAddress(), contents_.ToVector().start(), length); 1329 memcpy(result->GetDataStartAddress(), contents_.ToVector().start(), length);
1330 return result; 1330 return result;
1331 } 1331 }
1332 1332
1333 1333
1334 void Translation::BeginConstructStubFrame(int literal_id, unsigned height) { 1334 void Translation::BeginConstructStubFrame(int literal_id, unsigned height) {
1335 buffer_->Add(CONSTRUCT_STUB_FRAME); 1335 buffer_->Add(CONSTRUCT_STUB_FRAME, zone());
1336 buffer_->Add(literal_id); 1336 buffer_->Add(literal_id, zone());
1337 buffer_->Add(height); 1337 buffer_->Add(height, zone());
1338 } 1338 }
1339 1339
1340 1340
1341 void Translation::BeginArgumentsAdaptorFrame(int literal_id, unsigned height) { 1341 void Translation::BeginArgumentsAdaptorFrame(int literal_id, unsigned height) {
1342 buffer_->Add(ARGUMENTS_ADAPTOR_FRAME); 1342 buffer_->Add(ARGUMENTS_ADAPTOR_FRAME, zone());
1343 buffer_->Add(literal_id); 1343 buffer_->Add(literal_id, zone());
1344 buffer_->Add(height); 1344 buffer_->Add(height, zone());
1345 } 1345 }
1346 1346
1347 1347
1348 void Translation::BeginJSFrame(int node_id, int literal_id, unsigned height) { 1348 void Translation::BeginJSFrame(int node_id, int literal_id, unsigned height) {
1349 buffer_->Add(JS_FRAME); 1349 buffer_->Add(JS_FRAME, zone());
1350 buffer_->Add(node_id); 1350 buffer_->Add(node_id, zone());
1351 buffer_->Add(literal_id); 1351 buffer_->Add(literal_id, zone());
1352 buffer_->Add(height); 1352 buffer_->Add(height, zone());
1353 } 1353 }
1354 1354
1355 1355
1356 void Translation::StoreRegister(Register reg) { 1356 void Translation::StoreRegister(Register reg) {
1357 buffer_->Add(REGISTER); 1357 buffer_->Add(REGISTER, zone());
1358 buffer_->Add(reg.code()); 1358 buffer_->Add(reg.code(), zone());
1359 } 1359 }
1360 1360
1361 1361
1362 void Translation::StoreInt32Register(Register reg) { 1362 void Translation::StoreInt32Register(Register reg) {
1363 buffer_->Add(INT32_REGISTER); 1363 buffer_->Add(INT32_REGISTER, zone());
1364 buffer_->Add(reg.code()); 1364 buffer_->Add(reg.code(), zone());
1365 } 1365 }
1366 1366
1367 1367
1368 void Translation::StoreDoubleRegister(DoubleRegister reg) { 1368 void Translation::StoreDoubleRegister(DoubleRegister reg) {
1369 buffer_->Add(DOUBLE_REGISTER); 1369 buffer_->Add(DOUBLE_REGISTER, zone());
1370 buffer_->Add(DoubleRegister::ToAllocationIndex(reg)); 1370 buffer_->Add(DoubleRegister::ToAllocationIndex(reg), zone());
1371 } 1371 }
1372 1372
1373 1373
1374 void Translation::StoreStackSlot(int index) { 1374 void Translation::StoreStackSlot(int index) {
1375 buffer_->Add(STACK_SLOT); 1375 buffer_->Add(STACK_SLOT, zone());
1376 buffer_->Add(index); 1376 buffer_->Add(index, zone());
1377 } 1377 }
1378 1378
1379 1379
1380 void Translation::StoreInt32StackSlot(int index) { 1380 void Translation::StoreInt32StackSlot(int index) {
1381 buffer_->Add(INT32_STACK_SLOT); 1381 buffer_->Add(INT32_STACK_SLOT, zone());
1382 buffer_->Add(index); 1382 buffer_->Add(index, zone());
1383 } 1383 }
1384 1384
1385 1385
1386 void Translation::StoreDoubleStackSlot(int index) { 1386 void Translation::StoreDoubleStackSlot(int index) {
1387 buffer_->Add(DOUBLE_STACK_SLOT); 1387 buffer_->Add(DOUBLE_STACK_SLOT, zone());
1388 buffer_->Add(index); 1388 buffer_->Add(index, zone());
1389 } 1389 }
1390 1390
1391 1391
1392 void Translation::StoreLiteral(int literal_id) { 1392 void Translation::StoreLiteral(int literal_id) {
1393 buffer_->Add(LITERAL); 1393 buffer_->Add(LITERAL, zone());
1394 buffer_->Add(literal_id); 1394 buffer_->Add(literal_id, zone());
1395 } 1395 }
1396 1396
1397 1397
1398 void Translation::StoreArgumentsObject() { 1398 void Translation::StoreArgumentsObject() {
1399 buffer_->Add(ARGUMENTS_OBJECT); 1399 buffer_->Add(ARGUMENTS_OBJECT, zone());
1400 } 1400 }
1401 1401
1402 1402
1403 void Translation::MarkDuplicate() { 1403 void Translation::MarkDuplicate() {
1404 buffer_->Add(DUPLICATE); 1404 buffer_->Add(DUPLICATE, zone());
1405 } 1405 }
1406 1406
1407 1407
1408 int Translation::NumberOfOperandsFor(Opcode opcode) { 1408 int Translation::NumberOfOperandsFor(Opcode opcode) {
1409 switch (opcode) { 1409 switch (opcode) {
1410 case ARGUMENTS_OBJECT: 1410 case ARGUMENTS_OBJECT:
1411 case DUPLICATE: 1411 case DUPLICATE:
1412 return 0; 1412 return 0;
1413 case REGISTER: 1413 case REGISTER:
1414 case INT32_REGISTER: 1414 case INT32_REGISTER:
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 1659
1660 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 1660 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
1661 v->VisitPointer(BitCast<Object**>(&function_)); 1661 v->VisitPointer(BitCast<Object**>(&function_));
1662 v->VisitPointers(parameters_, parameters_ + parameters_count_); 1662 v->VisitPointers(parameters_, parameters_ + parameters_count_);
1663 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 1663 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
1664 } 1664 }
1665 1665
1666 #endif // ENABLE_DEBUGGER_SUPPORT 1666 #endif // ENABLE_DEBUGGER_SUPPORT
1667 1667
1668 } } // namespace v8::internal 1668 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698