update V8 to r5532 as required by WebKit r68651
Change-Id: I5f75eeffbf64b30dd5080348528d277f293490ad
diff --git a/src/codegen.cc b/src/codegen.cc
index 148cefc..92241d1 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -289,7 +289,7 @@
for (int i = 0; i < length; i++) {
Declaration* node = declarations->at(i);
Variable* var = node->proxy()->var();
- Slot* slot = var->slot();
+ Slot* slot = var->AsSlot();
// If it was not possible to allocate the variable at compile
// time, we need to "declare" it at runtime to make sure it
@@ -310,7 +310,7 @@
for (int j = 0, i = 0; i < length; i++) {
Declaration* node = declarations->at(i);
Variable* var = node->proxy()->var();
- Slot* slot = var->slot();
+ Slot* slot = var->AsSlot();
if ((slot != NULL && slot->type() == Slot::LOOKUP) || !var->is_global()) {
// Skip - already processed.
@@ -344,40 +344,35 @@
}
-// List of special runtime calls which are generated inline. For some of these
-// functions the code will be generated inline, and for others a call to a code
-// stub will be inlined.
+// Lookup table for code generators for special runtime calls which are
+// generated inline.
+#define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize) \
+ &CodeGenerator::Generate##Name,
-#define INLINE_RUNTIME_ENTRY(Name, argc, ressize) \
- {&CodeGenerator::Generate##Name, "_" #Name, argc}, \
-
-CodeGenerator::InlineRuntimeLUT CodeGenerator::kInlineRuntimeLUT[] = {
- INLINE_RUNTIME_FUNCTION_LIST(INLINE_RUNTIME_ENTRY)
+const CodeGenerator::InlineFunctionGenerator
+ CodeGenerator::kInlineFunctionGenerators[] = {
+ INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
+ INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
};
+#undef INLINE_FUNCTION_GENERATOR_ADDRESS
-#undef INLINE_RUNTIME_ENTRY
-CodeGenerator::InlineRuntimeLUT* CodeGenerator::FindInlineRuntimeLUT(
- Handle<String> name) {
- const int entries_count =
- sizeof(kInlineRuntimeLUT) / sizeof(InlineRuntimeLUT);
- for (int i = 0; i < entries_count; i++) {
- InlineRuntimeLUT* entry = &kInlineRuntimeLUT[i];
- if (name->IsEqualTo(CStrVector(entry->name))) {
- return entry;
- }
- }
- return NULL;
+CodeGenerator::InlineFunctionGenerator
+ CodeGenerator::FindInlineFunctionGenerator(Runtime::FunctionId id) {
+ return kInlineFunctionGenerators[
+ static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction)];
}
bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) {
ZoneList<Expression*>* args = node->arguments();
Handle<String> name = node->name();
- if (name->length() > 0 && name->Get(0) == '_') {
- InlineRuntimeLUT* entry = FindInlineRuntimeLUT(name);
- if (entry != NULL) {
- ((*this).*(entry->method))(args);
+ Runtime::Function* function = node->function();
+ if (function != NULL && function->intrinsic_type == Runtime::INLINE) {
+ InlineFunctionGenerator generator =
+ FindInlineFunctionGenerator(function->function_id);
+ if (generator != NULL) {
+ ((*this).*(generator))(args);
return true;
}
}
@@ -385,14 +380,6 @@
}
-int CodeGenerator::InlineRuntimeCallArgumentsCount(Handle<String> name) {
- CodeGenerator::InlineRuntimeLUT* f =
- CodeGenerator::FindInlineRuntimeLUT(name);
- if (f != NULL) return f->nargs;
- return -1;
-}
-
-
// Simple condition analysis. ALWAYS_TRUE and ALWAYS_FALSE represent a
// known result for the test expression, with no side effects.
CodeGenerator::ConditionAnalysis CodeGenerator::AnalyzeCondition(